NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

ScottChapman's avatar
ScottChapman
Apprentice
Nov 27, 2014

Empty directories that are apparently not empty?

So, I ended up with a few directories (Music, Pictures, Videos) which are in my /data folder that I can't remove.

I deleted the shares associated with them, but the directories cannot be removed even though they are empty (I have moved them to a subfolder to keep them "out of the way"):
root@Storage:/data/old# ls -lR
.:
total 0
drwxrwxrwx+ 1 guest guest 20 Nov 25 14:42 Music
drwxrwxrwx+ 1 guest guest 20 Nov 25 14:42 Pictures
drwxrwxrwx+ 1 guest guest 20 Nov 25 14:42 Videos

./Music:
total 0

./Pictures:
total 0

./Videos:
total 0
root@Storage:/data/old# rm -r *
rm: cannot remove `Music': Directory not empty
rm: cannot remove `Pictures': Directory not empty
rm: cannot remove `Videos': Directory not empty


I thought maybe there is a file locked or something, but rebooting it made no difference, I also tried turning off SMB and trying to remove. Not sure what's going on...

4 Replies

Replies have been turned off for this discussion
  • Oh good call. What are the general commands for cleaning that up?

    root@Storage:/data/old# btrfs subvolume list /data | grep Music
    ID 262 gen 2342 top level 5 path old/Music
    ID 267 gen 76 top level 262 path old/Music/.snapshots
    ID 272 gen 75 top level 267 path old/Music/.snapshots/1/snapshot
  • mdgm-ntgr's avatar
    mdgm-ntgr
    NETGEAR Employee Retired

    # btrfs subvolume delete /data/old/Music/.snapshots/1/snapshot
    # btrfs subvolume delete /data/old/Music/.snapshots
    # btrfs subvolume delete /data/old/Music

    Then try removing the directories e.g. using rmdir if the directories still exist.

    Be careful to enter the commands correctly. Don't delete the wrong subvolume by mistake.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More