[H-GEN] How do I swap disks in RedHat 5.2?

Craig Eldershaw ce at comlab.ox.ac.uk
Sat Apr 10 02:24:29 EDT 1999


(Note reply-to: being general at humbug.org.au vs Craig Eldershaw <ce at comlab.ox.ac.uk>)

>/dev/sdb5               /                       ext2    defaults        1 1
>/dev/sdb1               /boot                   ext2    defaults        1 2
>/dev/sdb6               swap                    swap    defaults        0 0

>I want to swap the disk sdb for another smaller scsi disk and transfer
>all the current installation over onto the new disk.  I currnetly have
>both old and new disks installed but the new one is not fdisked or
>formated.

>Can I boot off the current installation, fdisk, format and transfer all
>the data to the new disk, swap SCSI id's (between old and new disks)
>and reboot?

Sure.  If the second is on as sdc, then just fdisk /dev/sdc, then mke2fs
twice and mkswap.  Use something like tar or cp (preserving permissions
and not dereferencing links) to copy everything over (Oh, and take
care not to copy the contents of /proc over !).  If you change the
partition numbers (eg. start using sdb1, sdb2 sdb3) then edit
/mount/etc/fstab to match what the devices will be when you boot the new
system.

If at this stage you removed the old sdb, and changed the ID of the new
drive to be sdb, then all would be fine...except for booting.

You have to install lilo or whatever you are using on the new disk.  How
to do this depends upon your current boot setup.  I'd recomend making a
boot disk before ripping all the old hw out.

C.


--
This is list (humbug) general handled by majordomo at lists.humbug.org.au .
Postings only from subscribed addresses of lists general or general-post.



More information about the General mailing list