HowTo: USE FIXPARTS

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
gold_finger

HowTo: USE FIXPARTS

Post by gold_finger »

Fixparts is a program that can be used to remove stray GPT data from a hard drive using MBR partitions. A common symptom of this problem is that the Linux installer's partitioning program (or other partitioning programs) can not correctly read the partitions on the disk. The disk may appear empty when you know that it has partitions already on it and/or another operating system. Under that situation you risk ruining whatever is on the disk by trying to install to it. If stray GPT data on the disk is the problem, Fixparts will find that and fix the problem.

NOTE: All credit for this goes to Mint forum member srs5694. He is the author of the Fixparts utility and the web pages referenced below. Some people have expressed confusion following the instructions on his site, so this is nothing more than a simplified summary of the procedure. I've only added some further clarification on determining what type of partitions are on the disk ahead of time.



VERY IMPORTANT!!!
BEFORE beginning the steps in this tutorial you need to be sure that the hard drive you are trying to fix is not in fact using GPT partitions. This only applies to fixing drives that are using MBR partitions, but have stray GPT data messing up ability to properly read the drive.

Easiest way to find out if drive is GPT or MBR is to type this command into a terminal from your "live" Mint DVD/USB:

Code: Select all

sudo parted -l
(Last character is a lowercase letter "L", not the number 1.)

Find the drive you plan to install to and part of the output will show: Partition Table: msdos, (or gpt). If it says "msdos"(meaning MBR type) -- you can proceed with this tutorial. If it says "gpt" -- do not continue.

If your disk is new (or used but you are starting fresh with it) and you are NOT intending to use GPT partitions, then go ahead with the procedure below. It's possible that it has stray GPT data on it that needs to be wiped before the installer can read it correctly. (Why this happens sometimes with supposedly 'new' drives? I don't know, but occationally it does.)


Now you're ready to begin the fix.

* Boot computer with your 'live' DVD/USB.

* Read about FixParts here first to familiarize yourself with the instructions before you begin.

* Download FixParts from this site: http://sourceforge.net/projects/gptfdis ... -binaries/.

* Choose the deb package version corresponding to your 'live' DVD/USB version:
  • * Choose the file ending in '_i386.deb' for 32-bit version
    * Choose the file ending in '_amd64.deb' for 64-bit version
* Double-click the downloaded '.deb' file to install it with the GDebi Package Installer.

* You will need to know what the 'device name' is of the hard drive you intend to fix. That name will likely be along the lines of /dev/sdX -- where 'X' is the letter corresponding to each physical hard drive (HDD) in the computer. For example, if you have three hard drives in your computer, they will appear as /dev/sda, /dev/sdb, and /dev/sdc. Each HDD will likely have partitions on it and those partitions will be numbered at the end of the device name. (Eg. /dev/sda1, /dev/sda2, etc.) When using FixParts, you will only need to be concerned with the general device name -- not the partition numbers on each HDD.

* To find out the device names for HDD's in your computer, open a Terminal and enter any one (or both) of these commands:

Code: Select all

sudo blkid
sudo parted -l
* Look carefully at the output and use it to determine which HDD is the one you are trying to install to. That will be the one you point at with FixParts. (If your computer only has one HDD, it will likely be called '/dev/sda'.

* BEFORE you proceed, make a backup copy of the partition table on the HDD with this command (substitute YOUR device name letter for the 'X'):

Code: Select all

sudo sfdisk -d /dev/sdX > $HOME/Desktop/parts.txt
* Copy the 'parts.txt' file that appears on your Desktop to a USB stick (or some other external source) for safe keeping because it will be lost when you exit the live environment.

* If you have to restore the partition table for some reason, you can use that "parts.txt" file by doing the following:
  • * Boot computer with 'live' DVD
    * Copy 'parts.txt' file from your source to the Desktop of the 'live' DVD
    * Then run this command in a terminal (substitute YOUR device name letter for the 'X'):

Code: Select all

sudo sfdisk -f /dev/sdX < $HOME/Desktop/parts.txt
* Now launch FixParts pointing it at the HDD you want to fix with this command in a Terminal (substitute YOUR device name letter for the 'X'):

Code: Select all

sudo fixparts /dev/sdX
* FixParts will first check for stray GPT data on the disk. If it finds some it will issue a warning and ask you what to do with a message like this:
RodsBooks | FixParts page wrote:NOTICE: GPT signatures detected on the disk, but no 0xEE protective partition!
The GPT signatures are probably left over from a previous partition table.
Do you want to delete them (if you answer 'Y', this will happen
immediately)? (Y/N):
* Assuming you have already checked and KNOW that you are not using GPT partitions, answer 'Y' to this question and it will automatically get rid of them. (If you don't know if you are using GPT partitions, answer 'N' and exit the program immediately by then typing 'q' to quit. Confirm your situation before proceding again.)

* Once stray GPT data is removed do nothing further with the program. Type 'q' to quit the program, then close the Terminal.

* (Not sure if this is necessary, but do it just in case.) Shutdown and reboot computer with your installation DVD and the installer should now read the partitions correctly.



1/13/2015: Edited out repetitive info to make easier to read and updated Sourceforge link.

1/31/2015: Edited out inappropriate command for determining device name target for fixparts.

10/12/2015: Updated link to newest Fixparts binaries.

1/17/16: Updated link to newest Fixparts binaries.
Post Reply

Return to “Tutorials”