Skip to contentSkip to conversation

reiserfsck question - session results

DISCUSSION David R. Bergstein 2 participants 5 messages Jul 29, 2002

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I recently encountered some issues on my boot partition on a system running the linux 2.4.19-rc3 kernel. There were some corruptions that were reported by reiserfsck version 3.6.2 that could be repaired using the fix-fixable option. To ensure that this could be done with the partition completely unmounted I built a rescure CD with the appropriate kernel, modules, and statically linked copies of the reiserfsprogs 3.6.2 utilities.

I had to back the partition up to an image file, so I was able to replay what happened next. Apparently, when I boot up the system in normal mode. I get a message indicating the boot partition was NOT cleanly unmounted, which is in conflict with checking the partition offline (says it was cleanly unmounted), i.e.: here is a copy of the on-line message I see in /var/log/boot.log:

Jul 28 22:49:56 rebel fsck: Reiserfs super block in block 16 on 0x815 of 
format 3.6 with standard journal
Jul 28 22:49:56 rebel fsck: Blocks (total/free): 126496/75295 by 4096 bytes
Jul 28 22:49:56 rebel fsck: Filesystem is NOT cleanly umounted

Below is a replay of what I did offline using a test copy of the partition dump (also attached are copies of the check.log and rebuild.log files in case they are any help):

[root@rebel tmp]# cp -v sdb5.img sdb5-test.img
sdb5.img' -> sdb5-test.img'
[root@rebel tmp]# v
total 1011969

drwxr-xr-x    2 root     root          104 Jul 28 22:53 ./
drwxr-xr-x   17 root     root          432 Jul 28 17:10 ../
- -rw-r--r--    1 root     root     518127616 Jul 28 17:11 sdb5.img
- -rw-r--r--    1 root     root     518127616 Jul 28 22:53 sdb5-test.img

[root@rebel tmp]# reiserfsck sdb5-test.img --logfile check.log

<-------------reiserfsck, 2002------------->
reiserfsprogs 3.6.2

Will read-only check consistency of the filesystem on sdb5-test.img Will put log info to 'check.log'

Do you want to run this program?[N/Yes] (note need to type Yes):Yes
###########
reiserfsck --check started at Sun Jul 28 22:54:21 2002
###########
Replaying journal..
No transactions found
Checking S+tree..ok
Comparing bitmaps..ok
Checking Semantic tree...
ok
There were found 2 corruptions which can be fixed with --fix-fixable
###########
reiserfsck finished at Sun Jul 28 22:54:26 2002
###########
[root@rebel tmp]# ls
check.log sdb5.img sdb5-test.img
[root@rebel tmp]# cat check.log
bad_stat_data: block 8278, [68 86 0x0 SD (0)], SD has bad nlink number
bad_stat_data: block 8305, [68 95 0x0 SD (0)], SD has bad nlink number [root@rebel tmp]# reiserfsck sdb5-test.img --fix-fixable --logfile fix.log

<-------------reiserfsck, 2002------------->
reiserfsprogs 3.6.2

Will check consistency of the filesystem on sdb5-test.img Will fix what can be fixed w/o --rebuild-tree Will put log info to 'fix.log'

Do you want to run this program?[N/Yes] (note need to type Yes):Yes
###########
reiserfsck --fix-fixable started at Sun Jul 28 22:55:06 2002
###########
Replaying journal..
No transactions found
Checking S+tree..ok
Comparing bitmaps..ok
Checking Semantic tree...
ok
No corruptions found
There are on the filesystem:
Leaves 1062
Internal nodes 8
Directories 1101
Other files 21788
Data block pointers 42347 (5 of them are zero) Safe links 0
###########
reiserfsck finished at Sun Jul 28 22:55:09 2002
###########
[root@rebel tmp]# ls
check.log fix.log sdb5.img sdb5-test.img
[root@rebel tmp]# v
total 1011973

