The Ubuntu 22.04 server installer wants you to scrub reused disks first

August 20, 2022

Suppose that you're installing the Ubuntu 22.04 server version on physical hardware, reusing disks that you were previously using (either on that server or another one). If so, I have a safety suggestion for you: as things stand today, you really want to start out by blanking out the disks you're reusing in some way. This is especially the case if one or more of the disks you're reusing may ever have been part of a software RAID array.

One way to do this is the blkdiscard program, but if that doesn't work for some reason another way is just 'dd if=/dev/zero of=/dev/<whatever> bs=1024k count=64; sync'. You can do this from within the 22.04 server installer by using a function key to get a regular shell session on another virtual terminal and then 'sudo -i' to become root. For safety you may wish to reboot afterward in order to restart the installer from scratch (although on some hardware the BIOS may then get confused enough that you need to power cycle it).

In theory the Ubuntu 22.04 server installer will cope with reused disks that already have partitions on them, perhaps partly because some vendors ship server systems with pre-partitioned drives. In my experience, this can often work fine in practice. But every so often, things go wrong, and the installer will give you an opaque message that it crashed after you did network setup (sometimes, after you picked the Ubuntu mirror to use), before getting to disk selection and partitioning. These crashes seem especially common if you have disks with previous software RAIDs on them, either complete or merely one disk out of several.

The installer will assemble any partial or complete software RAID arrays that it can find. Sometimes I've been able to get a crashed installer to work by using mdadm to stop and then erase those unwanted assembled software RAID arrays; other times, nothing has worked and I've had to go to the big hammer.

I'm not terrible surprised by this. Canonical's focus for the server installer is clearly on cloud installs, where you don't have reused (system) disks. At this point I can only be thankful that the experience isn't even more broken on physical hardware.

PS: My other 22.04 installer hot tip is that if you have a virtual machine with a single small disk, it's okay to take the default partitioning but you should turn off LVM. If you leave LVM on in the installer, you tend to wind up with an absurdly small root filesystem and the rest of your precious disk space gone to some other filesystems that you probably don't care about, like a separate /home. Turning off LVM puts all of the space into a single root filesystem.

Written on 20 August 2022.
« I wish Prometheus had a table-driven label remapping feature
ZFS DVAs and what they cover on raidz vdevs »

Page tools: View Source.
Search:
Login: Password:

Last modified: Sat Aug 20 21:58:13 2022
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.