Back in the old days FOG did not capture the MBR (now in d1.mbr
) and partition table (d1.partitions
) information when uploading an image from a client. So even today FOG trunk needs to do assumptions on start sector, partition size and layout. This is mostly working if people have a standard windows setup but can also fail which is very hard and time consuming to debug. Read through this if you are interested. And I am sure there are other posts on failing legacy images.
Trying to improve legacy partimage compatibility my first attempt was to extract the start sector from the rec.img.000 file and patch the MBR on the fly after deploying the default MBR file (e.g. win7.mbr), which we ship with FOG.
After playing with this for a bit and trying it out it seemed rather sketchy to me. Plus this would be something we need to do on every deploy with those legacy images. So I had the idea to extract the information and build the MBR and partition layout files via a script that people can run on their server. It would search through all the images and simply add d1.mbr
and d1.partitions
in case those files are missing.
This idea has been around for a good week and I talked to Tom about it already. So today I got myself together and started working on it. Extracting the information from rec.img.000 is not too hard. But as I was digging through this file I discovered that partimage includes the original MBR into rec.img.000 on capture. Surprise! I am sure the old FOG gang knew this long before I stumbled upon it. Nevermind.
So what does this mean? I found partimage to have a restmbr
(restore MBR) mode/command. Using this we should be able to write the original MBR from the partimage file and don’t need to do any assumptions on start sectors and partition layout. But wait - there are two issues with that:
partimage restmbr
command seems to not want to accept destination device as command line parameter yet (I was only able to restore via ncurses GUI) - guess we can come up with a patch for that- resizable image type is another story if we take this route - I am sure we can figure this out but I haven’t had enough time to think it all through yet
Just wanted to get this out to you guys before I spent more time on this. Possibly you think this is all crap and that we shouldn’t bother about all that legacy stuff anyway. Open for discussion! Please let me know what you think of it.