Home > Linux, Windows > Move grub from internal disk to external storage

Move grub from internal disk to external storage

January 27th, 2010 Leave a comment Go to comments

When I installed Ubuntu Linux on my USB 8GB stick I didn’t noticed where grub was being installed. After a while I noticed that I could only boot my Windows installation (on the internal hard drive) via the USB 8GB stick.

What happened was that Ubuntu install changed the master boot record (MBR) of my internal drive and set it up to load the remaining of Grub (it is split in 2 because otherwise it wouldn’t fit on the MBR) from the USB storage.

To fix this I could use the Windows tools (fixmbr) but that requires me to boot using the recovery console and login as system administrator. Although using fixmbr would restore the Windows boot loader it would erase grub and make the USB storage  not bootable.

What worked for me was MbrFix from sysint (www.sysint.no). REMARK: following the instructions below might make your computer unusable and eventually make you lose data.

First I got the list of partitions on my internal disk:

C:\>MbrFix.exe /drive 0 listpartitions
# Boot Size (MB) Type
1 Yes     76316    7  NTFS or HPFS
2             0    0  None
3             0    0  None
4             0    0  None

Next I saved my internal disk mbr to a file:

C:\>MbrFix.exe /drive 0 savembr Backup_MBR_0.bin

Next I listed my partitions on my USB disk drive:

C:\>MbrFix.exe /drive 1 listpartitions
# Boot Size (MB) Type
1          6440  131  Linux native (usually ext2fs)
2          1223  130  Prime
3             0    0  None
4             0    0  None

Now I want to put grub on my USB disk:

C:\>MbrFix.exe /drive 1 restorembr Backup_MBR_0.bin
You are about to Restore MBR,
are you sure (Y/N)? Y

Now let’s see how the partition looks like:

C:\>MbrFix.exe /drive 1 listpartitions
# Boot Size (MB) Type
1 Yes     76316    7  NTFS or HPFS
2             0    0  None
3             0    0  None
4             0    0  None

Ups! what happened there? My Linux partitions are gone… Let me try and fix this…

C:\>MbrFix.exe /drive 1 /partition 1 setpartitiontype 131
You are about to Set partition type,
are you sure (Y/N)? Y
Partition 1, type before: 7 NTFS or HPFS
Partition 1, type after: 131 Linux native (usually ext2fs)

C:\>MbrFix.exe /drive 1 /partition 2 setpartitiontype 130
You are about to Set partition type,
are you sure (Y/N)? Y
Partition 2, type before: 0 None
Partition 2, type after: 130 Prime

C:\>MbrFix.exe /drive 1 listpartitions
# Boot Size (MB) Type
1 Yes     76316  131  Linux native (usually ext2fs)
2             0  130  Prime
3             0    0  None
4             0    0  None

Looks like by setting the partition types back to their original values solved the problem.. yes it did.. ufff…

Now let’s restore the original Windows boot loader on the internal disk:

C:\Documents and Settings\machados\My Documents\Downloads>MbrFix.exe /drive 0 fixmbr
You are about to Fix MBR,
are you sure (Y/N)? Y

Now I could boot the system without the USB disk connected to my laptop.

I could also boot my Linux system by connected the USB disk and selecting “boot from usb storage” from my bios boot menu.

Categories: Linux, Windows
  1. January 27th, 2010 at 23:05 | #1

    Do you know that you have a chance to find the nice outcome just about custom papers and even about this good topic from the trustworthy essay writing service. Hence, you have an opportunity to examine this.

  2. smachado
    February 23rd, 2010 at 01:33 | #2

    Very interesting, I’ll check it out.

  1. No trackbacks yet.