drwxr-xr-x    2 root     root          160 Jul 28 22:55 ./
drwxr-xr-x   17 root     root          432 Jul 28 17:10 ../
- -rw-r--r--    1 root     root          142 Jul 28 22:54 check.log
- -rw-r--r--    1 root     root            0 Jul 28 22:55 fix.log
- -rw-r--r--    1 root     root     518127616 Jul 28 17:11 sdb5.img
- -rw-r--r--    1 root     root     518127616 Jul 28 22:55 sdb5-test.img

[root@rebel tmp]# view check.log
[root@rebel tmp]# reiserfsck sdb5-test.img --rebuild-tree --logfile rebuild.log
<-------------reiserfsck, 2002-------------> reiserfsprogs 3.6.2

**********************************************************
** This is an experimental version of reiserfsck, **
** !! MAKE A BACKUP FIRST !! **
** Don't run this program unless something is broken. ** ** Some types of random FS damage can be recovered from **
** by this program, which basically throws away **
** the internal nodes of the tree and then reconstructs ** ** them. This program is for use only by the desperate, ** ** and is of only beta quality. If you are using the ** ** latest reiserfsprogs and it fails please email **
** bug reports to [email protected]. **
**********************************************************

Will rebuild the filesystem (sdb5-test.img) tree
Will put log info to 'rebuild.log'

Do you want to run this program?[N/Yes] (note need to type Yes):Yes Replaying journal..
No transactions found
###########
reiserfsck --rebuild-tree started at Sun Jul 28 22:56:02 2002
###########

Pass 0:
Loading on-disk bitmap .. ok, 51626 blocks marked used
Skipping 8214 blocks (super block, journal, bitmaps) 43412 blocks will be read
0%....20%....40%....60%....80%....100% left 0, 6201
/sec "r5" hash is selected
Flushing..done
Read blocks (but not data blocks) 43412
Leaves among those 1062
Objectids found 22885

Pass 1 (will try to insert 1062 leaves):
Looking for allocable blocks .. ok
0%....20%....40%....60%....80%....100% left 0, 1062
/sec Flushing..done
1062 leaves read
1059 inserted
3 not inserted

Pass2:
0%....20%....40%....60%....80%....100% left 0, 0
/sec Flushing..done
Leaves inserted item by item 3
Pass 3 (semantic):
Flushing..done
Files found: 6342
Directories found: 1102
Symlinks found: 659
Others: 14780
Pass 3a (looking for lost dir/files):
Looking for lost directories:
Looking for lost files:0 /sec
Flushing..done done 0, 0 /sec
Objects without names 2
Empty lost dirs removed 2
Files linked to /lost+found 2
Pass 4 - done done 0, 0 /sec
Flushing..done
Syncing..done
###########
reiserfsck finished at Sun Jul 28 22:56:12 2002
###########
[root@rebel tmp]# ls
check.log fix.log rebuild.log sdb5.img sdb5-test.img [root@rebel tmp]# v
total 1011977

drwxr-xr-x    2 root     root          192 Jul 28 22:56 ./
drwxr-xr-x   17 root     root          432 Jul 28 17:10 ../
- -rw-r--r--    1 root     root          142 Jul 28 22:54 check.log
- -rw-r--r--    1 root     root            0 Jul 28 22:55 fix.log
- -rw-r--r--    1 root     root          458 Jul 28 22:56 rebuild.log
- -rw-r--r--    1 root     root     518127616 Jul 28 17:11 sdb5.img
- -rw-r--r--    1 root     root     518127616 Jul 28 22:56 sdb5-test.img

[root@rebel tmp]# view rebuild.log
[root@rebel tmp]# reiserfsck sdb5-test.img --logfile check2.log

<-------------reiserfsck, 2002------------->
reiserfsprogs 3.6.2

Will read-only check consistency of the filesystem on sdb5-test.img Will put log info to 'check2.log'

Do you want to run this program?[N/Yes] (note need to type Yes):Yes
###########
reiserfsck --check started at Sun Jul 28 22:57:19 2002
###########
Replaying journal..
No transactions found
Checking S+tree..ok
Comparing bitmaps..ok
Checking Semantic tree...
ok
No corruptions found
There are on the filesystem:
Leaves 1061
Internal nodes 9
Directories 1102
Other files 21790
Data block pointers 42347 (5 of them are zero) Safe links 0
###########
reiserfsck finished at Sun Jul 28 22:57:22 2002
###########
[root@rebel tmp]# ls
check2.log check.log fix.log rebuild.log sdb5.img sdb5-test.img [root@rebel tmp]# v
total 1011977

