Score:0

Ubuntu fails to boot : freezes while starting services

de flag

I use Ubuntu 20.04. I just switched hard drives. I went from an MBR to a GPT partitioned hard drive.

The problem is when I run Ubuntu on my new hard drive, the boot process stops when starting services. It stopped when starting snap.modem-manager.modemmanager.service, and when I disabled this service, it stopped at gdm.service. Meanwhile, during the former stop, it has successfully started gdm.service.

However, the new hard drive boots normally if the old drive is connected to the system via a USB-TO-SATA interface. Could it be that some of the services are linked to the old drive via its UUIDs?

I started the system in recovery mode and upgraded the packages, but the problem still persisted. When the system freezes, I am unable to start a TTY with Ctrl+Alt+Fn.

What could possibly be the problem?

PonJar avatar
in flag
When you switched hard drives did you update the /etc/fstab file to use the new partitions? I’d guess fstab is looking for one or more of the old partitions by UUID. To diagnose this run the lsblk command in a terminal when booted normally with the old drive attached and add the output to your question
youngwarlock avatar
de flag
It turns out you are right! I updated the UUIDs for home and swap and forgot to update that of the root partition. Kind of silly... So it appears the new drive was using libraries in the old drive during boot. However, when it starts, the system runs normally even if I disconnect the old drive. That's quite interesting. Thanks @PonJar.
Score:1
de flag

Just as I suspected, there was a reference to the old hard drive in /etc/fstab of the new hard drive. It's root partition entry was referencing the UUID of the old root partition. I had changed that of the home and swap partitions but forgot to change that of the root partition.

Interestingly, after booting the system, none of the partitions of the old hard drive was mounted (as checked using lsblk) making one not to suspect that there is such an error in /etc/fstab. In addition, you can disconnect the old hard drive without crashing the system. It seems it is only used during boot.

The lesson here is that we should make sure we change the UUIDs in /etc/fstab accordingly following a hard drive swap.

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.