EASY: Move OS & Files from HDD to SSD – Debian, Ubuntu, Fedora, Arch (SMALL SSD)

This tutorial is people who will ADD an SSD to their system.
This NOT for people who will REPLACE their HDD completely with their SSD.

This is by far the easiest, most foolproof, and safest way to transfer 1 linux installation (Debian, Ubuntu, Fedora, Arch, Kali etc.) to a brand new SSD.

For the transfer commands, skip to 3. Transfer Files Section.


My HDD is 1TB and my new SSD is a 120GB Samsung 850 EVO.

I bought a Samsung 850 EVO for my laptop and I also purchased an SSD Caddy. The SSD caddy was supposedly “universal” but still 2m or so off and did not fit into the CD-ROM tray. I dismantled the caddy and used one half the caddy to secure the drive in place.

I read that my laptop had a SATA III port where the normal HDD drive belongs, but the CD-ROM port was only a SATA II connection. Therefore, I replaced the old HDD with the SSD and moved the HDD into the caddy.

Samsung 850 PRO vs EVO was another small consideration, and the real difference seems only to be the extended warranty (5 year vs 10 year)… In 10 years from now I can only imagine what Samsung will have invented…

1. SSD Security: File Deletions & Securely Erasing SSDs.

As as is true with all drive wiping/erasing: wiping the entire drive (several times over) is the most offensive way to overwrite storage on a drive. SSDs operate differently to HDDs and whether or not files are deleted, even after filling them with /dev/random and /dev/zero, so the easiest way to prevent important files from being somewhat “recoverable” is to keep them on the HDD.

2. What size SSD should I get?

Not everything from my 1000GB HDD will fit on my new 120GB SSD, nor do I want this to happen because I have two drives now and the cost of having everything on my SSD is much higher because SSDs are pretty expensive. I also don’t want important documents on the SSD because I want to know that I can securely erase them at any time.

  • If you’re replacing your hard disk drive, you’ll need a big SSD.
  • If you’re adding to your hard disk drive (having 2x drives) you don’t really need a big SSD.

I chose the Samsung EVO 120GB SSD because this is more than enough to run Debian/Ubuntu/Arch. Moreover, it will force me to keep my important documents “secure” on the HDD, whilst still achieving a surreal ~550mb/s read & write speed from the new SSD.

Moving files onto the new SSD:

– Operating System (/boot folder, specifically initrd.img & vmlinuz)

– /bin, /lib, /usr, /var etc.

– Applications (FireFox, Chromium, Photoshop, Illustrator, PlayOnLinux, Libre Calc, Virtual Box & Images)

Keeping files on the old HDD:

– Swap memory partition

– Most of my documents

– Most of my images

– Encrypted folders

SSD data recovery is an important consideration as well. Writing and deleting files on an SSD is unlike an HDD. My mission critical documents will stay on my HDD. Since installing my SSD & HDD I have successfully set it up so that:

– I use applications from the SSD

– Open files stay in RAM

– Files Save & Load from the HDD

3. Moving Debian or Ubuntu to SSD [VERY SIMPLE]

rsync is very fast method of file transferring that will keep preserve:

  • folder structure
  • folder & file ownership
  • folder & file permissions

It will also “pick up where you left off” so that you can run it in several times until its finished.

We will use 2 options while using rsync:

-a which means archive mode.

-P which means –partial (continue where left off) and –progress (show progress)

Archive mode is equivalent to all of -rlptgoD which makes sure it’s a mirror if exactly what it’s copying.

Step 1: Mount your SSD

Plug it in, if it doesn’t show up, you may need to format it. Open GParted or Gnome Disks (You’ll have one of them) and format the drive. Gnome Disks will show the drive on the left panel: select it, click the “gear” button at the top, format as ext4. GParted will have a drop down menu in the top right: select your drive (identify by GB size), right click on the colored box and format to ext4.

Step 2: Open the SSD folder

Get into the SSD and note path that the files are located (should be empty, might have lost&found). On my system the SSD is at /mnt/SAMSUNG/. It might be /media/SSD/ or something like that. Open a terminal and execute df to find where its Mounted on.

Copy the path and paste it at the end of one of the below rsync commands that you will use.

Step 3: Rsync the OS, folder & files to the new drive

If you have a really big SSD and you want to copy everything from your old HDD to your SSD use this command (make sure your SSD is going to big enough!)

sudo rsync --exclude="mnt" --exclude="lost+found" --exclude="sys" --exclude="proc" --exclude="cdrom" --exclude="media" -aP / /mnt/SAMSUNG/

If you have a small SSD (this one ignores home temporarily).

sudo rsync --exclude="home" --exclude="mnt" --exclude="lost+found" --exclude="sys" --exclude="proc" --exclude="cdrom" --exclude="media" -aP / /mnt/SAMSUNG/

In the command above, we excluded “home” for the moment, because there’s some big files in there. When the above has finished, choose what you’d like to keep on the HDD. I kept Pictures, Downloads, Documents, PlayOnLinux Drives, Wine data Virtual Box Drives on the HDD. Replace “user” below with your username.

sudo rsync --exclude="Pictures" --exclude="Downloads" --exclude="Documents" --exclude=".PlayOnLinux" --exclude=".wine" --exclude="Virtual*" -aP /home/user/ /mnt/SAMSUNG/home/user

After your Operating System has been moved the SSD, we need to create a few more folders.

cd /
sudo mount -o bind /dev /mnt/SAMSUNG/dev
sudo mount -o bind /sys /mnt/SAMSUNG/sys
sudo mount -t proc /proc /mnt/SAMSUNG/proc
sudo cp /proc/mounts /mnt/SAMSUNG/etc/mtab
sudo chroot /media/user/SAMSUNG/ /bin/bash

If you are logged in as “root” in the new drive, it is good to go.


Step 4: Reinstall grub


Leave a Reply

Your email address will not be published. Required fields are marked *