[SunRescue] Moving things onto a new harddrive

User Bobkeys BSD Bob the old greybeard BSD freak rescue at sunhelp.org
Fri Apr 6 08:54:04 CDT 2001


> > > I'd like to take things off a problematic disk at target 1 and move
> > > this to a new disk at target 0.  I've reinstalled NetBSD on to a 4 gig
> > > internal drive in my LX.  How do I get the thing to let me move the
> > > /etc /usr and so forth from the old drive to the new drive when I
> > > can't mount the old drive anymore at this point (/etc/fstab is coming
> > > up read only).
> > 
> > With the new system up, but the old drive unmounted, fsck each of the
> > file system on the old drive..... and pray a little.
> 
> I need almost everything on it.  

NO.  If you installed freshly on to the new drive, you DON'T need
the old install bits from the old drive, only the your-user-stuff-addins.

> And I need to be able to have the new installation recognize sd2 and
> its directories.

Fsck the file systems on sd2:

   fsck /dev/rsd2a
   fsck /dev/rsd2d or e or f, etc.

Then hand mount onto /mnt.

   mnt /dev/rsd2a /mnt        (e.g., mount old root on mnt)
   mnt /dev/rsd2d /mnt/usr    (e.g., mount old usr on old root)

add any remaing old file systems to your old tree, as needed.

Then carefully take off by tar or possibly dump ONLY the non-new-install
stuff that you want to carry over.  If it is just a partial file system,
use tar.  If it is the whole file system (don't unless you are absolutely
sure that is what you really want to do.... bad on a problematic old fs),
then use dump.

> I can't get the system to mount sd2, though it sees the disklabel

It is needing an fsck on sd2 file systems, and you have to do that
individually by sd2 file system, e.g., for sd2a, for sd2d/e/f, etc.
THEN, you can mount them by hand.  IFF you want to keep the old
problematic drive mounted (bad karma here), then you can add the entries
to your new fstab file, typically

# Device		Mountpoint	FStype	Options		Dump	Pass#

(ORIG file systems on new drive)

/dev/wd0s1b		none		swap	sw		0	0
/dev/wd0s1a		/		ufs	rw		1	1
/dev/wd0s1f		/usr		ufs	rw		2	2
/dev/wd0s1e		/var		ufs	rw		2	2

(ADDED file systems from old drive)

/dev/wd1s1a		/mnt		ufs	rw		1	1
/dev/wd1s1f		/mnt/usr	ufs	rw		2	2
/dev/wd1s1e		/mnt/var	ufs	rw		2	2

proc			/proc		procfs	rw		0	0

Or something like that.  These are the fstab mounts on this FreeBSD
server, but your NetBSD mounts will look sort of similar, probably
sdxxx rather than wdxxx.

Then a mount -a will mount the permanently for you (or a reboot).
A reboot will automatically fsck them, if it can, if you don't 
want to do it manually.

If you are reasonably careful, it should work fine.

Good Luck

Bob





More information about the rescue mailing list