LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (http://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   [how-to] Switching back to MBR from GPT. (http://www.linuxquestions.org/questions/slackware-installation-40/%5Bhow-to%5D-switching-back-to-mbr-from-gpt-4175497154/)

ReaperX7 03-05-2014 03:07 PM

[how-to] Switching back to MBR from GPT.
 
If you ever need to switch back to an MBR partition scheme from GPT, for whatever reason, cfdisk will spit out an error saying that the disk still has a GPT partition on it.

This is from a GPT partition scheme written at the end of the disk.

To erase this and restore functionality back to MBR style partitions use these commands. This works with any distribution of Linux with an install Disk, not just Slackware, provided the disk does in fact have gnu parted installed on it.

Code:

parted /dev/sdX
mklabel msdos
quit

You'll be asked some questions shortly afterwards just type yes and ignore and afterwards reboot the media.

smallpond 03-05-2014 03:57 PM

It's worth noting that this procedure loses any information on the disk.

There is a utility which can (in some cases) convert to or from GPT without losing data called gpt fdisk, although I haven't personally tried it:

http://www.rodsbooks.com/gdisk/mbr2gpt.html

ReaperX7 03-05-2014 06:57 PM

Yes, it will destroy the partition labels and force you to rebuild your partitions, but it does work in a pinch if you're reinstalling or doing a fresh install and need to revert back for whatever reason.

This was only posted due to the fact it's tools included with the actual install media, rather than post-installation.

TracyTiger 03-05-2014 11:09 PM

Quote:

Originally Posted by ReaperX7 (Post 5129535)
If you ever need to switch back to an MBR partition scheme from GPT, ...
Code:

parted /dev/sdX
mklabel msdos
quit


Quote:

... it's tools included with the actual install media ...
Thanks ReaperX7! I'm always looking for tools and methods to use that are available from just booting the Slackware installation disk.

This looks much easier than using "dd if=/dev/zero" and figuring out how many blocks to skip to erase the last part of the disk.

ReaperX7 03-05-2014 11:25 PM

Very much welcome.

jtsn 03-06-2014 05:17 AM

Quote:

Originally Posted by smallpond (Post 5129564)
There is a utility which can (in some cases) convert to or from GPT without losing data

This utility is included into Slackware and is called gdisk(8).

Just call it and use 'g' to convert GPT into MBR. It also works with an empty table. This is the better option, because it is included in the Slackware install/rescue media and it doesn't destroy data. To remove the GPT without creating a MBR - to get a clean disk - just use 'o'. And for special cases there is an option to create an MBR/GPT hybrid with 'h'.


All times are GMT -5. The time now is 01:52 PM.