Re: Replacing a hard drive

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



John R Pierce wrote:


I'm assuming you're using straight ext3 without LVM or raid....

Good point. A while ago I copied an 80 Gb drive to existing partitions on 120 Gb. The source didn't use LVM, the destination did.

I got it working, but I couldn't describe what I did with any reliability.


I'd probably boot the regular CD into rescue mode, without mounting the file systems, then partition the new disk to suit (making each partition at least as large as the original drive, and in the same order, then run something like....

this assumes new drive is hda, old drive is hdb

mkdir /mnt/src /mnt/dst
for f in 1 2 5 6; do
   mount /dev/hdb$f /mnt/src
   mount /dev/hda$f /mnt/dst
   dump 0f - /mnt/src | (cd /mnt/dst; restore rf - )
   umount /mnt/dst /mnt/src
end
mkswap /dev/hda3
mount /dev/hda2 /mnt/dst && mount /dev/hda1 /mnt/dst/boot
chroot /mnt/dst
grub-install /dev/hda
^z
umount /mnt/dsk/boot; umount /mnt/dsk

adjust file and device names to suit. dump to restore like that creates a very accurate copy of a file system, complete with special files, links, ACLs, permissions, etc, etc intact.

And presumably, fairly quickly. I've never used dump/restore, but if it does the obvious and decides which blocks top copy, sorts the list then copies, it should be quickest of all, regardless of the data content.




now, swap the new drive


(where 1, 2, 5, 6 are your file system partitions, leaving out your swap which I'm guessing is hda3)
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



--

Cheers
John

-- spambait
1aaaaaaa@xxxxxxxxxxxxxxxx  Z1aaaaaaa@xxxxxxxxxxxxxxxx

Please do not reply off-list
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux