I again hit a wall in a manual. Even if you really take the time to read a manual, that might still sometimes be useless or not as useful as it should be.
The manual tells me, I can provide up to 3 partitions as arguments to the command. How are the partitions identified? By location? By name? By label? By UUID? How?
At least, there won’t be some Linux hardcore C programmer coming here, telling me to read the manual instead of asking… Because I am literally reading the manual!!!
I found the second ambiguity. It is also regarding on how to denote a partition.
How would the partition argument look like, when given as an argument to this command?
I suppose what we have to remember that even though we read a manual, does not mean we are going to understand it. No matter how much we think we know, there is always something new to learn. Because of the engineer thinking of the author’s mind, it isn’t made simple for someone like me who wants it to be put in plain English and actually have pictures or diagrams, of the subject being explained. There was only a few things I managed to understand, but only because I have used them before. Like pushing shift to get into Grub before the Grub activates. Wish they could put these manuals into easy to follow guides. I would like to see these manuals written as a children’s book.
Once upon a time there was Grub, it wasn’t an insect but a written one in computer language. The sole purpose of this Grub is to say hello, after hearing an hello, from it’s best friend BIOS. BIOS lives on the spaceship called Motherboard. No not bored as in boring, but board like wooden board.
If the partition names are being used by grub2 (ie if they are not just names being passed on to some other command), then grub identifies partitions by things like (hd0,1)… disk zero, partition 1.
I have not tested it with gptsync, but that is what you use at the grub> command prompt.
This command populates the legacy MBR with the specified partition entries on device. Up to three partitions may be used.
If I define a partition like hd0,1, then why do I need to provide a device? The disk number is already part of this notation.
Besides that, I didn’t find a single example on the internet, displaying usage of this command.
I wish, there were real life examples of GRUB2’s gptsync usages. Then, we would not need to guess or re-interpret the manual. Just a look at the example would most likely make things clear or at least help in understanding the case further.
Am I reading it right? gptsync copies the gpt partition table to the mbr?
So it doesnt put grub in the mbr, just the partition table?
But it would not be correct as copied? The gpt partition table is different to the msdos partition table. Does it convert it or something?
I thought a gpt partitioned disk did not have a real mbr? It has a protective mbr (pmbr) which is just a space which is there to save you if you accidentslly try to treat it as an msdos partitioned disk.
So I dont understand what you are trying to do… are you trying to copy gpt information from some file onto the first sector of the device?
If so there are other ways eg use dd
and I dont understand gptsync either
so I am not much help
Neville
There are 2 copies of the gpt, one in the first sector, and one in the last.
There is also a protective mbr (Pmbr) which I though was just a null space. That is for a uefi boot. It doesnt need an mbr for uefi boot, all the boot info is in the EFI System partition.
Yes you can legacy boot a gpt disk… I do it all the time. In a legacy boot the bios needs to find a legacy mbr with grub and everything on it?
So you are talking about that MBR used for a legacy boot.?
Well I think the gptsync command might be for restoring the gpt partition table from a file.
Yes the gpt partition table info is in the same first sector as a legacy mbr, but I think the grub manual has a terminology problem calling it the mbr… it should refer to it as the first sector.
Then all the confusion which I displayed above would be avoided.
They should talk about copying the gpt to the disk first sector… not to the mbr.
Clonezilla can restore gpt info. We might look at how it does it.
Am I reading it right? gptsync copies the gpt partition table to the mbr?
So it doesnt put grub in the mbr, just the partition table?
But it would not be correct as copied? The gpt partition table is different to the msdos partition table. Does it convert it or something?
Why would you want to do that?
THIS REPLY SHOULD HAVE BEEN BEFORE THE PREVIOUS ONE
Disks using the GUID Partition Table (GPT) also have a legacy Master Boot Record (MBR) partition table for compatibility with the BIOS and with older operating systems. The legacy MBR can only represent a limited subset of GPT partition entries.
This command populates the legacy MBR with the specified partition entries on device. Up to three partitions may be used.
type is an MBR partition type code; prefix with ‘0x’ if you want to enter this in hexadecimal. The separator between partition and type may be ‘+’ to make the partition active, or ‘-’ to make it inactive; only one partition may be active. If both the separator and type are omitted, then the partition will be inactive.
Well I think the `gptsync` grub command might be for restoring the gpt partition table from a file.
That is wrong.
It makes an msdos partition table (the same as if you had done an msdos partition table in gparted). except it gets the entries for the msdos table from the entries in your gpt table.
Why would you want to do that? How would a disk with 2 partition tables behave?
No wonder there is no example. No-one can think of a use for it.
Yes, that is how I read it now too. My guess above was a mistake.
So maybe it would still be seen as a GPT disk by the OS, but there would be junk in the PMBR… For what purpose ? The PMBR is only there to protect you, if you make a mistake and write stuff to what you mistakedly think is an MBR disk.
If I understand correctly, it just applies the backup MBR. So, in case it is missing or something is wrong with it, for whatever reason, it gets populated again. That’s how I read it.
Yes I understand you dont want the Ubuntu gptsync command
It is irrelevant to grub 2… it is for legacy bootloaders
an mbr partition table is required to use legacy bootloaders (lilo, grub) on efi-based (extensible firmware interface) machines like the intel-based macs. gptsync is usually used in combination with the refit boot menu on such machines.
That came from a mint website.
OK you might need an example of grub > gptsync
but there will not be one
because users of grub2 do not need to do this.