dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
988
share rss forum feed


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL

Best way to manage btrfs inodes

My home machine is formatted btrfs. Yesterday I couldn't save anything with reports of a full HD. This was quite silly as the tools reported I had 60GB available. I even deleted multi-Gig ISOs to no affect.

Some Googling landed me on »btrfs.wiki.kernel.org/index.php/···_left.21

Based on some further research I ran.
sudo btrfs fi df /dev/sda1
 

That ran fine for quite some time and then died. I don't have the error message around anymore. That cleared up space and I can now do things, but it seems I cannot run anymore btrfs tools.

 ~  sudo btrfs fi df /dev/sda1                                                       
ERROR: couldn't get space info - Inappropriate ioctl for device
ERROR: get_df failed Inappropriate ioctl for device
 

I have not been able to find any information on where to go from here. I'm also not sure why I should have to do this. Shouldn't the kernel do a better job at maintaining inodes automatically? Is this my punishment for riding the bleeding edge?

--
"Padre, nobody said war was fun now bowl!" - Sherman T Potter

»maxolasersquad.com/

»maxolasersquad.blogspot.com

»www.facebook.com/maxolasersquad


Salty_Peaks

@173.255.181.x
I read this -- »forums.opensuse.org/showthread.p···artition andhttp://ubuntuforums.org/showthread.php?t=1855637 and

Yeah, I think if you want to be on the cutting edge, prepare to bleed. I still have systems that run ext3 and I've only recently moved over to ext4; if I need an extent based filesystem I usually run xfs.

You tried btrfsck yet in single user and/or from a Live CD with an unmounted filesystem yet?

Humor -- btrfs is labeled "butter filesystem" and "fsck" we all know is slang for things. btrfsck made me laugh.

dave
Premium,MVM
join:2000-05-04
not in ohio
kudos:8

1 recommendation

said by Salty_Peaks :

btrfsck made me laugh.

Lucky. It made me think of Marlon Brando.


Salty_Peaks

@173.255.181.x
reply to Maxo
Hey Maxo, any updates by chance? Hope things are better after btrfsck


paradigmfl

join:2005-07-16
Reviews:
·ooma
·Bright House
reply to Maxo
Make sure you are using a recent kernel and btrfs tools. Some of the ones which come with older distros have horrible bugs. With btrfs you ought to be using nothing more than 6 months old at any time. Also check out the mailing list. The mailing list is the place to go for problems with stuff like this.

If you want more help here can you give us some more details about your setup? Kernel version? Basics on the filesystem layout (raid1 data and meta?) etc


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL

1 edit
reply to Salty_Peaks
said by Salty_Peaks :

Hey Maxo, any updates by chance? Hope things are better after btrfsck

I burned a 14.04 live CD to boot from, but it wouldn't boot so I went to bed. I'm going to try again tonight.


timcuth
Braves Fan
Premium
join:2000-09-18
Pelham, AL
Reviews:
·Charter
·AT&T Southeast
reply to paradigmfl
said by paradigmfl:

Make sure you are using a recent kernel and btrfs tools.

Yes. For example, today's 3.15.3 kernel included quite a few patches for btrfs, some of them involving inodes.

Tim
--
"Life is like this long line, except at the end there ain't no merry-go-round." - Arthur on The King of Queens
~ Project Hope ~


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
reply to paradigmfl
said by paradigmfl:

Make sure you are using a recent kernel and btrfs tools. Some of the ones which come with older distros have horrible bugs. With btrfs you ought to be using nothing more than 6 months old at any time. Also check out the mailing list. The mailing list is the place to go for problems with stuff like this.

If you want more help here can you give us some more details about your setup? Kernel version? Basics on the filesystem layout (raid1 data and meta?) etc

I am running Ubuntu 14.04 which ships with Linux Kernel 3.13. There is not raid or anything else special setup other than a second drive (ext4) which contains the /home directory.
--
"Padre, nobody said war was fun now bowl!" - Sherman T Potter

»maxolasersquad.com/

»maxolasersquad.blogspot.com

»www.facebook.com/maxolasersquad


paradigmfl

join:2005-07-16
Reviews:
·ooma
·Bright House
reply to Maxo
It needs to be based on where you mounted the btrfs fs, not the device.

So if it is your root:

sudo btrfs fi df /
 

If it is your /home

sudo btrfs fi df /home
 


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
reply to Maxo
I got booted into the live CD finally.
# mount /dev/sda1 /mnt
# btrfs fi df /mnt
Data, single: total=195.64GiB, used=180.47GiB
System, single: total=32.00MiB, used=32.00KiB
Metadata, single: total=3.00GiB, used=1.50GiB
 


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
# sudo umount /dev/sda1
# btrfsck /dev/sda1
Checking filesystem on /dev/sda1
UUID: c899fc10-b3eb-4b08-af67-ad608e113455
checking extents
checking free space cache
checking fs roots
checking csums
checking root refs
found 72666843153 bytes used err is 0
total csum bytes: 189061584
total tree bytes: 1613287424
total fs tree bytes: 1290391552
total extent tree bytes: 100663296
btree space waste bytes: 396441084
file data blocks allocated: 416881074176
 referenced 192147767296
