I got my first SSD, Samsung 850 PRO to be more precise. First thing that got on my mind was that I would not like to do a format. So I decided to go with migrating my root partition. Other partitions, var and home I decided to leave to the HDD. There were a lot of tutorials, all different. I needed something that made sense to me. I decided to create a partition manually to my ssd and then boot Arch live cd and do the rest of the magic. I want to write this down incase I have to do it again. It might work with other Linux distributions as well, but it would require modifications.
From your current installation
Assuming you are currently logged in to your operating system and have already attached your SSD follow next steps as the first part of this guid.- Open your favourite partition editor, I suggest GParted.
- In my experience, the program asked me if I want to create partition table, when I tried to do a partition. In my research I found that "gpt" is ok selection.
- I created a partition for my root directory as usual I used ext4 for it, as ext4 supports SSD.
Copy from one partition to another
- Boot from Arch Linux live cd or usb flash drive.
- Mount the new SSD partition and mount HDD root partition.
Source code viewer
cd /mnt mkdir ssd_mount mount /dev/sda1 /mnt/ssd_mount mkdir hdd_mount mount /dev/sdb1 /mnt/hdd_mount cp -a /mnt/hdd_mount/* /mnt/ssd_mount/ rebootProgramming Language: Bash
Fixes for booting
Source code viewer
# Mount your new system. mount /dev/sda1 /mnt mkdir /mnt/var mount /dev/sdb2 /mnt/var mkdir /mnt/home mount /dev/sdb3 /mnt/home # Generate an fstab. genfstab -U -p /mnt > /mnt/etc/fstab # OR (advanced) genfstab -U -p /mnt >> /mnt/etc/fstab # Open /mnt/etc/fstab with your favourite text editor and merge the results. You can also change the SSD partition attributes for better performance and life-time. First you have to check what your SSD supports and if your partition supports things like TRIM for an example. I have "defaults,noatime,discard". # Chroot into your newly installed system. arch-chroot /mnt /bin/bash # Create an initial ramdisk environment (I don't know it this is actually necessary). mkinitcpio -p linux # Install the bootloader. syslinux-install_update -iam # Change the syslinux.cfg to point to your new root partition. # vim /boot/syslinux/syslinux.cfg # Now we create the boot partition for grub. Select the free space (1007 KB) in top. cgdisk /dev/sda # Use "ef02" as the file system type code GUID. # "Write". # "Quit". # Regenerate GRUB configuration. grub-install --target=i386-pc --recheck /dev/sda grub-mkconfig -o /boot/grub/grub.cfgProgramming Language: Bash
Move root partition from HDD to SSD finished
You should be up and running, remove old stuff from /etc/fstab and write ssd performance flags for an example.Source code viewer
exit rebootProgramming Language: Bash