Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jun 2002 22:02:57 -0700
From:      "Philip J. Koenig" <pjklist@ekahuna.com>
To:        questions@FreeBSD.ORG
Subject:   Filesystem paradox, take 2
Message-ID:  <20020609050258756.AAA535@empty1.ekahuna.com@pc02.ekahuna.com>

next in thread | raw e-mail | index | archive | help
This may be some age-old Unix question that was answered 20 yrs ago, 
but bear with me, I'm not an age-old Unix sysadmin. :-)

I'm trying to copy a working FreeBSD system from one disk and 
controller to another - from an Adaptec embedded 7892 controller (ie 
equivalent to a 2940-U2W) to an AMI/LSI Megaraid controller.  The 
system has 2 slices: a small DOS one, and a large FreeBSD one.

I've been using DOS utilities (Ghost or DriveImage) but I don't think 
the issues would be any different if I were to use dd.

The first problem is after image-copying the disk to the RAID logical 
drive, the disklabel is incorrect. (the offset is incorrect, it 
doesn't start at 0)  I can correct this, but something is awry.  On a 
normal system I can do "disklabel -r da0" and it gives me essentially 
the same output as "disklabel -r da0s2".  After copying the slices to 
the logical drive, "disklabel -r amrd0s2" works, but not "disklabel 
-r amrd0".  I'm not sure why.

So I use boot0cfg to put the bootmanager on the MBR.  FreeBSD starts 
to boot, but can't mount the root filesystem, I get the "mountroot" 
prompt.  Now this is the first "catch-22": it can't mount the root 
filesystem because a file ON the root filesystem tells it the wrong 
stuff. (/etc/fstab, which still has the old device names)  This is 
already a very problematic design, although I realize this is the way 
it's been done for years. (personally I think this stuff should be in 
the partition table or MBR, instead of in the filesystem you're 
trying to mount)

The 2nd paradox is that after I manually specify the root filesystem 
to mount:

mountroot> ufs:/dev/amrd0s2a

..it mounts root read-only because it tells me the filesystem is 
dirty so I have to run fsck. But!!  fsck won't run, because it 
depends on /etc/fstab to tell it what filesystems to check, and I see 
no way to manually specify a device!  AND, I can't edit fstab, 
because it's on / and / is mounted read-only! Argh!

SO I say, I'll boot off the fixit-CD again.  But the fixit 
environment for some reason doesn't know about amrd0s2a (no device 
with that name in /dev, only amrd0s2, and MAKEDEV won't create it - 
complains about illegal group name or somesuch), so I can't even 
mount the filesystem from the fixit environment to fsck it or edit 
fstab.. paradox #3!!

Can anyone offer me some tips here?  I think I've pulled all my hair 
out by now..

Phil

PS: my next try is going to be deleting the FreeBSD slice from the 
RAID logical drive, boot off fixit CD, create a new FreeBSD slice, 
use disklabel to re-create all the filesystems, and copy/restore it 
in the conventional way - ie with a dump/restore or tar/untar pipe.  
But I sure wish I didn't have to go through all that..


--
Philip J. Koenig                                       pjklist@ekahuna.com
Electric Kahuna Systems -- Computers & Communications for the New Millenium


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020609050258756.AAA535>