NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
ScottChapman
Nov 27, 2014Apprentice
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"):
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...
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
- mdgm-ntgrNETGEAR Employee Retired
# btrfs subvolume list /data | grep Music - ScottChapmanApprenticeOh 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-ntgrNETGEAR 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. - ScottChapmanApprenticeall set thanks. Conceptually I understand BTRFS. This helps: https://btrfs.wiki.kernel.org/index.php ... command%29
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!