Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo 2.4.27 on UltraSparc: fsck problems at bootup[SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
vic_norman
n00b
n00b


Joined: 10 Dec 2004
Posts: 10
Location: Pittsburgh

PostPosted: Fri Dec 10, 2004 2:46 pm    Post subject: Gentoo 2.4.27 on UltraSparc: fsck problems at bootup[SOLVED] Reply with quote

All,

I'm experimenting with Gentoo on an Ultra 5 here -- to see if Linux on Sparc is significantly faster than Solaris 2.7 on it.

I have been fairly successful at getting most things to work, but I'm still having a problem at boot up. It runs through its sequence checking this and that, and then gets to this:

Checking all filesystems....
/dev/hda1 is mounted. e2fsck: Cannot continue, aborting.

*Fsck could not correct all errors, manual repair needed.

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

(So, I enter the root password, and try to run e2fsck manually.)
Code:

# e2fsck /dev/hda1
e2fsck 1.35 (28-Feb-2004)
/dev/hda1 is mounted.

WARNING!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage.
Do you really want to continue?  No.
aborting

#



So, what do I do to fix this? Here is the output from fdisk, FYI:

Code:

/root# fdisk /dev/hda

Command (m for help): p

Disk /dev/hda (Sun disk label): 15 heads, 63 sectors, 8892 cylinders
Units = cylinders of 945 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/hda1             0      1058    499905   83  Linux native
/dev/hda2  u       1058      2116    499905   82  Linux swap
/dev/hda3             0      8892   4201470    5  Whole disk
/dev/hda4          2116      6349   2000092+  83  Linux native
/dev/hda5          6349      8892   1201567+  83  Linux native


Here is my /etc/fstab:

Code:

/root# cat /etc/fstab
# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                 <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda1               /boot           ext3            defaults,noatime       1 2
/dev/hda3               /               ext3            noatime                0 1
/dev/hda2               none            swap            sw                     0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,user         0 0
#/dev/fd0               /mnt/floppy     auto            noauto                 0 0
/dev/hda4               /usr            ext3            noatime                0 0
/dev/hda5               /var            ext3            noatime                0 0
# /dev/hda4             /home           ext3            noatime                0 0


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

none                    /proc/openprom  openpromfs      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           nodev,nosuid,noexec    0 0


Any suggestions are welcome. Thanks for looking at this.

Vic


Last edited by vic_norman on Wed Dec 15, 2004 8:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
labrador
Guru
Guru


Joined: 04 Oct 2003
Posts: 316

PostPosted: Fri Dec 10, 2004 6:09 pm    Post subject: quick solution... Reply with quote

find a Gentoo live CD and boot it. Run fsck from there.
Back to top
View user's profile Send private message
vic_norman
n00b
n00b


Joined: 10 Dec 2004
Posts: 10
Location: Pittsburgh

PostPosted: Fri Dec 10, 2004 7:19 pm    Post subject: Re: quick solution... Didn't work... :-( Reply with quote

I tried this twice and to no avail.

Each time when I reboot from hda it complains about fsck.

Is my fstab correct? Is there configuration information in some other file that I can provide you?

Thanks.

Vic
Back to top
View user's profile Send private message
vic_norman
n00b
n00b


Joined: 10 Dec 2004
Posts: 10
Location: Pittsburgh

PostPosted: Mon Dec 13, 2004 2:31 pm    Post subject: Reply with quote

Can someone PLEASE help me? Is my problem too obvious? I'm desparate here.

Thanks.

Vic
Back to top
View user's profile Send private message
hab136
n00b
n00b


Joined: 12 Apr 2004
Posts: 18
Location: Charlotte, NC

PostPosted: Mon Dec 13, 2004 10:08 pm    Post subject: Re: quick solution... Didn't work... :-( Reply with quote

vic_norman wrote:
I tried this twice and to no avail.

Each time when I reboot from hda it complains about fsck.

Is my fstab correct? Is there configuration information in some other file that I can provide you?

Thanks.

Vic


Partitions should not be mounted while they're being fsck'd. This shouldn't happen, so that's very weird.

Need more background information. Post some more of the boot.. start from 10 lines before the error, and continue 10 lines after.

Post your /etc/silo.conf, maybe you have something weird in there?

Try putting "noauto" in your options for /dev/hda1 -- you should not keep your boot partition mounted, just mount when you update your kernel (so you don't accidentily write to it). Also, you can't have both defaults and other options; defaults means "no options". Make it look like this:

Code:
/dev/hda1               /boot           ext3            noauto,noatime       1 2
Back to top
View user's profile Send private message
vic_norman
n00b
n00b


Joined: 10 Dec 2004
Posts: 10
Location: Pittsburgh

PostPosted: Tue Dec 14, 2004 2:11 pm    Post subject: Reply with quote

Hab136: thanks for your reply.

I've changed the /etc/fstab line, but it still didn't do the trick. Rats!

Here is my /etc/silo.conf:

Code:

# Example of how can be silo.conf set up
partition = 1
root = /dev/hda1
timeout = 150
#password = __put_your_password_in_cleartext_here__
#restricted
image = /boot/kernel-2.4.27
label = linux



Here is the output on the console when booting up (note: i had to type this all in by hand (is this stuff in a files somewhere?)):

Code:

... snip ...
TCP: Hash tables configured
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets 1.0/SMP ...
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  commit interval 5 seconds.
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Mounted devfs on /dev.
INIT: version 2.84 booting.

Gentoo Linux; http://www.gentoo.org
  Copyright [blah blah blah]

* Mounting proc at /proc...                                          ok
* Starting devfsd...
Started device management daemon v1.3.25 for /dev   ok
* Activating (possible) swap...
Adding swap: 499888k swap space (priority -1).            ok
* Remounting root filesystem read-only (if necessary)... ok
*Checking root filesystem...
/dev/hda3: clean, 3889/125416 files, 62826/499713 blocks   ok
* Remounting root filesystem read/write                        ok
* Setting hostname to norman-space-linux...                  ok
* Calculating module dependencies...                             ok
* Checking all filesystems...
/dev/hda1 is mounted.  e2fsck: cannot continue, aborting

   * Fsck caould not correct all errors, manual repair needed      !!

[Stuff here about logging in or hitting Ctrl-D (which doesn't work...)]

[ After logging in as root, then hitting Ctrl-D ]

* Mounting local filesystems.                                              ok
* Mounting usb device filesystems.                                      ok

etc.


I hope this helps. Let me know if there is anything else I can provide. I really appreciate this help.

Vic
Back to top
View user's profile Send private message
hab136
n00b
n00b


Joined: 12 Apr 2004
Posts: 18
Location: Charlotte, NC

PostPosted: Tue Dec 14, 2004 3:39 pm    Post subject: Reply with quote

Oh, wow, flashback.. I've made this same mistake before. :)

Unlike on x86, on Sun it's normal for your partitions to overlap, and they do.

Your hda3 uses cylinders 0 - 8892, which is the whole disk.

Your hda1 uses cylinders 0-1058, which is the first part of the disk.

So, when you read the begininng of hda3, you're actually reading hda1!

Let's try this diagram:

Code:

0                                            8892
[------------hda3----------------------------]
[--hda1--][-hda2-][----hda4----][----hda5----]


It's normal on Sun systems to have one partition (usually the 3rd) to represent the whole disk. But you're not supposed to mount it. :) :)

To fix this quick, just remove the /boot line from your fstab, and change hda3 to hda1 in the / line.

To fix this correctly, you need to have a separate /boot and / partition, but that means redoing the disk.

The big reason for having a seperate /boot partition is that many BIOS/bootloaders can't go past a certain point on the disk (usually 1 or 2 gig). So I usually make a very small (100 meg, but 10 is fine) /boot partition, a swap, a whole-disk partition if it's Sun, then one big partition. Like so:

Code:

 # fdisk /dev/sda

Command (m for help): p

Disk /dev/sda (Sun disk label): 16 heads, 135 sectors, 3880 cylinders
Units = cylinders of 2160 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/sda1             0        90     97200   83  Linux native
/dev/sda2  u         90       553    500040   82  Linux swap
/dev/sda3             0      3880   4190400    5  Whole disk
/dev/sda4           553      3880   3593160   83  Linux native

Command (m for help): q

The relevant part of fstab looks like:
Code:

/dev/sda1               /boot           ext2            noauto,noatime         1 1
/dev/sda4               /               ext3            noatime                0 0
/dev/sda2               none            swap            sw                     0 0



I'm using SCSI, which is why I have sda instead of hda, but otherwise it's the same.

Some people have huge philosophical discussions on how you should make your partitions, and divide up /usr, /var, /tmp, etc. You're free to do that, but you're also free to NOT do that and just have one big partition :) (except for /boot).

If your Sun machine is recent, you may not have any problems with the bootloader, in which case your current setup is fine. But if you run into trouble in the future with SILO not able to read your vmlinux/image, that'll be it.

Hope this helps!
Back to top
View user's profile Send private message
vic_norman
n00b
n00b


Joined: 10 Dec 2004
Posts: 10
Location: Pittsburgh

PostPosted: Tue Dec 14, 2004 5:38 pm    Post subject: Reply with quote

Problem solved! Thanks so much.

NOTE: if the "powers that be" are watching this conversation, you might want to put some of the wisdom of hab136 into your documentation. I'm pretty good at following directions, and I tried to follow the Linux on Sparc installation instructions very closely, and I ended up with my mess.

If you see where I screwed up and deviated from the installation instructions please let me know -- I can take it.

Also: in chapter 8 (Configuring your System) the example /etc/fstab is shown with options "defaults,noatime" once and then with options "noauto,noatime" once. This should be made consistent, at least.

Thanks.

Vic
Back to top
View user's profile Send private message
labrador
Guru
Guru


Joined: 04 Oct 2003
Posts: 316

PostPosted: Wed Dec 15, 2004 8:31 pm    Post subject: should have spotted it, however Reply with quote

If I had taken the time to read all of your fstab
and fdisk -l output, I would have spotted that, but
the error from fsck made me think it was the
usual error on trying to check a disk that is mounted.

I think this is a bug in fsck. It if is trying to
check something set up in partition tables
as the whole disk, it should have an appropriate
error like "you can't run fsck on Whole Disk
type partitions". The error you got instead is
just misleading because it is the same error
as a more typical problem (of trying to repair a
mounted partition).
Back to top
View user's profile Send private message
hab136
n00b
n00b


Joined: 12 Apr 2004
Posts: 18
Location: Charlotte, NC

PostPosted: Wed Dec 15, 2004 10:30 pm    Post subject: Re: should have spotted it, however Reply with quote

labrador wrote:
I think this is a bug in fsck. It if is trying to
check something set up in partition tables
as the whole disk, it should have an appropriate
error like "you can't run fsck on Whole Disk
type partitions". The error you got instead is
just misleading because it is the same error
as a more typical problem (of trying to repair a
mounted partition).


Fsck should check some whole-disk partitions.. think of the case where there is only one partition on the drive, taking up the whole disk (like on a second drive). To account for that case, fsck would have to deduce the block device for the whole drive, then read in and parse the partition table.

The other way to think of the problem is that you shouldn't be able to mount an overlapping partition in the first place.. it might be easier to stick the check in there vs. fsck, and perhaps prevent other problems - like you have hda1 as your root, and then, once running, you try to mount hda3. Some filesystem drivers will catch this, but not all of the cases, like where you have hda4 and hda5 mounted, then start writing to hda3.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc 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