Using custom MBR for Lenovo clients

  • Hey there,

    once again I encountered a problem where I might need your help.

    We are currenty getting new machines for our location. The new machines are all lenovo ThinkCentre E73 with Windows 7 on them. The first time i tried to deploy an image the computer just showed me a blinking curser.

    Meanwhile I found out that lenovo machines use an mbr which does not have the usual size of 512, but 2048 byte. I tried to manually copy the mbr from a working machine to a freshly deployed machine an it booted again.

    As I don’t want to manually do this with every single machine after a deployment task I’m currently looking for a solution to automate this.

    I found out that the *.mbr file in the image folder is nothing more than a dump of the first 512 bytes of the disk, well the mbr. So i replaced this file with the whole lenovo mbr, but the tool refuses to use this file (probably because of the unusual size; i set all permissions to be the same).

    Is there any known way to automate the process, or even tell fog to use the first 2048 byte as mbr? I know that symantec ghost supports such a flag (ghost -ib), is there such an option / workaround in fog?

  • Okay, I found a solution that works for me, although it is not in a state to use is as a patch. My solution is ONLY for the download task, it does NOT fix the upload task and you have to do some manual steps everytime you create a new image (and only for mps images). I did the following:

    1. Edit

    204 if [ -f $tmpMBR ]; then
    205 if [ “$mbrsize” != “32256” -a “$has_GRUB” != “1” ] && [ “$mbrsize” != “512” ] && [ “$mbrsize” != “2048” ]; then
    206 dots “Restoring Partition Tables”;
    207 sgdisk -gel $tmpMBR $hd 2>&1 >/dev/null;
    208 gptcheck=“yes”;
    209 elif [ “$mbrsize” == “32256” -o “$has_GRUB” == “1” ] && [ “$osid” == “50” ]; then
    210 dots “Restoring MBR and GRUB”;
    211 restoreGRUB “${hd}” “1” “${imagePath}”;
    212 if [ -e “${imagePath}/d1.partitions” ]; then
    213 echo “Done”;
    214 dots “Extended partitions”;
    215 sfdisk $hd < ${imagePath}/d1.partitions &>/dev/null;
    216 else
    217 echo “Done”;
    218 dots “No extended partitions”;
    219 fi
    220 elif [ “$mbrsize” == “2048” ]; then
    221 dots “Restoring Lenovo Specific MBR”;
    222 dd if=$tmpMBR of=$hd bs=512 count=4 &>/dev/null;
    223 echo “Done”;
    224 else
    225 dots “Restoring MBR”;
    226 dd if=$tmpMBR of=$hd bs=512 count=1 &>/dev/null;
    227 if [ -e “${imagePath}/d1.partitions” ]; then
    228 echo “Done”;
    229 dots “Extended partitions”;
    230 sfdisk $hd < ${imagePath}/d1.partitions &>/dev/null;
    231 else
    232 echo “Done”;
    233 dots “No extended partitions”;
    234 fi
    235 fi

    1. Create an image via uploading from master workstation.
    2. Boot master workstation with linux live image.
    3. Backup MBR
      dd if=/dev/sdX of=backup.mbr bs=512 count=4
    4. Save backup.mbr in your image folder, name it d1.mbr and set permissions like the original d1.mbr file

    After these steps your workstations should boot to windows 7 again after running a deployment task - well, at least mine do.

  • Hi there, i have in some way the same Problem, i’ve made an image from the Master, to copy that on 34 Machines with the same hardware in. The Problem is, the Master has different partitions as the Target machines. So everytime after restore Windows Bluescreen.

    How do you have copied the MBR?