Restoring GRUB

Waleed Harbi waleed.harbi at gmail.com
Fri Oct 9 15:06:41 UTC 2009


Have you tried grub-install and update-grub in rescue mode? Use ubuntu
cd for this if you not try.

On 09/10/2009, Stuart Murray-Smith <eight32 at gmail.com> wrote:
> Greets list :)
>
> We require automating an image solution for a lab of dual-booting
> Ubuntu 9.04 && Windows desktops, all goes well except we resort to
> restoring GRUB manually.
>
> We intend to install Windows first, Ubuntu second, && use Ubuntu's
> GRUB as boot manager. The drive structure is such:
>
> /dev/sda1 == NTFS/Windows
> /dev/sda2 == swap
> /dev/sda3 == Ext3/Ubuntu 9.04
>
> -Steps taken-
>
> 1. capture MBR structure:
>
> sudo sfdisk -d /dev/sda > sda_MBR.out
>
> 2. image the MBR:
>
> sudo dd if=/dev/sda  of=sda_MBR_446.img count=1 bs=446
>
> 3. span the images of the OSes:
>
> sudo dd if=/dev/sda1 of=image_os_1a.img bs=1M count=4000
> sudo dd if=/dev/sda1 of=image_os_1b.img bs=1M count=4000 skip=4000
> ...
>
> sudo dd if=/dev/sda3 of=image_os_2a.img bs=1M count=4000
> sudo dd if=/dev/sda3 of=image_os_2b.img bs=1M count=4000 skip=4000
> ...
>
> 4. restoring the MBR:
>
> sudo sfdisk --no-reread -f /dev/sda < sda_MBR.out
>
> 5. re-imaging the MBR:
>
> sudo dd if=sda_MBR_446.img of=/dev/sda count=1 bs=446
>
> 6. restoring the OSes && swap partition:
>
> sudo mkswap /dev/sda2
>
> sudo dd if=image_1a.img of=/dev/sda1 bs=1M conv=sync,noerror
> sudo dd if=image_1b.img of=/dev/sda1 bs=1M conv=sync,noerror seek=4000
> ...
>
> sudo dd if=image_2a.img of=/dev/sda3 bs=1M conv=sync,noerror
> sudo dd if=image_2b.img of=/dev/sda3 bs=1M conv=sync,noerror seek=4000
> ...
>
> Upon {warm|cold} reboot, we're dumped at GRUB, no going further.
>
> We manually restore GRUB by:
>
> sudo grub
> find /boot/grub/stage1
> root (hd0,$find)
> setup (hd0)
> quit
>
> I've tried:
>
> sudo grub-install (hd0)
> sudo update-grub
>
> at the command line but no success.
>
> Your insight appreciated :)
>
> Stu@
>
>
> --
> Then you will know the truth, and the truth will set you free
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

-- 
Sent from my mobile device

Best Regards,
Waleed Harbi
Success is the sum of small efforts, repeated day in and day out.




More information about the ubuntu-users mailing list