Score:-1

Moving ubuntu from one internal drive to another

co flag

I recently ran out of space in one of my internal drives(SSD), so I decided to move Ubuntu 18.04 into the other (HDD) without using a Live CD/USB. After looking online, I went with cloning the partitions (root and home) into the other drive using dd, but I'm still unsure on whether or not I can get rid of the original partition. Is there anything else I would need to change other than the UUIDs in the fstab(also it seems I have to generate new ones cause the ones on the cloned partitions are the same, but I'm not sure I need to since I want to get rid of the old one anyway)? I get the feeling that some file paths in certain places might need to be changed. Am I being paranoid?

For context, when I boot, GRUB lists the following options:

Ubuntu

Advanced options for Ubuntu

Ubuntu (/dev/the-new-partition)

Advanced options for Ubuntu (/dev/the-new-partition)

Windows (in the same drive as my initial Ubuntu installation)

Initially, I could not boot with the first option; it never finished booting and I would get stuck waiting for GNOME to be done. Now it's hit or miss, and sometimes I have togo into the advanced options a boot with (what I assume is) a previous version. The last is my other OS. I assume the first option is from my old partition, but I'm not sure and I don't know how to check (I used df to check that Ubuntu is running from the new partition, and it showed me that root is indeed mounted from the new filesystem. My home directory is still in the old partition because I have yet to update that UUID I suppose)

I tried to follow this post and its source but stopped at the "update grub and fstab" (like I said, I'm not sure I need to change this).

TL;DR: Decided to move linux from one internal drive to another with dd(and no live CD/USB). Aware of the necessary fstab changes, but not sure if anything else needs to be done. What am I missing?

David avatar
cn flag
I do not see the version of Ubuntu involved.
PonJar avatar
in flag
Have you changed the boot order in bios/UEFI? If not then the system will look to the SSD to boot. If you haven’t changed any UUID’s then it’s unpredictable which system partition will be mounted. You must have updated grub to get options for the HDD. It will continue to be confusing while you have both disks in place. Bear in mind that the HDD will take longer to boot. You might want to consider a rethink and leave the system on the SSD and move /home to the HDD
mashuptwice avatar
it flag
You **need** to use a live USB to clone your root partition. Cloning a running system **will** result in inconsistency
OhMuzGawd avatar
co flag
I've added my current version of Ubuntu, Also, I seem to be booting from the HDD and it's been fine (the difference in boot time is honestly negligible). @mas
mashuptwice avatar
it flag
@OhMuzGawd If it were fine, you wouldn't be here, right?
OhMuzGawd avatar
co flag
I've added my current version of Ubuntu, Also, I seem to be booting from the HDD and it's been fine (the difference in boot time is honestly negligible). @mashuptwice, what kind of inconsistency are we taking about? If it's simply the system at an earlier date, I think I can live with that. I just assumed by this post (https://askubuntu.com/questions/1028604/bash-script-to-backup-clone-ubuntu-to-another-partition/1028605#1028605) that I could do it without a bootable medium. (took too long to edit the first comment)
OhMuzGawd avatar
co flag
@mashuptwice I assumed the issues arose because I had 2 partitions with linux and the same UUID. Also what I meant mostly is that I can boot from the HDD and there seems to be nothing wrong, at least superficially. Hence my question.
oldfred avatar
cn flag
You cannot boot with both drives connected. UEFI/BIOS may boot from one system one time and the other next time, getting system totally out of sync. Would have been better just to have done a new install & restored from your normal backup. Also good way to confirm your backup is complete a you still have old drive to get anything you are missing. Better to use rsync, not dd https://askubuntu.com/questions/1331348/can-i-use-dd-to-back-up-a-mounted-partition & http://askubuntu.com/questions/545655/backup-your-home-directory-with-rsync-and-skip-useless-folders
C.S.Cameron avatar
cn flag
@OhMuzGawd: I have done this a few times using the GParted `Copy` command, while booted from a Live USB. Right click the partition you want to copy and select `Copy`, then select the empty space on the disk you want to copy to and select `Paste`. You can then use GParted to change the UUID, then update to the new UUID in `fstab` and `sudo update-grub` to fix grub.cfg.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.