Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
JFS Woes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Collaborys
n00b
n00b


Joined: 24 Nov 2003
Posts: 2
Location: Ireland

PostPosted: Mon Nov 24, 2003 8:22 pm    Post subject: JFS Woes Reply with quote

I have a Gentoo 1.4 system configured with a mix of Ext3 (/boot), Ext2 (/tmp) and JFS (everything else) filesystems. I have separate partitions for /boot, /, /usr, /var, /opt, /home, /tmp and of course a swap partition. When I get a power outage (frequent in my part of the world), my gentoo system does not come cleanly. I have narrowed down the cause of this to be the fact that fsck.jfs (needed to clean the JFS filesystems) cannot itself be loaded because it is on a JFS filesystem. I have tried experimenting with /etc/fstab and the 'pass' parameter to force a fs integrity check at boot but fsck.jfs always appears to return an error, even though it reports that the filesystem is clean. My /etc/fstab is currently as follows:

/dev/hda1 /boot ext3 noauto,noatime 1 1
/dev/hda2 / jfs noatime 0 1
/dev/hda3 /usr jfs noatime 0 2
/dev/hda4 /home jfs noatime 0 2
/dev/hdc1 none swap sw 0 0
/dev/hdc2 /var jfs noatime 0 2
/dev/hdc3 /opt jfs noatime 0 2
/dev/hdc4 /tmp ext2 noatime 0 2

On a *normal* boot, I get an error message like:

fsck.jfs version version 1.1.2, 25-Mar-2003
The current device is: /dev/hda3
Block size in bytes: 4096
File system size in blocks: 2000092
Phase 0 - Replay Journal Log
File system is clean.
* Fsck could not correct all errors, manual repair needed [!!]

Give root password for maintenance
(or type Control-D for normal startup):

Typing Control-D leads to a perfectly normal boot.

Just what is happening? fsck.jfs seems to be reporting an error when there is none and thus intefering with the boot sequence.

Can anyone tell me what I'm doing wrong here?
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 534
Location: France

PostPosted: Tue Nov 25, 2003 3:46 am    Post subject: Reply with quote

Try running fsck.jfs in your shell...
If it is your root partition, you have to boot from a floppy/cdrom to avoid mounting it.
Back to top
View user's profile Send private message
mickywicky
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2002
Posts: 86
Location: London, UK

PostPosted: Sun Nov 30, 2003 7:25 pm    Post subject: Reply with quote

I have had exactly the same problem since I rebuilt my Gentoo installation using JFS, actually.
Running fsck manually return no errors; in fact I can just hit Ctrl+D at boto time, no problem at all.
Funny though my / and /home are JFS, and only my /home gives me this (at every boot): here a snippet of /etc/fstab

/dev/hda1 / jfs noatime 0 1
/dev/hda6 /home jfs noatime 0 2

This machine's kernel knows JFS and ext2/3 but I only use JFS.
Annoying since I use the machine remotely a lot, no way I can reboot unless I am sitting at the console.
Weird???? Maybe

Micky
_________________
l€€t = (1+1) * 3 * 3 * 37 = The prime factorization of The Beast
Back to top
View user's profile Send private message
Oopsz
Guru
Guru


Joined: 08 Oct 2002
Posts: 340

PostPosted: Sun Nov 30, 2003 7:43 pm    Post subject: Reply with quote

force an fsck on the disk, it may be marked clean but actually dirty.
_________________
Pop-before-SMTP with the Gentoo Virtual Mailhosting Guide
Back to top
View user's profile Send private message
mickywicky
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2002
Posts: 86
Location: London, UK

PostPosted: Sun Nov 30, 2003 8:26 pm    Post subject: Reply with quote

>Running fsck manually return no errors
I used to force fsck, but found out it ALWAYS does it regardless... Funny because it used to happen to my root partition, and when I changed the dump/pass options in fstab, all worked for this one... but no luck with /home. maybe I should just mkfs it all over again.
_________________
l€€t = (1+1) * 3 * 3 * 37 = The prime factorization of The Beast
Back to top
View user's profile Send private message
Collaborys
n00b
n00b


Joined: 24 Nov 2003
Posts: 2
Location: Ireland

PostPosted: Mon Dec 01, 2003 11:27 am    Post subject: Reply with quote

I found the answer to this...

fsck.jfs returns the value '1' on an automatically corrected error OR when it replays the journal. So, at start-up when the boot sequence checks the partitions fsck.jfs always returns '1', causing the problems.

The solution is to remove the symbolic link in /sbin for fsck.jfs - it links to jfs_fsck. Replace it with a simple shell script that calls jfs_fsck and returns '0' if the return code is '1'.
Back to top
View user's profile Send private message
mickywicky
Tux's lil' helper
Tux's lil' helper


Joined: 05 Nov 2002
Posts: 86
Location: London, UK

PostPosted: Mon Dec 01, 2003 6:50 pm    Post subject: Reply with quote

clever... and why didn't I think about it to begin with?? :)
guess I'll do just that.
or
(bad alternative)
use the old trick that worked on the first ReiserFS-enabled distros, which was to link it to /bin/true :P

Thanks for the help!!

Micky
_________________
l€€t = (1+1) * 3 * 3 * 37 = The prime factorization of The Beast
Back to top
View user's profile Send private message
zongsy
n00b
n00b


Joined: 09 Feb 2004
Posts: 13

PostPosted: Mon Feb 16, 2004 11:20 am    Post subject: tried as you told , but ... Reply with quote

Thank you very much for your advice on how to fix jfs root fs .