Btrfs v3.12
# mount /dev/sda1 /mnt
# btrfs fi df /mnt
Data, single: total=195.64GiB, used=180.47GiB
System, single: total=32.00MiB, used=32.00KiB
Metadata, single: total=3.00GiB, used=1.50GiB
 


paradigmfl

join:2005-07-16
Reviews:
·ooma
·Bright House
reply to Maxo
Did you try to balance it as suggested in the FAQ link you posted above?

btrfs fi balance /mountpoint -dusage=5
 

You can even do an online balance where you don't have to use the Live CD.

I notice you are using 'single'. I tried that in the past and lost a filesystem after a power failure. I highly recommend at least RAID1 and looking into scrub. It seems to work very well on btrfs.


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
%u279C  ~  sudo btrfs fi balance / -dusage=5
: unknown token '/'
usage: btrfs [filesystem] balance <command> [options] <path>
   or: btrfs [filesystem] balance <path>
 
    btrfs [filesystem] balance start [options] <path>
        Balance chunks across the devices
    btrfs [filesystem] balance pause <path>
        Pause running balance
    btrfs [filesystem] balance cancel <path>
        Cancel running or paused balance
    btrfs [filesystem] balance resume <path>
        Resume interrupted balance
    btrfs [filesystem] balance status [-v] <path>
        Show status of running or paused balance
 
'btrfs filesystem balance' command is deprecated, please use
'btrfs balance start' command instead.
%u279C  ~  sudo btrfs fi balance start / -dusage=5
Done, had to relocate 2 out of 200 chunks
%u279C  ~  
 
--
"Padre, nobody said war was fun now bowl!" - Sherman T Potter

»maxolasersquad.com/

»maxolasersquad.blogspot.com

»www.facebook.com/maxolasersquad


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
reply to paradigmfl
said by paradigmfl:

I notice you are using 'single'. I tried that in the past and lost a filesystem after a power failure. I highly recommend at least RAID1 and looking into scrub. It seems to work very well on btrfs.

When I go to build a new server I will build RAID into it. I backup my important stuff to my server so that losing any of my other machines would not be too catastrophic. I also have an offline backup solution that my server runst hrough cron.
--
"Padre, nobody said war was fun now bowl!" - Sherman T Potter

»maxolasersquad.com/

»maxolasersquad.blogspot.com

»www.facebook.com/maxolasersquad


paradigmfl

join:2005-07-16
reply to Maxo
Sorry. Try:

sudo btrfs balance start /
 


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
said by paradigmfl:

Sorry. Try:

sudo btrfs balance start /
 

This ran much longer.
 ~  sudo btrfs balance start /
[sudo] password for david: 
Done, had to relocate 198 out of 198 chunks
 
--
"Padre, nobody said war was fun now bowl!" - Sherman T Potter

»maxolasersquad.com/

»maxolasersquad.blogspot.com

»www.facebook.com/maxolasersquad


paradigmfl

join:2005-07-16
Reviews:
·ooma
·Bright House
You should have some usable free space now then. :) It's tricky though because of the way btrfs works the free space estimates are just that, estimates. Generally I would try to keep it under 90% reported utilization (by the regular 'df' command) at all time and at about 95% utilization start really deleting things.

I'm using it on a 4 disk Raid1 array with about 1 TB and it's been pretty stable. I've taken it down briefly to about 30 GB free space with no problems.

Even though you are using 'single' you can also use 'scrub' to check data integrity (although you will not be able to fix most errors with it since you are not using raid1).

btrfs scrub start /
 

You can check status with:

btrfs scrub status /
 

I also have an entry in my crontab file to do a automatic weekly scrub on Sunday at 4am:

0 4 * * 0 /usr/bin/btrfs scrub start /
 


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
Cool, thanks for the response.

Unfortunately I did not check the free space usage last night. The command I posted in the original posting freed up enough space to make my PC usable again. I'll report back with what the reported free space is now.


paradigmfl

join:2005-07-16
Reviews:
·ooma
·Bright House
said by Maxo:

Cool, thanks for the response.

Unfortunately I did not check the free space usage last night. The command I posted in the original posting freed up enough space to make my PC usable again. I'll report back with what the reported free space is now.

It should be about the same as before. The balance was for distributing the data and meta information among the disks. Sometimes this is necessary under freak conditions where some space is there but not usable due to how it is distributed. I missed that it was actually working for you before. Oh well at least you learned some new stuff in case you need it later.


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL
said by paradigmfl:

Oh well at least you learned some new stuff in case you need it later.

A constant goal of mine. Thanks for the assistance.