NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Installing netbsd on another drive using existing installation

On 11/17/11 6:25 AM, Mayuresh wrote:
I have a machine whose CD drive has gone bad and somehow BIOS is not
recognizing bootable USB sticks. (Both CD and bootable USB are fine as
they work on other computers.)

Perhaps I should sort out problems with CD drive and BIOS.  But, as of
now, I do have an external HDD on which NetBSD is already installed and
this computer boots with this external HDD.

Now I want to install NetBSD on internal HDD of this computer by booting
it using this external HDD with NetBSD.

Is there any way to do that?


Assuming you have 2 drives sd0 (the internal, target disk) and sd1 (the external, from which you're booting, that has the install), this is the approach I'd take.

While booted off of sd1...

1. Format and partition sd0 to match sd1.

2. mount the partitions on sd0 on /mnt

  # mount /dev/sd0a /mnt
  # mount /dev/sd0e /mnt/usr
  # mount /dev/sd0f /mnt/var

3. Copy each file system with pax

  # cd /
  # pax -vXrwpe . /mnt

Repeat this for each file system making sure you change to the base of that partition before copying. For example, if you want /var on /dev/sd0f, you would...

  # cd /var
  # pax -vXrwpe . /mnt/var

4. Install the bootloader on sd0

  # installboot -v /dev/rsd0a /usr/mdec/bootxx_ffsv1

5. Change /mnt/etc/fstab so that we see "sd0" instead of "sd1"

6. Poweroff, disconnect the external drive, Power on. Or just reboot and select the appropriate boot device (assuming you set up the bootselector with fdisk(8)).

That should work. If you end up with /dev on tmpfs, you might have to run MAKEDEV in /mnt/dev before rebooting, but I'm not sure that'll happen.

Hope that helps.


Home | Main Index | Thread Index | Old Index