LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-22-2012, 06:41 AM   #1
unkie888
Member
 
Registered: Aug 2007
Posts: 67

Rep: Reputation: 26
Unhappy 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
 
Old 10-22-2012, 05:08 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,222

Rep: Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196
"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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot delete directory: non empty because a crazy symlink rfsleal Programming 3 03-11-2012 02:17 PM
Delete folder not empty C++ ohmygoth Programming 4 12-05-2009 09:40 PM
vi delete empty line? Junior_DBA Linux - Newbie 5 09-11-2008 03:21 PM
Delete Empty files whospeaks2me Linux - Newbie 2 07-18-2003 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration