MBR to GPT Conversion Task
-
Can we get the ability to automatically convert a MBR based image to GPT after a deployment?
Looks like it’s possible via gdisk without data loss. If this could be scripted after a clone job, that would be a miracle cure for me.
More info here: http://slavisa-jovanovic.com/linux/2015/02/19/mbr-to-gpt.html
-
@netbootdisk Doing this in general could cause us a lot of trouble. I wouldn’t wanna go there.
But that’s not saying it’s nothing we should look into and give it a try. Maybe start by using a postdownloadscript. Check out George’s post on this: https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script
Using
gdisk
in a script you can use this method (sure there are others as well):gdisk /dev/sda <<EOF w Y EOF
Give it a go and let us know what happens. By the way: why do you want to convert from MBR to GPT? If it’s to move on to UEFI there is more to it than just that!!!
-
Was hoping to have a universal image that could be deployed to either a legacy or UEFI machine. The bulk of our fleet is legacy/MBR booting; but we’ve got new Dell 7390’s that refuse to boot legacy off the internal disk. Also have some Surfaces which we’ve been doing manually via USB WIM’s (converted from the SOE master HyperV VHD)
So now trying to avoid having to maintain another image in UEFI format for these. Of course I could just switch the existing fleet to UEFI boot, but that’s got it’s own logistical and possible technical/compatibility issues to deal with.
Have used MBR2GPT.EXE on a legacy-booted machine, restarting & changing BIOS to UEFI mode then resulted in a working UEFI machine; so I was hoping there might be some sort of linux based conversion possible!!
The post-download script looks perfect - I could easily script from that!
However testing gdisk (on a Surface Pro 3 which was just deployed with a MBR based image), resulted in errors about overlapping partitions - which were detected incorrectly anyway. About to see if the Dell does the same thing.
-
gdisk appears to have worked on the Dell - no errors - but the ‘BIOS’ setup on the dell doesn’t see any UEFI boot loader.
I might be better off just building a WinPE with MBR2GPT.EXE in it… or just resign to the fact of maintaining dual images.
-
@netbootdisk said in MBR to GPT Conversion Task:
Was hoping to have a universal image that could be deployed to either a legacy or UEFI machine.
Just wanted to comment on this, this endeavor is probably (at least for now) not realistic. There are fundamental differences between MBR and GPT partitions that are not overcome quickly at the moment. When I was regularly imaging systems in a 500+ system environment, it was a standard to have a Legacy image and a UEFI image for specific models. I don’t see that changing any time soon. There needs to be radical advancements in imaging technology to have a universal image that works for both Legacy and UEFI, and we are simply not there yet (2018).
To help you achieve maximum imaging ease, you will need to have the appropriate image for your needs where you need said image. I cannot tell you your needs, only you know that. But you need to simply capture the images you need for the models you need in the immediate future. After that is accomplished, we can try to help you with automating building a model independent image afterwards. @george1421 has probably the most experience in building model-independent images. Me personally, all the technological specifics were not worth figuring out - I simply maintained an image per model. Others disagree - but I attest that the strategy worked well for me.
-
I’ve had great success with a “universal” image so far on legacy machines. But I agree; now that I’ve done further research, any hybrid image with UEFI is not looking good. (Although converting the SOE master VHD image to a WIM & transposing that to a USB has worked relatively well despite not being fully automated by FOG’s management.)
As it turns out MBR2GPT.EXE via WinPE failed to find the OS partition - though it was there so FOG did it’s job.
Either way I give up - wasting too much time on this - 2 x images it is
-
@netbootdisk You can create a universal image within the firmware style. The disk and hardware interface is different between uefi and bios. The disk format is less of an issue. We use MDT and two VMs (one bios and one uefi) to create a consistent golden image for each firmware style. That way each golden image is consistently the same.