I have my /dev/hda5 as my root fs , formated as jfs , when the box shutdown improperly , It can not reboot normally , stops with the following message :
Quote:
* root file system can not be mounted read/write:(


I always boot with LIVECD and run fsck to fix the jfs filesystem.
But it is not efficient

Then I tried as you said :
Quote:

fsck.jfs returns the value '1' on an automatically corrected error OR when it replays the journal. So, at start-up when the boot sequence checks the partitions fsck.jfs always returns '1', causing the problems.

The solution is to remove the symbolic link in /sbin for fsck.jfs - it links to jfs_fsck. Replace it with a simple shell script that calls jfs_fsck and returns '0' if the return code is '1'.


I rm /sbin/fsck.jfs symbolic link to /sbin/fs_fsck, replaced with my script:
Quote:
#!/bin/bash

FAILURE=1
echo $@
/sbin/jfs_fsck $@
echo "$?"

if [ "$?" -eq "$FAILURE" ]
then
exit 0
fi

however , still it stops at the same position , here is the messages I got in booting process
Quote:
*Remounting root fs read-only (if necessary)
*checking root fs
-a /dev/hda5

/sbin/jfs_fsck version 1.1.2
the current device is /dev/hda5
Blocksize in bytes 4096
file system size in blocks : 2443880
file system checked read-only
file system is clean
1

*remounting root filesystem read/write...
*root file system could not be mounted read/write:(


when I gave my root password to manually run fsck with this command
fsck -fpt jfs /dev/hda5
got the following:
Quote:
.....
fsck 1.33 version...
-fp /dev/hda5
the current device is /dev/hda5
Blocksize in bytes 4096
file system size in blocks : 2443880
phase 1-check blocks files/dirs and dir entries
......|...
phase 2-count links
phase 3-rescan for duplicate blocks and verify dir tree
phase 4-report problems
phase 5-check connectivity
phase 6-perform approved corrections
phase 7-verify file/dir allocation map control information
Errors detected in the fileset file/dir allocation map
phase 8-verify disk allocation maps
incorrect data detected in disk allocation structure/control structure
file system checked read-only
file system is dirty
fs is dirty but marked as clean.in its present state ,the results of accessing /dev/hda5 (except this utility) are undefined .


and I can not boot up still , I have no idea about it .
when root fs is mounted read-only , can fsck.jfs fix errors ?
_________________
gentoo so good
Back to top
View user's profile Send private message
zongsy
n00b
n00b


Joined: 09 Feb 2004
Posts: 13

PostPosted: Mon Feb 16, 2004 11:34 am    Post subject: by the way Reply with quote

my /etc/fstab :
Quote:
/dev/hda5 / jfs defaults 1 1
/dev/hda7 /home jfs defaults 1 0
/dev/hda8 /var jfs defaults 1 0
/dev/hda9 none swap sw 0 0

/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro,user 0 0
/dev/sda1 /mnt/usbfs1 vfat noauto,iocharset=gb2312 0 0
/dev/hda2 /mnt/win2k vfat defaults,iocharset=cp936 0 0

# NOTE: The next line is critical for boot!
none /proc proc defaults 0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:

none /dev/shm tmpfs defaults 0 0


_________________
gentoo so good
Back to top
View user's profile Send private message
zongsy
n00b
n00b


Joined: 09 Feb 2004
Posts: 13

PostPosted: Mon Feb 23, 2004 8:47 am    Post subject: Reply with quote

Quote:
I rm /sbin/fsck.jfs symbolic link to /sbin/fs_fsck, replaced with my script:
Quote:
#!/bin/bash

FAILURE=1
echo $@
/sbin/jfs_fsck $@
echo "$?"

if [ "$?" -eq "$FAILURE" ]
then
exit 0
fi


the above script should be corrected as
Quote:

#!/bin/bash

FAILURE=1
echo $@
/sbin/jfs_fsck $@
RETVAL=$?
echo "${RETVAL}"

if [ "${RETVAL}" -eq "$FAILURE" ]
then
exit 0
fi


BUT the problem still can not resolved !

related topic in other threads:
https://forums.gentoo.org/viewtopic.php?t=51324&postdays=0&postorder=asc&highlight=jfs+problem&start=25
_________________
gentoo so good
Back to top
View user's profile Send private message
Milez
Tux's lil' helper
Tux's lil' helper


Joined: 21 Aug 2002
Posts: 116
Location: Atlanta, GA

PostPosted: Sat Feb 28, 2004 7:58 am    Post subject: I'd like to know... Reply with quote

Hey, has anyone else tried this "return 1" fix and gotten it to work? My system has been jfs (except /boot) for a while now, and it used to reboot cleanly every time after a power surge, with fsck.jfs simply replaying the journal for a few seconds after hard reboots.

Now, however, my system won't reboot after a power failure unless I pop in the gentoo cd and do an fsck.jfs from that. The fact that it used to work definitely supports the idea that it is simply a problem with init scripts and stuff - so, like I was sayin, anyone had a success?
_________________
-=Miles Stoudenmire=-

Adopt a post initiative
Back to top
View user's profile Send private message
petrjanda
Veteran
Veteran


Joined: 05 Sep 2003
Posts: 1557
Location: Brno, Czech Republic

PostPosted: Sat Feb 28, 2004 8:05 am    Post subject: Reply with quote

I dont like JFS at all, it's slow, the only advantage is the lowest CPU usage.
Back to top
View user's profile Send private message
WhackAMole
n00b
n00b


Joined: 27 Jul 2003
Posts: 42
Location: New York

PostPosted: Wed May 26, 2004 10:25 pm    Post subject: Reply with quote

I had the problem where it could not mount the root fs as read/write. When I changed my fstab to read "defaults" instead of "noatime and some-other-options-I-was-trying" everything went fine.

I can't say that this would fix the other problem being discussed, but who knows?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum