Calamares rare failure to create partition (`mkfs`) errors

This issue has been talked about before on this discourse (see here) and it’s very rare, but it does still occur as reported on this bug report.

Example case:

I have a box with multiple OSes on it, and I want to upgrade a system on it so I go into “Manual Partitioning” I create/select the partition I want to use for “/” , and optionally select another to hold my files (“/home”). Enter my details & install starts.

I’m unlucky though and get greeted by an error message that looks something like

Job: Create file system on partition /dev/sda9
Command: sfdisk --force --append /dev/sda
Command: mkfs.btrfs --force /dev/sda9

Please note: Your message(s) may differ; BTRFS was used in this example, but your message may use something different, eg. XFS if using XFS, reiserfs as in the screengrab, etc as well as sda9 is where I experienced the issue; your drive/partition detail will likely be different

At this point, I’ve found the live system can have issues going forward, so I’ll document here my own findings and what I do to correct this problem.

  • If i don’t reboot; I’ve found KDE Partition Manager can experience issues it shouldn’t - rebooting the live session fixes this; thus why I suggest reboot.

  • Re-starting calamares likewise has issues & encounters other errors, so again I suggest reboot

  • if you reboot at this point, you risk finding no OS on your system boots; due to the unknown partition that was left with this failure. You maybe lucky and have your system boot into other OSes though, but if your system fails to boot - the following steps will fix your system rather easily :slight_smile:


Step 1. Reboot your live session.

Reboot using GUI, or if not on impish I may just tell the kernel to reboot (ie. SysRq REISUB). On some boxes I need to remove & re-insert the thumb-drive to have it reboot it; on other boxes I don’t need to do this - do whatever your box requires you to do.

Step 2. Delete & Re-create your system partition

Now in the Lubuntu live system, start KDE Partition Manager.

You’ll find the partition (sda9 in my case) is listed as an *Unknown" partition type, which is not a good sign. Easily fixed though; delete it & re-create it (using whatever file-system type you want: ie. xfs, btrfs, ext4, jfs, reiser, etc) and click “Apply”.

After KDE Partition Manager has deleted, re-created & formatted it (or created the new file-system) your partitions should look good in KDE Partition Manager, so you can exit that program now.

Step 3. Repeat the install but keep your / partition

Restart the `calamares installer; by clicking the “Install Lubuntu 21.10” (or whatever release you’re using) icon on the desktop, or found in the System part of the menu.

Do everything you did before (ie. “Manual Partitioning” and select your partitions. The only difference this time, is you won’t be formatting your system partition as you’ve done that already (ie. use the keep option you’re offered).

You’ll find this time the system installs correctly. On completion, you’ll also find you can select & boot all your other OSes as well :slight_smile:

This is a minor glitch in calamares that only rarely appears on some devices with a specific partitioning layout. It’s an edge case that hasn’t been found yet, so it hasn’t been fixed (yet).

5 Likes