Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Migrating hard drives
Date: Fri, 19 Dec 2008 16:18:14
Message-Id: 58965d8a0812190818x1bb60ab4s37157fbb255ed3e7@mail.gmail.com
In Reply to: [gentoo-user] Migrating hard drives by Grant
1 On Fri, Dec 19, 2008 at 10:01 AM, Grant <emailgrant@×××××.com> wrote:
2 > I'm about to switch from one SATA hard drive to another and I'm
3 > planning on going through the normal installation process except for
4 > copying over the data on each partition of my old drive to the
5 > corresponding partition on my new drive. Is there anything to watch
6 > out for? Pitfalls to avoid, etc?
7
8 I don't think so... it depends on what drive it is and how it is
9 partitioned... if there's just one partition then it should be as
10 simple as formatting the new copy and "cp -a /olddrive /newdrive"
11
12 If it's your boot drive and has boot/root/home/and so on partitions
13 then you'll need to pay attention to the partition numbers as they
14 very well may be different when you partition the new disk. Be sure to
15 edit the grub config & fstab to make sure it's all pointing to the
16 right place.
17
18 An alternative in that case would be to use dd to clone the old drive
19 onto the new one, then use something like parted (gparted/qtparted for
20 GUI) to resize the partitions to fit the new disk, assuming the
21 filesystems in use allow for such a thing. The disadvantage to this is
22 you are closing fragmentation and everything else, and if the new
23 drive is a lot bigger than the old, you may not have enough inodes in
24 your fileystem.
25
26 Whenever I do that, I boot from a live CD and copy the drives as
27 above, then plug the new drive into its official cable, boot from live
28 CD again and make sure the partition numbers are right, install grub
29 (if boot drive), reboot and everything is done. If anything went
30 horribly wrong, you've always got the original drive that you can go
31 back to and try again.
32
33 Good luck :)
34 Paul