drwxr-xr-x    2 root     root          224 Jul 28 22:57 ./
drwxr-xr-x   17 root     root          432 Jul 28 17:10 ../
- -rw-r--r--    1 root     root            0 Jul 28 22:57 check2.log
- -rw-r--r--    1 root     root          142 Jul 28 22:54 check.log
- -rw-r--r--    1 root     root            0 Jul 28 22:55 fix.log
- -rw-r--r--    1 root     root          458 Jul 28 22:56 rebuild.log
- -rw-r--r--    1 root     root     518127616 Jul 28 17:11 sdb5.img
- -rw-r--r--    1 root     root     518127616 Jul 28 22:57 sdb5-test.img

- --

David R. Bergstein
Systems Engineer and Blues Musician -
http://mywebpages.comcast.net/dbergstein/
Heart of Blue - bookings on-line at http://www.heartofblue.com
OpenPGP Public Key 0xE1F138CA - For info see http://www.gnupg.org
Key fingerprint = C86E CA2A 4171 AC73 91D7 3DCE 8832 D764 E1F1 38CA
________________________________________________________________________

I am an optimist. It does not seem too much use being anything else.
-- Winston Churchill
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9RLLQiDLXZOHxOMoRAsBXAJ43cCmYnpm0Q8JT6cJEigtppdr38QCgoV4g XUjJKoXWfp5jFToKixYJNQo=
=ecds
-----END PGP SIGNATURE-----

####### Pass 0 #######
"r5" got 22888 hits
####### Pass 1 #######
####### Pass 2 #######
####### Pass 3 #########
are_file_items_correct: convert the indirect item back to direct 486 17077
are_file_items_correct: convert the indirect item back to direct 486 17078
are_file_items_correct: convert the indirect item back to direct 486 17076
are_file_items_correct: convert the indirect item back to direct 619 17027 ####### Pass 3a (lost+found pass) #########

bad_stat_data: block 8278, [68 86 0x0 SD (0)], SD has bad nlink number
bad_stat_data: block 8305, [68 95 0x0 SD (0)], SD has bad nlink number

#1 lore raw

It turned out there was no problem after I ran reiserfsck, it was an initscript issue, specifically in /etc/rc.d/rc.sysinit on Mandrake 8.1. The script assumes that the root filesystem is first mounted read-only, however I had previously taken steps to ensure that this reiserfs partition is mounted read-write so journal replays work correctly. This resulted in the boot time message about the root filesystem not being cleanly unmounted.

For the benefit of others in similar situations, I changed the following lines to check for reiserfs in /proc/mounts:

[dbergst@rebel rc.d]$ diff -C 4 rc.sysinit rc.sysinit.original *** rc.sysinit Mon Jul 29 00:28:13 2002
--- rc.sysinit.original Tue Oct 16 14:25:51 2001
***************
*** 378,387 ****
}

_RUN_QUOTACHECK=0
ROOTFSTYPE=grep " / " /proc/mounts | awk '{ print $3 }'
! if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ] && \
! [ -z "$fastboot" -a "$ROOTFSTYPE" == "reiserfs" ]; then

gprintf "Checking root filesystem\n"
Fsck -T -a $fsckoptions /

--- 378,386 ----
}

_RUN_QUOTACHECK=0
ROOTFSTYPE=grep " / " /proc/mounts | awk '{ print $3 }'
! if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then

gprintf "Checking root filesystem\n"
Fsck -T -a $fsckoptions /

Quoted 20 lines · David R. Bergstein

Hello,

I recently encountered some issues on my boot partition on a system running the linux 2.4.19-rc3 kernel. There were some corruptions that were reported by reiserfsck version 3.6.2 that could be repaired using the fix-fixable option. To ensure that this could be done with the partition completely unmounted I built a rescure CD with the appropriate kernel, modules, and statically linked copies of the reiserfsprogs 3.6.2 utilities.

I had to back the partition up to an image file, so I was able to replay what happened next. Apparently, when I boot up the system in normal mode. I get a message indicating the boot partition was NOT cleanly unmounted, which is in conflict with checking the partition offline (says it was cleanly unmounted), i.e.: here is a copy of the on-line message I see in /var/log/boot.log:

Jul 28 22:49:56 rebel fsck: Reiserfs super block in block 16 on 0x815 of
format 3.6 with standard journal
Jul 28 22:49:56 rebel fsck: Blocks (total/free): 126496/75295 by 4096 bytes
Jul 28 22:49:56 rebel fsck: Filesystem is NOT cleanly umounted
Signature · 10 lines
David R. Bergstein
Systems Engineer and Blues Musician - 
http://mywebpages.comcast.net/dbergstein/
Heart of Blue - bookings on-line at http://www.heartofblue.com
OpenPGP Public Key 0xE1F138CA - For info see http://www.gnupg.org
Key fingerprint = C86E CA2A 4171 AC73 91D7  3DCE 8832 D764 E1F1 38CA
________________________________________________________________________

There's another way to survive.  Mutual trust -- and help.
		-- Kirk, "Day of the Dove", stardate unknown
#2 lore raw

Hello!

Quoted 5 lines · David R. Bergstein

It turned out there was no problem after I ran reiserfsck, it was an initscript issue, specifically in /etc/rc.d/rc.sysinit on Mandrake 8.1. The script assumes that the root filesystem is first mounted read-only, however I had previously taken steps to ensure that this reiserfs partition is mounted read-write so journal replays work correctly. This resulted in the boot time

In fact journal replays work ok even with readonly mounts. So mounting rootfs readonly is not required in reiserfs case.

Bye,
Oleg

#3 lore raw

Oleg,

Thanks very much for this information. I sounds like what I did overall suppressed several harnless messages, i.e., by mounting the root reiserfs read-write, and skipping fsck in the initscripts. From what you are saying, journal replay can also work safely when even a reiserfs fs is mounted read-only. Is the warning message about journal replay on read-only filesystems outdated and if so, will it be removed sometime in the near future?

Regards,

- David

David R. Bergstein
Systems Engineer and Blues Musician -
http://mywebpages.comcast.net/dbergstein/
Heart of Blue - bookings on-line at http://www.heartofblue.com
OpenPGP Public Key 0xE1F138CA - For info see http://www.gnupg.org
Key fingerprint = C86E CA2A 4171 AC73 91D7 3DCE 8832 D764 E1F1 38CA

Quoted 29 lines

-----Original Message-----
From: Oleg Drokin [mailto:[email protected]]
Sent: Monday, July 29, 2002 2:01 AM
To: David R. Bergstein
Cc: reiserfs-list
Subject: Re: [reiserfs-list] reiserfsck question - session results

Hello!

Quoted 2 lines · David R. Bergstein

It turned out there was no problem after I ran reiserfsck, it was an initscript issue, specifically in /etc/rc.d/rc.sysinit on

Mandrake 8.1. The

Quoted 1 line

script assumes that the root filesystem is first mounted

read-only, however I

Quoted 1 line

had previously taken steps to ensure that this reiserfs

partition is mounted

Quoted 1 line

read-write so journal replays work correctly. This resulted in

the boot time

In fact journal replays work ok even with readonly mounts. So mounting rootfs
readonly is not required in reiserfs case.

Bye,
Oleg

#4 lore raw

Hello!

Quoted 7 lines · David R. Bergstein

Thanks very much for this information. I sounds like what I did overall suppressed several harnless messages, i.e., by mounting the root reiserfs read-write, and skipping fsck in the initscripts. From what you are saying, journal replay can also work safely when even a reiserfs fs is mounted read-only. Is the warning message about journal replay on read-only filesystems outdated and if so, will it be removed sometime in the near future?

Yes, the warning will be removed. Actually it is just informational message, just badly phrased.

Bye,
Oleg