Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 16th October 2013, 18:56
Mark_in_Hollywood Mark_in_Hollywood is offline
Junior Member
 
Join Date: Oct 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default btrfs says @ is @home without subvolume

In June 2013, I reformatted my disk drive as btrfs. From June to October no problem. Then about 2 weeks ago, I get a boot time message about the / being nearly full. Usually the amount of free space being reported is under a gig. As I keep /home on it's own partition, and / on it's own partition, and the / partition is 18 gig, I knew this message to be inaccurate.

I have put the output of:

sudo du -schx /* -- and other relevant information, e.g., fstab,

at

http://paste.ubuntu.com/6246498/

there you can see that /home is in / and /home uses 85 gig.

I read HaraldWeber's post about how to fix the problem at:

http://ubuntuforums.org/archive/inde...t-2003556.html

but I'm not able to understand enough to do what he did. Then I found your

http://www.howtoforge.com/a-beginners-guide-to-btrfs

and that helped but I have a few question remaining.

Harald Weber said:

"Boot from a live usb drive. Make two subvolumes, @ and @home like in my post, on your big volume (i call it /dev/sda5 here). These subvolumes appears as simple directories in /dev/sda5. Copy your root partition to @ (don't copy the subvolumes and your home directory). Move /home to @home (take care to not copy the @ subvolume too)"

I plead for some help with the command structure of this. I am not a programmer, only an end user.
Reply With Quote
Sponsored Links
  #2  
Old 17th October 2013, 08:36
HaraldWeber HaraldWeber is offline
Junior Member
 
Join Date: Oct 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I just stumbled across this post.

Your command "btrfs subvolume list /" lists massive snapshots.
I assume that apt creates snapshots before every update process but never deletes them. So all old files are kept in these snapshots and fill up your hdd.

To get rid of them you have to delete these snapshots (snapshots are simply subvolumes).
btrfs subvolume delete @apt-snapshot-*
or more selective
btrfs subvolume delete @apt-snapshot-2013-08*
for all snapshots in august.
or multiple months
btrfs subvolume delete @apt-snapshot-2013-{08..10}*

By the way whats the content of your /etc/fstab file?
Reply With Quote
  #3  
Old 17th October 2013, 20:12
Mark2013 Mark2013 is offline
Junior Member
 
Join Date: Oct 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Trying to delete the snapshots using:

" To get rid of them you have to delete these snapshots (snapshots are simply subvolumes).

btrfs subvolume delete @apt-snapshot-* "

the terminal returns:

ERROR: 'subvolume delete' requires 1 arg(s)

Netsearching for the above line, I found:

How can I delete a apt-btrfs-snapshot when the error is “Directory not empty?”

Problem was there was a subvolume within a subvolume. You need to delete all inner subvols before deleting containing vol.

btrfs subvol delete /tmp/foo/@apt-snapshot-2013-04-XX_1X:3X:XX/@ btrfs subvol delete /tmp/foo/@apt-snapshot-2013-04-XX_1X:3X:XX

but am unable to delete the snapshots as yet.
Reply With Quote
  #4  
Old 17th October 2013, 22:51
Mark_in_Hollywood Mark_in_Hollywood is offline
Junior Member
 
Join Date: Oct 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

While in LiveUSB, I found

Deleting an Apt-snapshot Btrfs Subvolume Is Hard

and following it, I was able to delete about 25 @apt-snapshot- one at a time. For some reason:

root@ubuntu:~#/ btrfs subvol delete /mnt/tmp/@apt-snapshot-*

would not work in a Live session (LiveCD or Live USB). And I had to be in the /dev directory to make deletions. The snapshots could only be deleted by copying the snapshot line from within the terminal and pasting them into the end of the delete argument.

But having manually deleted 2 pages of snapshots from seeing them in ls -l /mnt/tmp/, I was able to reboot in a regular manner, obtaining a working OS & Desktop.

Returning to the Deleting ... is Hard post, in a regular OS session, I was able to completely remove approx. 160 of the snapshots remaining, using

btrfs subvolume delete @apt-snapshot-*

There were some odd lines leftover:

Delete subvolume '/mnt/tmp/@apt-snapshot-2013-08-26_19:55:19'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-08-26_19:55:19' - Directory not empty

Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-09_10:13:00'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-09_10:13:00' - Directory not empty
Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-09_10:13:01'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-09_10:13:01' - Directory not empty

Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-19_08:35:07'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-19_08:35:07' - Directory not empty
Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-19_08:35:42'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-19_08:35:42' - Directory not empty
Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-19_08:35:43'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-19_08:35:43' - Directory not empty
Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-19_08:38:35'

Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-24_09:11:04'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-24_09:11:04' - Directory not empty
Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-24_09:11:05'
ERROR: cannot delete '/mnt/tmp/@apt-snapshot-2013-09-24_09:11:05' - Directory not empty
Delete subvolume '/mnt/tmp/@apt-snapshot-2013-09-25_08:36:59'

and a double check of that:

mark@Lexington:/$ sudo btrfs subvol list /
ID 256 gen 105872 top level 5 path @
ID 317 gen 105688 top level 5 path @apt-snapshot-2013-08-26_19:55:19
ID 318 gen 43813 top level 5 path @apt-snapshot-2013-08-26_19:55:19/@
ID 352 gen 105683 top level 5 path @apt-snapshot-2013-09-09_10:13:00
ID 353 gen 60062 top level 5 path @apt-snapshot-2013-09-09_10:13:00/@
ID 354 gen 105683 top level 5 path @apt-snapshot-2013-09-09_10:13:01
ID 355 gen 60064 top level 5 path @apt-snapshot-2013-09-09_10:13:01/@
ID 378 gen 71723 top level 5 path @apt-snapshot-2013-09-19_08:35:07
ID 379 gen 71724 top level 5 path @apt-snapshot-2013-09-19_08:35:07/@
ID 380 gen 71729 top level 5 path @apt-snapshot-2013-09-19_08:35:42
ID 381 gen 71730 top level 5 path @apt-snapshot-2013-09-19_08:35:42/@
ID 382 gen 71731 top level 5 path @apt-snapshot-2013-09-19_08:35:43
ID 383 gen 71732 top level 5 path @apt-snapshot-2013-09-19_08:35:43/@
ID 395 gen 77954 top level 5 path @apt-snapshot-2013-09-24_09:11:04
ID 396 gen 77955 top level 5 path @apt-snapshot-2013-09-24_09:11:04/@
ID 397 gen 77956 top level 5 path @apt-snapshot-2013-09-24_09:11:05
ID 398 gen 77957 top level 5 path @apt-snapshot-2013-09-24_09:11:05/@

Now on to fixing the @ seeing a @home incorrectly.

After the deletions this is the reported free space. This seems extraordinary to me, that 50% of 19gig is used.

mark@Lexington:~$ df -hT | egrep -i "file|^/"
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 btrfs 19G 7.8G 8.1G 50% /
/dev/sda6 btrfs 347G 87G 259G 26% /home

Is it necessary to keep all those snapshots for the btrfs? And since I can't delete them anyway, why does btrfs want them? Seems like a lot. In practical matters, I would have to find a significant reason to expand a boot time partition to more than 18 gig. Most Ubuntu uses 8 to 10 gig.

Last edited by Mark_in_Hollywood; 18th October 2013 at 02:34.
Reply With Quote
Reply

Bookmarks

Tags
btrfs, disk full error, subvolume

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
btrfs, lxc and ISPConfig 3 CSsab Tips/Tricks/Mods 3 26th November 2011 05:15


All times are GMT +2. The time now is 19:33.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.