Tuesday, 19 July 2011

A quick reminder after windows reinstall

I happened I had to reinstall my windows partition 3 times during last 6 months. Not a disaster but the fact that Windows doesn't care about dual boots and such annoys me.

So this is a quick reminder for those who have gentoo+windows on one box and want to have grub in master boot record.

1. Start the system from gentoo (or other linux CD)
2. Mount your linux partitions (gentoo, boot, etc)
3. Bind devices and proc
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev

4. Chroot into mounted gentoo
# chroot /mnt/gentoo /bin/bash

5. Refresh and config your environment
# env-update
# source /etc/profile

6. Update mounted devices:
# grep -v rootfs /proc/mounts > /etc/mtab

7. Install grub (/dev/sda is my disk, make sure you give your here! remember it's a disk, not partition)
Force GRUB to recheck the device map. We may have removed drives or changed partitions.
# grub-install --recheck --no-floppy /dev/sda

8. and reboot :)
Real Time Web Analytics