This command:
dd if=/dev/sdb1 of=DEVICE_PATH_OF_SSD_DRIVE
should work for cloning the /
partition to the SSD drive.
EDIT: this will only work if your partition is the same size as the drive. If they are not the same size, you can use partimage:
partimage -z0 -d save /dev/sdb1 clone.partimg
partimage restore DEVICE_PATH_OF_SSD_DRIVE clone.partimg
rm clone.partimg
A caveat to this method is that you need enough space on your drive for an image containing all of the contents of /
. You should be fine if you have >10GB free. Otherwise, you may use -z1
instead of -z0
to compress the image. For even greater compression, use -z2
. Also, partimage does not support the ext4 file system.
Once you have done that, you should then mount the SSD and check if your data has properly copied:
$ mkdir /tmp/ssd
$ sudo mount -t ext4 DEVICE_PATH_OF_SSD_DRIVE /tmp/ssd
$ ls /tmp/ssd
bin dev initrd.img lost+found opt sbin sys var
boot etc initrd.img.old media proc selinux tmp vmlinuz
cdrom home lib mnt root srv usr vmlinuz.old
Replace ext4
with the file system you have used for /
.
You will probably need to install the GRUB bootloader on this drive:
sudo grub-install DEVICE_PATH_OF_SSD_DRIVE
You will then need to edit your /etc/fstab
file to replace /dev/sdb1
with the device path of your SSD drive in the entry that mounts to /
. (sudo $EDITOR /etc/fstab
)
Please wait until this answer has a few upvotes before following these instructions. I am not an expert at these things so I may have missed some vital information. Anyone who sees any flaws in this, please add a comment explaining them. You should take such precautions because if something goes wrong, it could leave your computer unbootable.