easiest way to replace hard drive?

Daniel B. Thurman dant at cdkkt.com
Thu Oct 8 17:29:16 UTC 2009


On 10/08/2009 09:48 AM, Dr. Michael J. Chudobiak wrote:
> Hi all,
>
> Is there an easy way to transfer a system from one drive (holding
> boot, swap, lvm partitions, in the default F11 layout) to a different
> hard drive, if the new drive is smaller?
>
> If the new drive is larger, dd could be used in a fairly
> straightforward way.
>
> However, I want to try replacing a 160 GB hard drive with an Intel 80
> GB solid-state drive, just for fun...
>
> I suspect a re-install might be easier.
>
> - Mike
>
For me:

1) Shutdown and install the drive
2) Boot LiveCD (I use Ubuntu because "partition manager" is included)
3) Partition new drive with "partition manager"
4) mkdir /mnt/a /mnt/b
5) mount /dev/sdXx /mnt/a   (Old)
6) mount /dev/sdYy /mnt/b   (New)
7) (a) cp -a /mnt/a/. /mnt/b/. OR
    (b) rsync -avz /mnt/a/. /mnt/b/.
8) umount /mnt/a /mnt/b
9) Repeat steps 5-8 for each partition to copy over
10) rmdir /mnt/a /mnt/b
11) Relabel each new partitions (Label or UUID), update fstab & grub (if
included)
12) execute: grub
      (a) find /grub/stage1  <-- locate the boot (grub) partitions of
all drives seen by the Bios
      (b) root (hdX,Y)  <-- set the root to the new drive's boot partition
      (c) setup (hdX,Y) <-- sets up the new drives's MBR with root
(boot) partition information
      (d) quit
13) Remove LiveCD & shutdown or reboot
14) Set remove the old drive OR set the BIOS to default to
      the new drive OR add new drive information to old drive grub

Note:
The above assumes that new drive has enough space
for the data copied over from the old drive partitions as
step 7 copies only the data and not the entire partition image.

FWIW,
Dan




More information about the fedora-list mailing list