You are not logged in.

#1 2009-02-17 20:49:55

dhave
Arch Linux f@h Team Member
From: Outside the matrix.
Registered: 2005-05-15
Posts: 1,112

Question about "fast fsck", ext4 and defragmentation status [SOLVED]

I'm trying to use fsck to do a defacto defragmentation check of an ext4 partition. I'm running fsck from a live cd (SysRescue 1.15) to check one of my ext4 partitions. The ext4 partition is unmounted, of course.

The check goes amazingly fast, but it doesn't give me any info about the percentage of non-contiguous inodes, which I understand to be the the same as the percentage of defragmentation (true?). I'm thinking this is because of the new "fast fsck" feature of ext4, as detailed below.

My question: can I force a "slow fsck" in order to get a complete check including the inode-contiguity info? Or is there another way to get at the defragmentation status using fsck?

Thanks.

FWIW, here's the info on "fast fsck" from the excellent http://kernelnewbies.org/Ext4 page:

2.7. Fast fsck

Fsck is a very slow operation, especially the first step: checking all the inodes in the file system. In Ext4, at the end of each group's inode table will be stored a list of unused inodes (with a checksum, for safety), so fsck will not check those inodes. The result is that total fsck time improves from 2 to 20 times, depending on the number of used inodes (http://kerneltrap.org/Linux/Improving_f … ds_in_Ext4). It must be noticed that it's fsck, and not Ext4, who will build the list of unused inodes. This means that you must run fsck to get the list of unused inodes built, and only the next fsck run will be faster (you need to pass a fsck in order to convert a Ext3 filesystem to Ext4 anyway). There's also a feature that takes part in this fsck speed up - "flexible block groups" - that also speeds up filesystem operations.

Last edited by dhave (2009-02-17 22:09:49)


Donate to Arch!

Tired? There's a nap for that. --anonymous

Offline

#2 2009-02-17 21:16:22

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Question about "fast fsck", ext4 and defragmentation status [SOLVED]

Woot! http://fly.isti.cnr.it/cgi-bin/dwww/usr … z?type=man

fsck.ext4 -E fragcheck /dev/foo

You might also want to try with -v.

Offline

#3 2009-02-17 21:52:39

dhave
Arch Linux f@h Team Member
From: Outside the matrix.
Registered: 2005-05-15
Posts: 1,112

Re: Question about "fast fsck", ext4 and defragmentation status [SOLVED]

Ranguvar wrote:

Woot! http://fly.isti.cnr.it/cgi-bin/dwww/usr … z?type=man

fsck.ext4 -E fragcheck /dev/foo

Thanks, Ranguvar. I had read the man page for fsck.ext3, but I hadn't run across the page for fsck.ext4. The link was helpful.


Donate to Arch!

Tired? There's a nap for that. --anonymous

Offline

#4 2009-02-17 22:09:03

dhave
Arch Linux f@h Team Member
From: Outside the matrix.
Registered: 2005-05-15
Posts: 1,112

Re: Question about "fast fsck", ext4 and defragmentation status [SOLVED]

Actually, I don't know that it was this "fast fsck" feature kicking in, or rather simply the fact that fsck saw that the fs was clean and didn't do a real check.

When I forced a check using "-f" along with the "-E fragcheck" option that Ranguvar mentioned, I got exactly the info I wanted.

Thanks again. I'm marking this one "SOLVED".

Last edited by dhave (2009-02-17 22:09:21)


Donate to Arch!

Tired? There's a nap for that. --anonymous

Offline

Board footer

Powered by FluxBB