FIXPARTS(8)

πŸ“¦
version 1.0.10 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME ✨

FixParts Manual (fixparts) πŸŽ€: okay so the name of the game is fixparts 🧚, an MBR partition table repair utility πŸ”§πŸ’…

🌸 SYNOPSIS 🌸

fixparts device

πŸ¦‹ DESCRIPTION πŸ¦‹

okay bestie, so FixParts (aka fixparts) is a text-mode, menu-driven program that repairs certain kinds of problems with Master Boot Record (MBR) partition tables πŸ’– It has three design goals, plus a few extra features that are lowkey fun too ✨

  • Stray GPT cleanup 🧹: it can remove leftover GUID Partition Table (GPT) data 😭 This junk gets left behind on a disk that used to be a GPT disk but got only partly converted to the more common (as of 2011) MBR form. Literally so messy πŸ’€
  • Mis-sized extended partition fixes πŸ”₯: it can repair extended partitions that are sized wrong, meaning they either extend past the physical end of the disk or overlap with nearby primary partitions. The best part is that this repair happens automatically πŸ‘‘ If that's the only problem with your disk, you can launch the program, save the partition table right away without making any manual changes, and it'll fix the problem all on its own. no cap 🫢
  • Primary ⇄ logical switching πŸ”„: you can turn primary partitions into logical ones or vice versa, but only within the limits set by the MBR data structures πŸ“

Extra features include changing partition type codes or boot/active flags, deleting partitions, and recomputing CHS values πŸ’… Except for recomputing CHS values, these secondary features are better handled with fdisk πŸ™ˆ The reason is that fixparts' design means it's likely to shuffle partition numbering even when you didn't ask it to. Yikes 😬

The fixparts program has a user interface that's similar to Linux's fdisk, but fixparts is way more specialized πŸ’œ The biggest difference is that you can't create new partitions with fixparts, although you can change the primary/logical assignment ✨

In the MBR scheme, partitions come in three varieties 🌈

  • primary πŸ’Ž: these live in the first sector of the hard disk, and there are only four of them. Some OSes, like Windows and FreeBSD, must boot from a primary partition πŸ‘‘
  • extended 🫧: these are specialized primary partitions. Their whole job is to act as holding areas for logical partitions 🧚
  • logical 🍬: a disk can hold an arbitrary number of logical partitions, but fixparts caps things at 124 logical partitions πŸ™…β€β™€οΈ All the logical partitions sit inside a single extended partition and are defined using a linked-list data structure. This means every logical partition has to be preceded by at least one sector of unallocated space to hold its defining data structure, an Extended Boot Record (EBR) πŸ₯Ί

These rules mean primary and logical partitions can't just be mixed together however you like πŸ™ƒ A disk can have one to three primary partitions, then a block of one or more logical partitions, then one to three more primary partitions. That's a total of three primary partitions, not counting the extended one 🌸 Primary partitions can't be sandwiched between logical partitions, because that would mean putting a primary partition inside an extended partition, which is just a specific type of primary partition. Not me getting confused πŸ’€

Heads up: unlike most disk utilities, fixparts' user interface ignores extended partitions 🫣 Internally, the program throws away the information on the original extended partition. When you tell it to save, it generates a brand new extended partition to contain the logical partitions that are defined at that point. This is because most of the repairs and manipulations the tool does require a fresh extended partition anyway, so keeping the original in the interface would just be a complication πŸ™ˆ

Another unusual thing about fixparts is that partition numbers don't necessarily match primary/logical status πŸŽ€ In most utilities, partitions 1-4 are primary and partitions 5 and up are logical. In fixparts, any partition number can be assigned primary or logical status, as long as the layout rules from earlier are followed πŸ¦‹ When the partition table gets saved, partitions are assigned properly, and then tools like the Linux kernel and fdisk give them their conventional numbers ✨

When it first starts up, fixparts scans for GPT data πŸ‘€ Here's how it goes:

  • If the disk looks like a conventional GPT disk, fixparts refuses to run 🚫
  • If the disk appears to be a conventional MBR disk but GPT signatures show up in the GPT primary or secondary header areas, fixparts offers to delete this extra data 🧹 If you say yes, it wipes the GPT header or headers right away. (If it only finds one header, it only erases that one, to minimize the risk of damaging a boot loader or other data that might have overwritten just one of the GPT headers. Protect the boot loader, protect the vibes 🫢)

Aside from that optional GPT erasing at startup, fixparts keeps all changes in memory until you write them with the w command πŸ’Ύ That means you can play around with your partitions in the interface and abort everything by typing q to quit without saving. Main character undo energy πŸ‘‘

✨ AVAILABILITY ✨

okay so where do you even get fixparts 🧚 it's part of the GPT fdisk package, bestie, so you grab it from there. the one and only Rod Smith is the person behind it, and you can get it straight from him πŸ’–


bestie, that's the whole page! 🫢 you now know more about fixparts than most people ever will. go be a main character πŸ’…

Version 1.0.10, by Roderick W. Smith, FIXPARTS(8) 🌸✨