Converting GPT to MBR?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
ninyoras
Level 1
Level 1
Posts: 8
Joined: Wed Sep 30, 2020 1:27 pm

Converting GPT to MBR?

Post by ninyoras »

Hello there,

I wanted to convert my encrypted Linuxmint 19 from GPT to MBR and therefore I did a search and found this: https://www.explorelinux.com/convert-a- ... mbr-linux/ and this: https://superuser.com/questions/1011942 ... gpt-to-mbr

I issued the commands

Code: Select all

sudo gdisk /dev/sdb
, then r, g, and w as commands.

After this the output became like this:

Code: Select all

user@host:~$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************


Command (? for help): q
My partition table:

Code: Select all

user@host:~$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x478f0f9c

Eszköz     Indítható   Start      Vége Szektorok  Size Id Típus
/dev/sdb1               2048   1050623   1048576  512M ef EFI (FAT-12/16/32)
/dev/sdb2            1050624   2549759   1499136  732M 83 Linux
/dev/sdb3            2549760 250068991 247519232  118G 83 Linux
My laptop is still in UEFI mode and it still works. I downloaded boot-repair but when I boot from a live USB and use it, it finds nothing to repair about (ofc, as SSD is encrypted).
Did I misunderstood something? I wanted to switch back from UEFI to BIOS mode and use MBR instead of GPT. Was it not the thing I had to do to achieve it?
User avatar
AndyMH
Level 16
Level 16
Posts: 6898
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Converting GPT to MBR?

Post by AndyMH »

What are you hoping to gain by the change?

Booting in UEFI mode off a legacy drive is not a problem - all it does is use up one of your primary partitions. Your drive is only 120GB so a long way from the legacy limit of 2TB.

Encrypting your drive just complicates things - are you sure it is encrypted? I would have expected /dev/mapper to appear in your fdisk output or did you truncate it?
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 4 x Thinkpad T430 Cinnamon 20.1, 2 x i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
ninyoras
Level 1
Level 1
Posts: 8
Joined: Wed Sep 30, 2020 1:27 pm

Re: Converting GPT to MBR?

Post by ninyoras »

What are you hoping to gain by the change?
The inconvenience made me do the conversion is gone now.
Encrypting your drive just complicates things - are you sure it is encrypted? I would have expected /dev/mapper to appear in your fdisk output or did you truncate it?
Yup, it was truncated.

Does it cause anything if I see this when checking gdisk?

Code: Select all

user@host:~$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************


Command (? for help): ^C
Earlier it was like this:

Code: Select all

user@host:~$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): ^C
User avatar
AndyMH
Level 16
Level 16
Posts: 6898
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Converting GPT to MBR?

Post by AndyMH »

Does it cause anything if I see this when checking gdisk?
No. gdisk is for GPT partition tables. I use sfdisk - handles both.

If you are new to linux I strongly suggest you don't use full disk encryption. If you bork the system it is either impossible or very difficult to get it back. If you have stuff you consider sensitive I recommend veracrypt containers.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 4 x Thinkpad T430 Cinnamon 20.1, 2 x i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
User avatar
karlchen
Level 21
Level 21
Posts: 14387
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Converting GPT to MBR?

Post by karlchen »

Question: GPT to MBR?

Answer:
Definitely not possible.

GPT means grand partition table. - So it is a particular partition table. - GPT partitions can only exist on (U)EFI boot systems.
MBR mean master boot record. - So it is not a partition table, but the boot record on a harddisk.
You cannot convert a partition table, GPT or traditional PT, into an MBR.

Harddisks, which have got an MBR, can only have normal partition tables. The system has to use Bios boot or be (U)EFI capable, but running in Legacy Boot mode (=Bios boot).
Limitation: max. of 4 primary disk partitions. You can work around this limitation by creating
+ 3 primary partitions
+ 1 extended partition: inside this extended partition, you can create logical partitions, quite a few of them.

Harddisks, which use GPTs, can have more than 4 primary partitions. Such harddisks can be used only in combination with (U)EFI boot.

--
In case my explanation should be partially unprecise or incorrect, I am sure that someone will chime in and correct me.

The answer to the question, asked in the title, however, will remain the same: A GPT cannot be converted into an MBR.
Image
Linux Mint 19.3 64-bit Cinnamon, Total Commander 9.51 64-bit
The Prophet's Song
User avatar
AndyMH
Level 16
Level 16
Posts: 6898
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Converting GPT to MBR?

Post by AndyMH »

Harddisks, which use GPTs, can have more than 4 primary partitions. Such harddisks can be used only in combination with (U)EFI boot.
Being pedantic, not true. You can boot legacy with GPT, just need a bios-grub partition, but okay, beyond the average newbie. :D
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 4 x Thinkpad T430 Cinnamon 20.1, 2 x i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
t42
Level 5
Level 5
Posts: 863
Joined: Mon Jan 20, 2014 6:48 pm

Re: Converting GPT to MBR?

Post by t42 »

"You can boot legacy with GPT, just need a bios-grub partition"
That's my standard setup, just now here are eight GPT disks with many BIOS legacy boot partitions.

Code: Select all

sudo gdisk /dev/sde
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Still we are talking avout LInux only. Windows prevents installing system on GPT disk in legacy mode, no matter what.
-=t42=-
User avatar
ricardogroetaers
Level 5
Level 5
Posts: 785
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Converting GPT to MBR?

Post by ricardogroetaers »

ninyoras wrote:
Mon May 03, 2021 12:29 pm
My partition table:

Code: Select all

user@host:~$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x478f0f9c

Eszköz     Indítható   Start      Vége Szektorok  Size Id Típus
/dev/sdb1               2048   1050623   1048576  512M ef EFI (FAT-12/16/32)
/dev/sdb2            1050624   2549759   1499136  732M 83 Linux
/dev/sdb3            2549760 250068991 247519232  118G 83 Linux
If what is shown by the command "fdisk" (I don't like fdisk) is true, the partitioning of the disk media is already in MBR.
Nothing to do.
Or I did not understand your question correctly.

Please do not confuse Firmware (BIOS, UEFI) with partitioning system (MBR, GPT).
User avatar
ricardogroetaers
Level 5
Level 5
Posts: 785
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Converting GPT to MBR?

Post by ricardogroetaers »

karlchen wrote:
Wed May 12, 2021 11:34 am
Question: GPT to MBR?

Answer:
Definitely not possible.
It is possible with the appropriate software.
However, if there are operating systems on the disk, the operating systems may not work correctly after conversion.

Windows class operating systems (64 bits), if nothing new has been added, to boot GPT disks mandatorily require UEFI.
Current Linux systems can boot GPT disks in BIOS mode.
Post Reply