I got a 240GB SSD for Christmas, as well as external casing for a hard drive. I have a laptop with a 500GB hard drive on it, and it's quite close to full. Right now, I have Windows 10 and Ubuntu on my HDD, inside my laptop, and a fresh install of Ubuntu on the SSD, connected externally. I want to have Ubuntu on the SSD, which will be connected internally. I'm not yet sure what I'm going to do with Windows, but I will probably need access to it rather soon.

The new drive is smaller, which presents some issues with resizing partitions, and only the drive connected internally can be booted from.

Should I (once again) copy the old Linux partition to the SSD, and run Boot Repair on it from a Live USB? I didn't know about Boot Repair until today or yesterday, so I'm halfway through copying over my Home folder by now. I don't want to waste time with it if it won't work, but if it did, it would keep my programs and settings intact, and would be worth the time.

So, would it work?

lsblk output:

loop1    7:1    0   115M  1 loop  /snap/vlc/4
sdb      8:16   0 223.6G  0 disk  
├─sdb4   8:20   0 220.3G  0 part  /media/joeyubuntu/ae1867d3-bd73-4bd6-96df-93a0
├─sdb2   8:18   0   512M  0 part  
└─sdb3   8:19   0   2.8G  0 part  
loop8    7:8    0 193.5M  1 loop  /snap/vlc/65
loop6    7:6    0  83.1M  1 loop  /snap/core/3247
loop4    7:4    0   121M  1 loop  /snap/discord/38
loop2    7:2    0  83.7M  1 loop  /snap/core/3440
loop0    7:0    0   121M  1 loop  /snap/discord/41
sda      8:0    0 465.8G  0 disk  
├─sda4   8:4    0    25G  0 part  
├─sda2   8:2    0    16M  0 part  
├─sda9   8:9    0   2.8G  0 part  [SWAP]
├─sda7   8:7    0  1000M  0 part  
├─sda5   8:5    0  1000M  0 part  
├─sda3   8:3    0 371.1G  0 part  /media/joeyubuntu/Windows
├─sda1   8:1    0   260M  0 part  /boot/efi
├─sda8   8:8    0  45.7G  0 part  /
└─sda6   8:6    0    19G  0 part  
       253:0    0    19G  0 crypt [SWAP]
loop7    7:7    0 113.6M  1 loop  /snap/blender-tpaw/3
loop5    7:5    0  83.8M  1 loop  /snap/core/3604
loop3    7:3    0 204.8M  1 loop  /snap/discord/32`
  • I would recommend using partclone. Plus when you copy root / if it has /boot on it then GRUB will auto-detect it when you run grub-mkconfig. The problem is that you need to setup UEFI system again. If you give me more details you can make it painless by just copying UUIDs. at least add the output of lsblk
    – jdwolf
    Dec 28, 2017 at 2:14
  • @karel I have the SSD connected externally at the moment. I want to connect it internally later, and connect the HDD externally. I was stating the current situation, which was a bad idea, because it's a mess right now. I'm sorry.
    – jlc
    Dec 28, 2017 at 2:22
  • @karel Is it good now?
    – jlc
    Dec 28, 2017 at 2:27
  • @JoeyLópez It's OK now.
    – karel
    Dec 28, 2017 at 2:28
  • @jdwolf I added the output. I am using UEFI without Secure Boot, in case that helps. Both disks are GPT.
    – jlc
    Dec 28, 2017 at 2:30

1 Answer 1


First partition your new disk. Use /dev/disk/by-id/ instead of /dev/sdX so you don't make mistakes.

sudo apt-get install gdisk partclone    
lsblk -o NAME,VENDOR,MODEL    
sudo gdisk /dev/disk/by-id/usb-modelnamenumber

Take note that usb-modelnamenumber is a placeholder for your device which will be named by its model number and the interface its connected on like usb.


to create a new GPT partition table.


to add new partitions

1 EFI System 256MiB
2 Linux       60GiB
3 Windows    140GiB
4 Data        20GiB
5 Swap      ~3.6GiB

add these by using the defaults for the first two prompts in gdisk partition number and first sector. Then for last sector and file system type use this syntax for each partition in order firs the last sector then the fstype:





Then for the last one just use the default which will be the rest of the disk just slightly under 3.6GiB. And use 8200 for the file system type.

Then write changes to disk with w:

sudo mkfs.vfat -F32 /dev/disk/by-id/usb-modelnamenumber-part1
sudo mkfs.ext4 /dev/disk/by-id/usb-modelnamenumber-part2
sudo mkfs.ntfs -f /dev/disk/by-id/usb-modelnamenumber-part3
sudo mkfs.ext4 /dev/disk/by-id/usb-modelnamenumber-part4
sudo mkswap /dev/disk/by-id/usb-modelnamenumber-part5

You will need to go into Windows and shrink the Windows partition from disk management. Further you will need to restart you Ubuntu and from GRUB run in recovery mode. Then chroot /target Before running the following.

sudo partclone.fat32 -b -s /dev/sda1 -o /dev/disk/by-id/usb-modelnamenumber-part1
sudo partclone.ext4 -b -s /dev/sda8 -o /dev/disk/by-id/usb-modelnamenumber-part2
sudo partclone.ntfs -b -s /dev/sda3 -o /dev/disk/by-id/usb-modelnamenumber-part3

After this you can return to normal Ubuntu.

It's not clear what sda2,4,5,6,7 are.

sudo mount /dev/disk/by-id/usb-modelnamenumber-part2 /mnt
sudo mount /dev/disk/by-id/usb-modelnamenumber-part1 /mnt/boot/efi

Open /etc/fstab and change UUIDs because you copied this from an existing drive. They will be in a table where UUID=[UUID] is placed for each device. Replace the [UUID] part.

lsblk -o UUID /dev/disk/by-id/usb-modelnamenumber-part1

For /boot/efi:

lsblk -o UUID /dev/disk/by-id/usb-modelnamenumber-part2

For /:

lsblk -o UUID /dev/disk/by-id/usb-modelnamenumber-part5

For swap:

sudo grub-install --target=x86_64-efi --boot-directory=/mnt/boot --efi-directory==/mnt/boot/efi --bootloader-id="UbuntuSSD"
sudo grub-mkconfig -o /mnt/boot/grub/grub.cfg
sudo umount /mnt/*

After you've done this you should have two working systems depending on if you pick Ubuntu or UbuntuSSD. At this point you'd want to test if it works.

  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Dec 28, 2017 at 15:04
  • Sorry about that sir.
    – jlc
    Dec 28, 2017 at 15:28
  • @jdwolf what if partclone doesn't work? I'm trying to use this again to move to a larger SSD for a PC, and it just says "error exit"
    – jlc
    Jul 31, 2018 at 13:04
  • Dear future self: make sure you put a / in front of both places where it says dev/sdX
    – jlc
    Jul 31, 2018 at 13:07
  • Side note: Windows refuses to boot from the new drive. Error code is something like "0xc0000000E"
    – jlc
    Jan 8, 2019 at 0:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .