RPDiep
October 31st, 2008, 11:36 PM
Repairing/Reinstalling GRUB using Ubuntu LiveCD
(using info from txuk, http://ubuntuforums.org/archive/index.php/t-210820.html)
Sometimes you accidentally overwrite your MBR, leaving your system unbootable.
Here's how to fix that situation, with the Ubuntu LiveCD.
Step 1. Boot your LiveCD. Should not be too hard ;)
Step 2. Determine what drive partition the root partition is of your installed system.
If you know how to, just do that. If not, here's an easy way to do it. Go to Places -> Computer.
Rightclick on your drive and click "Mount volume". Open up a terminal and type "mount".
Usually, the last lign appearing contains the name of your partition.
For example : "/dev/sda3 on /mnt/disk type ext3 (rw,relatime)" <--- /dev/sda3 is your drive here.
Now unmount it again by typing "sudo umount /dev/sda3" (or whichever is your partition)
Step 3. Open up a terminal (Accessories -> Terminal). Change to the root by typing "cd /".
Make a directory "mountedsystem" (sudo mkdir mountedsystem), and mount your partition here:
"sudo mount /dev/sda3 /mountedsystem"
Step 4. Mount your proc and dev directories in the mounted system:
"sudo mount -o bind /proc /mountedsystem/proc" and "sudo mount -o bind /dev /mountedsystem/dev"
Step 5. Change the root to your mounted system:
"sudo chroot /mountedsystem"
Step 6. Now reinstall GRUB by using the following command:
"sudo grub-install /dev/sda" <- that's your partition name minus the number.
This is how I got my system back running after installing Windows XP.
Good luck!
(using info from txuk, http://ubuntuforums.org/archive/index.php/t-210820.html)
Sometimes you accidentally overwrite your MBR, leaving your system unbootable.
Here's how to fix that situation, with the Ubuntu LiveCD.
Step 1. Boot your LiveCD. Should not be too hard ;)
Step 2. Determine what drive partition the root partition is of your installed system.
If you know how to, just do that. If not, here's an easy way to do it. Go to Places -> Computer.
Rightclick on your drive and click "Mount volume". Open up a terminal and type "mount".
Usually, the last lign appearing contains the name of your partition.
For example : "/dev/sda3 on /mnt/disk type ext3 (rw,relatime)" <--- /dev/sda3 is your drive here.
Now unmount it again by typing "sudo umount /dev/sda3" (or whichever is your partition)
Step 3. Open up a terminal (Accessories -> Terminal). Change to the root by typing "cd /".
Make a directory "mountedsystem" (sudo mkdir mountedsystem), and mount your partition here:
"sudo mount /dev/sda3 /mountedsystem"
Step 4. Mount your proc and dev directories in the mounted system:
"sudo mount -o bind /proc /mountedsystem/proc" and "sudo mount -o bind /dev /mountedsystem/dev"
Step 5. Change the root to your mounted system:
"sudo chroot /mountedsystem"
Step 6. Now reinstall GRUB by using the following command:
"sudo grub-install /dev/sda" <- that's your partition name minus the number.
This is how I got my system back running after installing Windows XP.
Good luck!