# fsck on reiserfs every boot

## Decha

Hello All,

I wasn't satisfied with the system boot time and started to investigate this today. Thought it

was due to long mount time but in fact it turns to be long fsck during startup.

Indeed, I have around 480 Gb Reiserfs partition which takes 20-30 seconds to fsck. The problem

is this fsck is triggered on every boot.

Is there any way to run fsck every 30 boots (like ext2/3) or ideally only if the partition wasn't

unmounted cleanly? Searched on web and forum but haven't found anything.

Thanks.

SY, Decha.

----------

## frostschutz

fsck every 30 boots (check forced) is something ext2 does, in this case it checks even if the filesystem is clean. It's normal and necessary to fsck all filesystems on boot, because this is what you do to find out wether the partition wasn't unmounted cleanly. If the umount was clean the fsck should take zero seconds (it sees the clean everything OK flag and quits). If it's not clean it will take a long time to check for non-journaled filesystems (whole filesystem has to be verified) and a not too long time for journaled file systems (only the affected areas recorded by the journal will be checked / the journal replayed).

If the reiserfs fsck takes so long for you then something is broken (the fsck tool or reiserfs or your filesystem / harddisk).

----------

## richard.scott

 *frostschutz wrote:*   

> If the reiserfs fsck takes so long for you then something is broken (the fsck tool or reiserfs or your filesystem / harddisk).

 

I have reiserfs ontop of lvm and it always checks and re-runs 0 items from the journal when booting too  :Sad: 

This is even after a clean shutdown i.e. typing poweroff or something similar.

----------

## frostschutz

 *richard.scott wrote:*   

> I have reiserfs ontop of lvm and it always checks and re-runs 0 items from the journal when booting too 

 

The message is completely fine and normal, it should not take 30 seconds to replay 0 transactions, instead it should take next to no time to do so. It just looks at the reiserfs superblock and journal, sees that there are 0 transactions to replay (in other words the filesystem is clean), prints a message and quits. Doing this should only take a fraction of a second altogether.

----------

## frostschutz

How long does this command take for you (while filesystem is not mounted of course)? I only have a 4GB reiserfs partition to test and it takes half a second to test, but as long as the filesystem is clean it should not take longer even for very large partitions.

```
# time fsck.reiserfs -a /dev/mapper/lvm-src 

Reiserfs super block in block 16 on 0xfe09 of format 3.6 with standard journal

Blocks (total/free): 1048576/472694 by 4096 bytes

Filesystem is clean

Replaying journal..

Reiserfs journal '/dev/mapper/lvm-src' in blocks [18..8211]: 0 transactions replayed

Checking internal tree..finished

real   0m0.493s

user   0m0.011s

sys   0m0.013s
```

----------

## richard.scott

I have a small /opt partition:

```
# time fsck.reiserfs -a /dev/mapper/vg0-opt

Reiserfs super block in block 16 on 0xfd03 of format 3.6 with standard journal

Blocks (total/free): 524288/439160 by 4096 bytes

Filesystem is clean

Replaying journal..

Reiserfs journal '/dev/mapper/vg0-opt' in blocks [18..8211]: 0 transactions replayed

Checking internal tree..finished

real    0m1.083s

user    0m0.020s

sys     0m0.100s
```

and I have a 450GB /home partition:

```
# time fsck.reiserfs -a /dev/mapper/vg0-home

Reiserfs super block in block 16 on 0xfd02 of format 3.6 with standard journal

Blocks (total/free): 118489088/13995481 by 4096 bytes

Filesystem is clean

Replaying journal..

Reiserfs journal '/dev/mapper/vg0-home' in blocks [18..8211]: 0 transactions replayed

Checking internal tree..finished

real    0m27.102s

user    0m2.390s

sys     0m0.410s
```

----------

## Nerevar

As far as I know, this is still a problem with reiserfs:

http://www.nabble.com/-patch-0-9--reiserfsprogs-patch-queue-tt15073966.html#a15073968

----------

## Decha

Hi All,

I am experience the similar timing as Richard.

Thanks, DarrenSmith, that's exactly what I am looking for. It's a pity it is in the patch queue since Jan

and still not accepted. I am wondering if reiserfsprogs Gentoo maintainer can include this patch into ebuild?

SY, Decha.

----------

## frostschutz

Hm, that sucks.  :Shocked:  I tried to reproduce it, without success (created an 1TB reiserfs, checking it still took only one second). After populating it with ~6 million files (several hundred copies of the kernel source tree) checking took 5 seconds (and that's slow). Even so you should not skip the fsck if you care for your data - so you have to hope that it's really just a matter of improving things in the fsck and not a design error of the filesystem itself.

----------

## Geralt

As far as I know ReiserFS is always slow when mounting, because it always performs some sanity checks on its B+-Tree.

I also noticed a very long bootup time on my ubuntu system on which I used once reiserfs (4.x I think). On my Arch I'm using ReiserFS 3.x and it consumed almost no time when booting.

But I prefer JFS - it's fast and reliable  :Smile: 

----------

## Decha

I have checked my partition and it is fine... Strange you can't reproduce it, slow mount/check is a known issue

with reiserfs and now we know why...

Regarding jfs - I got a lot of small files... JFS does very bad with it.  :Sad: 

/Decha

----------

## frostschutz

I'm using a mixed environment... LVM makes it easy to manage lots of partitions. So I have reiserfs only where there are tons of small files (portage, ccache, kernel sources).

----------

