Re: Deb install on USB device destroys MBR of hard disk
Tim Legg wrote:
> Hello, I have a pretty exasperating problem with installing Debian onto a USB device using the netinstall CD. When it asks for the GRUB boot loader, I told it 'Yes' install it and it went ahead and installed on the hard disk /dev/hda instead of /dev/sde where everything else was being installed to.
>
> When I rebooted, I got:
>
> GRUB Loading stage1.5.
>
> GRUB loading, please wait...
> Error 21
>
> My MBR on my hard disk got hosed. That happened back in March...
>
> Back then, after reinstalling Debian to fix the MBR, I used 'dd' to create a backup of the mbr (which I think is the first 512 bytes on the device) and then use 'dd' to copy it to where it was supposed to be on the bootable device. That was how I finally accomplished installing on Debian on a 4GB SD card.
>
> It went something like this:
>
>>From a live CD beforehand:
>
> debian:/home/user# dd if=/dev/hda/ of=/home/user/mbr.img bs=512 count=1
>
> and then copy it to a USB flash drive that I mounted. And after the MBR gets overwritten incorrectly, I booted from the live CD again and copy the MBR to the correct device and then restore the backed up copy like this:
>
> debian:/home/user# dd if=/dev/hda/ of=/dev/sda bs=512 count=1
> debian:/home/user# dd if=/home/user/mbr.img of=/dev/hda bs=512 count=1
>
> Well, when you install Debian on a 1TB USB hard disk, it is obviosuly a more complex MBR than what fits in 512 bytes. And once again, I had to reinstall Debian on my machine again...
>
> Has anybody out there successfully installed Debian on a fairly modern USB hard disk? If so, what suggestions do you have for working around this problem? Is there some way I can view the MBR with a hex editor to find out the size of the record?
>
>
>
> I never bothered posting anything about this because back then because I was certain that somebody would post something and it would be fixed. But I am very surprised that 6 months have passed and this is still a problem. Thought for sure this would have been fixed and now I feel guilty for not speaking up then. I hope that somebody who has authority to file a bug reports does do so...
>
> Tim Legg
This link will probably make you mad. Would have saved you a few
installs. :)
http://www.supergrubdisk.org/
The above link will take care of all your stated problems. OR, from a
working Debian system 'man grub-install'
Something like 'grub-install /dev/sdb' would probably have done the
trick from Debian.
Reply to: