I use a script to partition and format CF cards (connected with a USB card writer) in an automated way. After the main process I check the card again with fsck. To check bad blocks I also tried the '-c' switch, but I always get a return value != 0 and the message "FILE SYSTEM WAS MODIFIED" (see below). I get the same result when checking the very same drive several times...

Does anyone know why a) the file system is modified at all and b) why this seems to happen every time I check and not only in case of an error (like bad blocks)?

Here's the output:

linux-box# fsck.ext3 -c /dev/sdx1
e2fsck 1.40.2 (12-Jul-2007)
Checking for bad blocks (read-only test): done
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

Volume (/dev/sdx1): ***** FILE SYSTEM WAS MODIFIED *****
Volume (/dev/sdx1): 5132/245760 files (1.2% non-contiguous), 178910/1959896 blocks
link|improve this question
feedback

2 Answers

Did you try the -v switch to fsck to get more information? Also you can try to run badblocks alone and examine its output.

link|improve this answer
Thanks for the -v hint, but this does not help a lot. badblocks runs fine with return value 0. – Chris May 17 '10 at 12:56
feedback

Most likely there was a write to the filesystem "label" area. What about the date/time last fsck'd and the number of times since the last mount count fields in the filesystem label?

If you look at the tune2fs parameters, this would type of write would support the -c and -i parameters for the automatic full fsck support for an ext3 filesystem.

link|improve this answer
This makes no sense to me, running 'fsck -n /dev/sdx1' works fine with return value 0, as well as 'badblocks /dev/sdx1'. But the combination of both, 'fsck -cn /dev/sdx1', alters the file system and ends with return value 1 each time? I'm confused. – Chris May 17 '10 at 12:59
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.