Smart Boot Manager hack
For those of us who like using SBM (Smart Boot Manager) at one point or another will come across a situation where a partition tool which falsely reports no partitions on the drive and, instead, will usually report the whole drive as one big FAT12 partition.......Partimage is one of those programs, as well as RedHat's Disk Druid and for the Puppy Linux fans, the Pmounter partition tool......For the most part all the various fdisk programs, gparted, and others, have no problem reporting the correct partition table.........This leads me to suspect that maybe it's not entirely the fault of SBM, but the shortcoming of those "buggy" programs that have problems with SBM.....
I consider SBM as one of the best boot managers to put in the MBR....It is able to chainload any bootable partition which contains an operating system's native bootloader, and also has it's own el torito stack for booting CD drives for those old BIOS which cannot boot such a drive. Well, I finally got tired of it all and decided to investigate the problem.........I started off by looking up the "magic" number that identifies a FAT12 partition, which is 0x01 in hexadecimal.....Next, I opened up a hex editor and took a peek at the primary hard drive (/dev/hda) and did a hex search or '01', which I found at offsets 0x0000000d and 0x0000000e (the 13th and 14th bytes from the beginning, starting with 0)..... Then, I changed only the first offset to a null byte (0x00), fired up partimage, and partimage now reported all the partitions......After saving the change, I rebooted to see if I broke SBM......And what do you know, there was SBM staring me in the face :D .........I highlighted the appropriate entry to boot me back into the same OS, and everything was working perfectly........ So I decided to write a script to automate the process, using dd to make the appropriate change..........With the hex editor, I changed the offset back to it's original value and first tested dd on the command line with the following command: Code:
dd if=/dev/zero bs=1 count=1 seek=14 of=/dev/hda Since I was feeling adventurous, I decided to see if that made any difference with partimage..........To my surprise, partimage reported the partitions correctly!.........Here, I was trying to change the very first instance of 0x01, figuring that would do the trick and accidentally discovered that changing the second occurrence also worked.......... I then decided to change both occurrences to null bytes and see what happens.........Partimage still reported all the partitions correctly, so I rebooted to check on the boot manager......After rebooting, SBM still appeared and looking normal........So, again, I highlighted the correct OS, and booted in without any issues..... So I modified the dd command (getting it right this time) and made the following script for whenever I need to reinstall SBM: Code:
#! /bin/sh For those interested, to run the script you must be root (or have root privileges) and simply run it like so: sh sbmhack.sh.......Using a script will avoid any heartache from possible typos (as long as the script is free of typos ;) ) I hope this will be of help for those who like Smart Boot Manager, like I do...........This is a safe hack as long as you use the script, but I will NOT be responsible for any problems if you decide to do so............You make the choice without any arm-twisting, so it's your responsibility for any problems. YOU HAVE BEEN WARNED!........ But as I said, this is a safe hack and will not cause any data loss by following the instructions carefully and correctly..... :) ---thegeekster |
you rock!
I'd had some problems trying to install RH 7.02 using its DiskDruid program. Now, I at least have something to try & see if it works after I get some sleep. Thx & I'll post back my results. :)
|
If by chance it doesn't work out for you and you want to change things back and you used the script, you can restore the MBR the way it was by cat'ing the saved sbm.bin file:
Code:
cat /sbm.bin > /dev/hda But I'm pretty sure it will do the trick for you, although I don't have any distro which uses DiskDruid, but I also tried it out on the Pmounter utility in Puppy Linux, which was successful...... :D ---thegeekster |
*** Update ***
I had a sudden inspiration to possibly make things a bit safer and easier.......I whipped up a little script which will modify or restore the correct bytes........
Copy and paste the following, making it executable, and save it as sbmhack: Code:
#! /bin/sh ---thegeekster |
Quote:
Did you get the boot situation straightened out?..............I'd really like to know how it turned out.... :) ---thegeekster |
All times are GMT -5. The time now is 08:54 AM. |