Move your files
This assumes that you've already partitioned and formatted all partitions on the new drive. Remember to mark the boot partition as bootable.Mount the new hard drive and sync all files:
sudo -s
mkdir -p /mnt/newdrive
mount /dev/sdb1 /mnt/newdrive
rsync -avx / /mnt/newdrive/
# repeat for other mountpoints as appropriate
Change the UUID
Now you'll need to edit all config files that use the hard drive's UUID (like /mnt/newdrive/etc/fstab) and change all UUID entries to match the new drive. In vim, this handy command will give you a headstart::r !ls -l /dev/disk/by-uuid
Install bootloader
For the next step I like to physically install the drive and boot up from a live Linux CD. Once you're in, run:sudo -s
mkdir -p /mnt/newdrive
mount /dev/sdb1 /mnt/newdrive
chroot /mnt/newdrive /bin/bash
grub-mkdevicemap
grub-install /dev/sda
update-grub2
update-initramfs -c -k all
exit
No comments:
Post a Comment