LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   BTRFS cannot delete Directory not empty (https://www.linuxquestions.org/questions/linux-software-2/btrfs-cannot-delete-directory-not-empty-4175433473/)

unkie888 10-22-2012 06:41 AM

BTRFS cannot delete Directory not empty
 
Why does BTRFS do this?

rm -fr should not care if the directory is empty.

Code:

#rm -fr snapshot/weekly/
#rm: cannot remove `snapshot/weekly': Directory not empty

Code:

# uname -a
Linux bk555.racalacoustics.local 3.4.11-1.fc16.x86_64 #1 SMP Sun Sep 16 13:50:06 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


jefro 10-22-2012 05:08 PM

"Deleting subvolumes

Question: "As subvolumes appear like directories, can I delete a subvolume by doing an rm -rf on it?". Answer: Yes, you can, but that way is not the most elegant, especially when it contains several gigabytes of data scattered on thousands of files, directories and maybe other subvolumes located in the one you want to remove. It isn't elegant because rm -rf could take several minutes (or even hours!) to complete whereas something else can do the same job in the fraction of a second.

"Huh?" Yes perfectly possible, and here is the cool goodie for the readers who arrived at this point: when you want to remove a subvolume, use btrfs subvolume delete instead of rm -rf. That btrfs command will remove the snapshots in a fraction of a second, even it contains several gigabytes of data! "

From http://www.funtoo.org/wiki/BTRFS_Fun


All times are GMT -5. The time now is 05:55 PM.