0

I have a drive (1TB) with dual boot, Windows and Ubuntu. I just bought a new drive (SSD NVME, 500GB) and would like to move my exact same Ubuntu there, and get rid of Windows.

Here's the output of blkid:

/dev/sda1: LABEL="System Reserved" UUID="3C7695297694E544" TYPE="ntfs" PARTUUID="7769abfe-01"
/dev/sda2: UUID="4C62966262965116" TYPE="ntfs" PARTUUID="7769abfe-02"
/dev/sda5: UUID="dd52dd12-778d-4f02-83f6-e4cef3788833" TYPE="ext4" PARTUUID="7769abfe-05"
/dev/sda7: UUID="38576bd8-2ccd-4041-8793-c704c551ce12" TYPE="ext4" PARTUUID="7769abfe-07"
/dev/sdb2: LABEL="Windows_Data" UUID="D0D47D90D47D7A14" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="c4f411e0-b487-4311-8bb2-be50d0ed3f14"
/dev/sdb3: LABEL="Linux_Data" UUID="12ce2115-3dba-4274-978d-7032b4310a9c" TYPE="ext4" PARTUUID="c36dbcad-9607-419b-b017-cc45f36370d4"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/nvme0n1: PTUUID="a88b5ea4-c101-4eb0-bf38-c1717cd0c947" PTTYPE="gpt"
/dev/nvme0n1p1: UUID="dd52dd12-778d-4f02-83f6-e4cef3788833" TYPE="ext4" PARTUUID="3e5794ef-d04e-49ab-8759-9add8e2cd41c"
/dev/nvme0n1p2: UUID="38576bd8-2ccd-4041-8793-c704c551ce12" TYPE="ext4" PARTUUID="90fefe53-b697-4bab-b838-4cca8af2c09e"
/dev/nvme0n1p3: UUID="e03fa428-d57f-434d-ab07-4868de47048d" TYPE="swap" PARTUUID="82eb145d-394a-466e-956b-5739c1414532"
/dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="8b761d39-2c50-4a73-a8ce-da826968337a"
/dev/sda6: UUID="89af7643-09ca-4490-9a37-5cd93579c2a7" TYPE="swap" PARTUUID="7769abfe-06"
/dev/sdc1: UUID="2018-04-26-18-43-51-00" LABEL="Ubuntu 18.04 LTS amd64" TYPE="iso9660" PTUUID="2b192737" PTTYPE="dos" PARTUUID="2b192737-01"
/dev/sdc2: SEC_TYPE="msdos" UUID="044E-AC17" TYPE="vfat" PARTUUID="2b192737-02"

Seems a bit messy. In reality I have 3 physical drives:

  • sda - the current one with the Ubuntu/Windows dual boot
  • sdb - for storage, half for windows, half for ubuntu
  • nvme0n1 - the new drive in which I want to move my ubuntu.

I have tried the following:

  1. Create 3 partitions in the new drive, one for /, one for /home, and one for swap
  2. Clone the ubuntu sda5 partition into the nvme0n1p1, using dd (that's the OS, mounted in /)
  3. Clone the ubuntu sda7 partition into the nvme0n1p2, using dd (this is the data, mounted in /home)
  4. Update fsta
  5. Disconnect (physically) the old drive (sda) and leave only connected the new drive (nvme01)

Unfortunately this approach didn't work. The system does not boot. Immediately after the motherboard screen, the system gets blocked in a black screen. Can you advise on how to proceed?

In case useful, I paste below the picture of the partitions in the original drive:

Gnome Disks screenshot

  • You say it didn't work, but not what actually happened. Did it fail to boot? Did it boot from sda? Please edit to clarify. BTW having partitions with the same UUID might be the problem. – wjandrea Jul 6 '18 at 3:44
  • Thanks for that. I just edited with the new information. The system didn't boot. Not sure if same UUIDs are the problem as I booted with only the new drive connected – Joe Jul 6 '18 at 4:48
0

The best practice is to clone Ubuntu in such the case - it's pretty simple.

  1. Create Live CD/USB and load your system from this live drive. Choose Ubuntu version same as your old system, for example, 16.04. Create backups of all important data!

  2. Install Ubuntu to your new drive - DON'T INVOLVE your old drives into the new installation. During installation create /, /home and swap partitions on new drive like it has been done on you old Ubuntu drive. Reboot your computer at the end of installation and check if new Ubuntu is loading well.

  3. Load computer from live CD/USB again. Mount your root "/" partitions on both old and new drives from terminal or Nautilus. Become root:

    sudo -i
    

    Check CAREFULLY where are your old and new root "/" partitions mounted:

    mount -l
    

    Let's assume your old root "/" partition mounted to

    /media/ubuntu/old/
    

    and new old partition available at

    /media/ubuntu/new/
    
  4. Create in the root's home directory empty plain text file with name "exclude-list":

    touch /root/exclude-list
    

    Edit the newly created file, open it in your favorite text editor - let it be nano for instance:

    nano /root/exclude-list
    

    Insert into the file the following text:

    + */proc/
    + */sys/
    + */dev/
    + */mnt/
    + */media/
    + */tmp/
    + */run/
    - etc/fstab
    - boot/grub/grub.cfg
    - proc/
    - sys/
    - dev/
    - mnt/
    - media/
    - tmp/
    - run/
    - lost+found/
    

    Please check carefully the text file for absence of additional spaces - the spaces must be absent everywhere including end of every line!

  5. If the rsync utility isn't installed in your live system, install it before partition cloning:

    sudo apt install rsync
    
  6. Copy your old root "/" partition to the new one using the following command in terminal:

    rsync -xrlptgoEvv --progress --exclude-from=/root/exclude-list /media/ubuntu/old/ /media/ubuntu/new/
    
  7. Reboot your computer and check if everything is right with your cloned Ubuntu.

  8. Repeat steps 3 and 4 for your /home partitions or just copy files from old to new /home partition inside your new installed Ubuntu instead.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.