This is how I did it:-
Note 1: If the PC is SFF you may not be able to have both HDD and SSD connected at the same time, in which case you need to first copy to a USB HDD then connect the new drive then copy to it.
Note 2: The target SSD needs to be partioned and formatted similar to the old HDD
Boot with a Live CD or Live USB drive then
sudo mkdir -p /mnt/{root1,root2,home1,home2} # Create the directories
or
sudo mkdir -p /mnt/{root1,root2} # if no separate home partions
sudo mount /dev/sda1 /mnt/root1/ # mount the root partitions
sudo mount /dev/sdb1 /mnt/root2/
sudo mount /dev/sda2 /mnt/home1/ # mount the home partitions
sudo mount /dev/sdb2 /mnt/home2/
sudo cp -a /mnt/root1/. /mnt/root2/
sudo cp -a /mnt/home1/. /mnt/home2/
The copying process will take about 10 minutes or so to complete, depending on the size of it’s contents.
Install GRUB bootloader on the SSD
sudo mount -o bind /dev/ /mnt/root1/dev/
sudo mount -o bind /dev/pts/ /mnt/root1/dev/pts/
sudo mount -o bind /sys/ /mnt/root1/sys/
sudo mount -o bind /proc/ /mnt/root1/proc/
sudo chroot /mnt/root1/
After successfully chrooting to the SSD’s root partition, install GRUB.
(Make sure you select the correct drive – /dev/sdx)grub-install /dev/sdb --boot-directory=/boot/ --target=i386-pc
If GRUB is installed without any problem, then update the configuration file.
update-grub
These two commands above are to be run inside the chroot, and don’t exit from the chroot now.
Update the fstab entry
Use the blkid command to know the proper UUID of the partitions.
sudo nano /etc/fstab
Done. You should be able to shutdown then boot to the new SSD.
Recent Comments