Recently I have tried to upgrade from Ubuntu 22.04 LTS to Ubuntu 24.04.1. After the infamous do-release-upgrade
my system was bricked and I had to reinstall the Ubuntu 24.04.1 the old fashioned way. That’s when I hit my next roadblock.
During the installation, I noticed that the checkbox to format my home partition was grayed out. That’s right - Ubuntu was essentially telling me, “You will format this partition, and you will like it.”
Turns out, this wasn’t just me being unlucky. It was a known bug in the ubuntu-desktop-installer
that couldn’t be fixed in time for the release. And guess what? It affects all Ubuntu flavors using this installer, including Xubuntu 24.04.1, which I was using. Fun times.
However, I found this to be too cumbersome and decided to replace the /home
partition using fstab
, while keeping my old files intact.
Installation
I chose manual partitioning during the installation and only selected the root (/
) partition. This forced the installer to create a temporary /home
directory within the root filesystem. I made sure to use the same username as before to make sure any paths set previously will continue working.
Once the installation was complete, it was time to bring back my old /home
partition. But first, I needed to find its UUID.
Finding the /home UUID
To find the UUID of the old /home
partition I used:
1lsblk -f
and located the /home
partition, in my case nvme2n1p2
:
1
2nvme2n1
3├─nvme2n1p1 ext4 1.0 b8386c13-f1ef-4abb-b0ec-13a4a9772163 234.8G 9% /
4└─nvme2n1p2 ext4 1.0 e0286603-2674-4b04-b960-f491e82fc663 372.7G 37%
and copied the UUID: e0286603-2674-4b04-b960-f491e82fc663
.
Mounting and backuping the new home partition
Before I could replace the temporary /home
partition, I wanted to preserve it - just in case things went sideways (because when do they not?). I mounted the old /home
partition and copied the temporary one over like so:
1sudo mount /dev/nvme2n1p2 /mnt
2cp -r /home /mnt/home_move
Replacing the fstab mount point
The final step was to edit the /etc/fstab
file to point to the old /home
partition. I opened it up with:
1sudoedit /etc/fstab
And added this line:
1/dev/disk/by-uuid/e0286603-2674-4b04-b960-f491e82fc663 /home ext4 defaults 0 0
Saved the file, rebooted the system, and … voila! My old /home
partition was back in action. Most things worked out of the box, but of course, there were a few missing dependencies that were used in the zsh
. A quick install later, and everything was back to normal.
Conclusion
Due to the bug in the ubuntu-desktop-installer
I was forced to get creative with my /home
partition. Instead of formatting it, I manually swapped it out using fstab
, and it worked like a charm. Sure, it wasn’t the smoothest process, but hey, I got a good story out of it. And isn’t that what Linux is all about? Solving problems, learning new things, and occasionally wanting to throw your computer out the window.
Comments