[wplug-bsd] help! fsck

Tom Rhodes trhodes at FreeBSD.org
Thu Aug 26 00:14:43 EDT 2004


On Wed, 25 Aug 2004 23:08:29 -0400 (EDT)
Brandon Kuczenski <bkuczens at andrew.cmu.edu> wrote:

Hi Brandon,

I'm not Bill Moran but hopefully I can help you; in the following
text you describe this problem:

> This is Brandon from WPLUG -- I've had a catastrophic failure on my server 
> that I don't know how to fix and I need mail directed to this address 
> until I get it fixed.
> 
> The problem is that somehow the box got rebooted (power failure? I was on 
> vacation and don't know) and now it hangs on bootup when trying to mount 
> the drive that's normally mounted at /home.  This physical drive was 
> transferred from my linux box and was mounted as an ext2 file system (even 
> though it was ext3, originally -- BSD doesn't support ext3).
> 
> The message it gives me is that the mount operation is not permitted 
> because the device is not 'clean', and that I should run fsck on the 
> drive.
> 
> The problem is, when I run fsck on the drive, I get the following output:
> 
> # fsck /dev/ad1s1
> ## /dev/ad1s1
> BAD SUPER BLOCK: MAGIC NUMBER WRONG
> ioctl (GCINFO): Invalid Argument
> fsck: /dev/ad1s1: can't read disk label
> #

Lemmie try to break this down as easy as possible:

Your drive seems to have lost power without calling fsync() and
thus FreeBSD found a problem of some kind and made an attempt to
fix it.

When fsck(8) is called, it makes an attempt to call the correct
file system checking utility for your file system.  Almost 90% of
the time this is fsck_ffs(8) based on the file system magic
number (the Berkeley Fast File System has 165 if I recall, this
is also known as the 'sysid' in MOST fdisk(8) utilities) and
attempt to correct any errors found.

The problem YOU are getting is that the default fsck(8) cannot
work with the magic number of your disk, it doesn't know about
ext2/ext3 file systems, hence you have an error which causes
fsck(8) to fail.

Most likely you can install a version of fsck(8) for Linux
which will work with your system.  Hopefully it was only the
/home partition and that is seperate from /usr/local.

Try this:

Install the following port (assuming /home is a seperate partition):

fsck_ext2fs: /usr/ports/sysutils/fsck_ext2fs

type rehash on your keyboard so that the system knows how to work
with the program and/or type:

/usr/local/sbin/fsck_ext2fs -y /dev/ad1s1

or /home in place of /dev, long as it's in fstab(5) you should
have no problems.

If this doesn't work then either send another email or call me
(finger trhodes at FreeBSD.org and I'll give you my number)
either tonight before 01:00 EST (or 05:00 UTC).  If you don't
get this email in time then be my guest and call tomorrow any
time past 14:00 EST (18:00 UTC).

Good luck and if it works then please let me know and I'll
write up a faq entry, handbook section, or article on dealing
with it.  Something I've wanted to do for awhile.

-- 
Tom Rhodes


More information about the wplug-bsd mailing list