Subject: Re: migrate system
To: None <netbsd-users@netbsd.org>
From: Christoph Kaegi <kgc@zhwin.ch>
List: netbsd-users
Date: 02/10/2003 13:25:36
On 2003.02.10 13:06, Marton Fabo wrote:
> What is the recommended method to migrate the whole system from an old 
> HDD to a replacement one?
> 

I don't know, if it's recommended, but I did it this way:

- Install new disk

- fdisk and label it as needed (fdisk(8) and disklabel(8))
  eg: disklabel wd1 >disklabel.wd1
      vi disklabel.wd1
      disklabel -R -r wd1 disklabel.wd1

- make the filesystems with newfs(8)
  eg: newfs /dev/wd1a, newfs /dev/wd1e, newfs /dev/wd1f ...
      (assuming wd1a=/, wd1e=/usr wd1f=/var)

- make it bootable with installboot(8)
  eg: /usr/mdec/installboot /usr/mdec/biosboot.sym /dev/rwd1a

- mount the new filesystems and copy data over
  eg. (assuming you have /, /usr and /var filesystems):

  mount /dev/wd1a /mnt
  (cd /; tar -lpcf - .) | (cd /mnt; tar -xpf -)

  mount /dev/wd1e /mnt/usr
  (cd /usr; tar -lpcf - .) | (cd /mnt/usr; tar -xpf -)

  mount /dev/wd1f /mnt/var
  (cd /var; tar -lpcf - .) | (cd /mnt/var; tar -xpf -)

- consider updating /mnt/etc/fstab, depending on the 
  number of disks you have in your system
  If the old disk is wd0 and the new one wd1 and you are going
  do disconnect the old one, then the new one should become
  wd0 an you have nothing to update.
  But if you are going to leave the old disk in your system,
  you'll probably have to update /mnt/etc/fstab to mount
  the filesystems from wd1 rather than from wd0

- shut system down

- (disconnect old disk)

- reboot

Hope this helps

Regards
Chris

-- 
----------------------------------------------------------------------
Christoph Kaegi                                           kgc@zhwin.ch
----------------------------------------------------------------------