You are not logged in.

#1 2012-04-16 16:09:10

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,865
Website

btrfs: takes a long time to access anything immediately after boot

Hi guys, bit of a strange problem this one.

Background:
Kernel: 3.4.0-rc2 (will check out rc3 later tonight)
Kernel: 3.4.0-rc3
Btrfs-progs: 0.19.20120328-2

I have a 100GB btrfs partition (used ~40GB, and I estimate >1,000,000 files), which I use to store my firefox profile, ABS builds, programming projects, websites, and scripts (basically things I want to share across my various linux installations), however, there's a significant pause between booting up, and being able to access the files on the partition. Sort of like-

Boot->log in->"vim /path/to/file/on/btrfspartition"->.................long wait, ~3 minutes................->file opened.

Once a file has been accessed on it, the filesystem is fine until the next time I reboot, so I'm guessing that it's doing something like checking all the files on the filesystem when it's first accessed for some reason.

I've run "btrfsck", and "btrfs filesystem defrag" on all the files, but nothing's changed.

Is anybody else experiencing this phenomenon? Is it supposed to happen? Should I switch to a different filesystem if I'm going to have so many files on it?

TLDR:
btrfs slow after boot. Speeds up. Expected behaviour? Advice please.

Thanks.

Last edited by WorMzy (2012-04-16 20:47:33)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#2 2012-05-11 15:08:29

ImNtReal
Member
Registered: 2011-09-26
Posts: 17

Re: btrfs: takes a long time to access anything immediately after boot

I'm not sure if I'm just being impatient, so it could be the same problem, but I've had to run btrfsck every time to get my volume to mount.  It could simply be that running the check eats up the time I'm not waiting, but it is a hassle to have to take care of this stuff manually after every reboot.  Especially since I have /home on it.  I'm running 3.3.4-1-aufs_friendly at the moment.  I'm hoping that this multi-disk btrfs volume means I can get rid of AuFS, and go with the standard Arch kernel.  Thanks.

Offline

#3 2012-06-05 15:43:16

ImNtReal
Member
Registered: 2011-09-26
Posts: 17

Re: btrfs: takes a long time to access anything immediately after boot

Adding crc32c to MODULES and btrfs to HOOKS in mkinitcpio seems to have solved the problem for me.

Offline

#4 2012-06-05 16:20:12

stronnag
Member
Registered: 2011-01-25
Posts: 61

Re: btrfs: takes a long time to access anything immediately after boot

Similar and perhaps related.  / on btrfs. Boot is fine, until 'Saving dmesg to disk' which then takes several minutes. After that it seems fine.

Offline

#5 2012-06-08 14:52:21

wind1r
Member
Registered: 2012-06-08
Posts: 1

Re: btrfs: takes a long time to access anything immediately after boot

stronnag wrote:

Similar and perhaps related.  / on btrfs. Boot is fine, until 'Saving dmesg to disk' which then takes several minutes. After that it seems fine.

Hi. I encountered the same problem. I would like to know - you have found a solution or not?

Offline

#6 2012-06-18 06:22:58

sa1
Member
Registered: 2011-08-21
Posts: 20

Re: btrfs: takes a long time to access anything immediately after boot

I had a similar problem today. The solution is to remount the btrfs directory with space_cache,

 mount / -o remount,space_cache

In kernel versions prior to 3.4 there was some workaround caching behavior which was removed from 3.4. space_cache will take some time to fill. After a small period of use, everything should be faster than before.
This remounting needs to be done only once, it is a sticky option.

It is due to this commit: http://www.mail-archive.com/linux-btrfs … 14542.html

ImNtReal wrote:

Adding crc32c to MODULES and btrfs to HOOKS in mkinitcpio seems to have solved the problem for me.

Your problem on kernel 3.3 is unrelated.

Last edited by sa1 (2012-06-18 06:30:12)

Offline

#7 2012-06-27 10:52:39

sjesman
Member
Registered: 2012-06-27
Posts: 1

Re: btrfs: takes a long time to access anything immediately after boot

I had the same problem.
After recompiling the kernel (3.4.4 in my case) with 'Btrfs POSIX Access Control List' unset (which is by default set), problem is soleved:
<*> Btrfs filesystem (EXPERIMENTAL) Unstable disk format                        │ │ 
  │ │          [ ]   Btrfs POSIX Access Control Lists                                          │ │ 
  │ │          [ ]   Btrfs with integrity check tool compiled in (DANGEROUS)

Offline

Board footer

Powered by FluxBB