Difference between revisions of "Grub 2 recovery"
From Supercomputación y Cálculo Científico UIS
(Formatting options and other things) |
|||
Line 2: | Line 2: | ||
== Procedure 1 == | == Procedure 1 == | ||
− | Boot into Live CD | + | 1. Boot into Live CD |
− | + | 2. Enter the following commands: {{Command|<nowiki>sudo fdisk -l</nowiki>}} And find your Ubuntu partition | |
− | Enter the following commands: | + | 3. Run the following commands: |
− | sudo fdisk -l | ||
− | And find your Ubuntu partition | ||
{{Command|<nowiki>sudo mount /dev/sda2 /mnt</nowiki>}} | {{Command|<nowiki>sudo mount /dev/sda2 /mnt</nowiki>}} | ||
{{Command|<nowiki>sudo mount --bind /sys /mnt/sys</nowiki>}} | {{Command|<nowiki>sudo mount --bind /sys /mnt/sys</nowiki>}} | ||
Line 12: | Line 10: | ||
{{Command|<nowiki>sudo mount --bind /dev /mnt/dev</nowiki>}} | {{Command|<nowiki>sudo mount --bind /dev /mnt/dev</nowiki>}} | ||
{{Command|<nowiki>sudo chroot /mnt</nowiki>}} | {{Command|<nowiki>sudo chroot /mnt</nowiki>}} | ||
− | Now reinstall Grub2 | + | 4. Now reinstall Grub2 |
{{Command|<nowiki>grub-install --recheck /dev/sda</nowiki>}} | {{Command|<nowiki>grub-install --recheck /dev/sda</nowiki>}} | ||
{{Command|<nowiki>apt-get install --reinstall grub2</nowiki>}} | {{Command|<nowiki>apt-get install --reinstall grub2</nowiki>}} | ||
− | + | 5. Run as root | |
− | |||
{{Command|<nowiki>update-grub2</nowiki>}} | {{Command|<nowiki>update-grub2</nowiki>}} | ||
− | + | since in the previous steps the grub list was created with an /dev/sda4 as an entry. | |
== Procedure 2 == | == Procedure 2 == | ||
− | + | These are the commands for managing Grub 2. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 1. Check the file /etc/default/grub and adjust the options accordingly | |
− | |||
− | + | 2. Install grub2 in MBR | |
− | + | {{Command|<nowiki>grub-install /dev/sda</nowiki>}} | |
− | + | 3. Auto-generate the boot menu for grub2: | |
+ | {{Command|<nowiki>grub-mkconfig -o /boot/grub/grub.cfg</nowiki>}} | ||
+ | 4. Update the setup menu file: | ||
+ | {{Command|<nowiki>update-grub</nowiki>}} | ||
+ | 5. For recovering a node in guane run: | ||
+ | {{Command|<nowiki>grub-mkconfig -o /boot/grub/grub.cfg</nowiki>}} | ||
+ | {{Command|<nowiki>grub-install /dev/sda</nowiki>}} |
Revision as of 23:14, 11 October 2014
Back to Grub
Procedure 1
1. Boot into Live CD
2. Enter the following commands:
sudo fdisk -l
And find your Ubuntu partition
3. Run the following commands:
sudo mount /dev/sda2 /mnt
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt
4. Now reinstall Grub2
grub-install --recheck /dev/sda
apt-get install --reinstall grub2
5. Run as root
update-grub2
since in the previous steps the grub list was created with an /dev/sda4 as an entry.
Procedure 2
These are the commands for managing Grub 2.
1. Check the file /etc/default/grub and adjust the options accordingly
2. Install grub2 in MBR
grub-install /dev/sda
3. Auto-generate the boot menu for grub2:
grub-mkconfig -o /boot/grub/grub.cfg
4. Update the setup menu file:
update-grub
5. For recovering a node in guane run:
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda