Difference between revisions of "Grub 2 recovery"

From Supercomputación y Cálculo Científico UIS
(Created page with " Back to Grub == Procedure 1 == Boot into Live CD Open Terminal (CTRL+ALT+T) Enter the following commands: sudo fdisk -l And find your Ubuntu partition sudo mount /de...")
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
__NOTOC__
  
 +
<div class="thumbnail img-thumbnail">http://wiki.sc3.uis.edu.co/images/a/a8/Logo_sc33.png</div>
 +
<p><div class="btn btn-primary"><i class="fa  fa-long-arrow-left"></i> [[Grub]]</div></p>
 +
<div class="column clearfix">
 +
    <div class="col-md-14">
 +
        <div class="well well-midnight">
 +
            <h4>Grub 2 recovery</h4>
 +
        </div>
 +
    </div>
 +
</div>
  
Back to [[Grub]]
+
<div class="col-md-14">
 +
    <div class="panel panel-darker-white-border">
 +
        <div class="panel-heading">
 +
            <h3 class="panel-title">Procedure 1</h3>
 +
        </div>
 +
        <div class="panel-body">
 +
            <p>
  
 +
1. Boot into Live CD
 +
2. Enter the following commands: {{Command|<nowiki>sudo fdisk -l</nowiki>}}
 +
And find your Ubuntu partition
  
== Procedure 1 ==
+
3. Run the following commands:
 +
{{Command|<nowiki>sudo mount /dev/sda2 /mnt</nowiki>}}
 +
{{Command|<nowiki>sudo mount --bind /sys /mnt/sys</nowiki>}}
 +
{{Command|<nowiki>sudo mount --bind /proc /mnt/proc</nowiki>}}
 +
{{Command|<nowiki>sudo mount --bind /dev /mnt/dev</nowiki>}}
 +
{{Command|<nowiki>sudo chroot /mnt</nowiki>}}
 +
4. Now reinstall Grub2
 +
{{Command|<nowiki>grub-install --recheck /dev/sda</nowiki>}}
 +
{{Command|<nowiki>apt-get install --reinstall grub2</nowiki>}}
 +
5. Run as root
 +
{{Command|<nowiki>update-grub2</nowiki>}}
 +
since in the previous steps the grub list was created with an /dev/sda4 as an entry.
  
Boot into Live CD
+
            </p>
Open Terminal (CTRL+ALT+T)
+
        </div>
Enter the following commands:
+
    </div>
sudo fdisk -l
+
</div>
And find your Ubuntu partition
 
sudo mount /dev/sda2 /mnt
 
  
sudo mount --bind /sys /mnt/sys
+
<div class="col-md-14">
 +
    <div class="panel panel-darker-white-border">
 +
        <div class="panel-heading">
 +
            <h3 class="panel-title">Procedure 2</h3>
 +
        </div>
 +
        <div class="panel-body">
 +
            <p>
  
sudo mount --bind /proc /mnt/proc
+
These are the commands for managing Grub 2.
  
sudo mount --bind /dev /mnt/dev
+
1. Check the file /etc/default/grub and adjust the options accordingly
  
sudo chroot /mnt
+
2. Install grub2 in MBR
Now reinstall Grub2
+
{{Command|<nowiki>grub-install /dev/sda</nowiki>}}
grub-install --recheck /dev/sda
+
3. Auto-generate the boot menu for grub2:
apt-get install --reinstall 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>}}
  
 
+
            </p>
Seguido, desde el nodo como root ejecute: update-grub2 ya que en los pasos anteriores se creaba en la lista de grub una opcion con /dev/sda4
+
        </div>
 
+
     </div>
 
+
</div>
== Procedure 2 ==
 
 
 
 
 
Estos son los comandos para la gestión de grub2
 
 
 
Archivo de configuración general
 
    /etc/default/grub
 
 
 
Instalar grub2 en el MBR
 
    grub-install /dev/sda
 
 
 
Generar automáticamente el archivo del menú de inicio del grub2
 
    grub-mkconfig -o /boot/grub/grub.cfg
 
 
 
Actualizar el archivo del menú de configuración
 
     update-grub
 
 
 
Para recuperar un guane se utiliza
 
    grub-mkconfig -o /boot/grub/grub.cfg
 
    grub-install /dev/sda
 

Latest revision as of 16:57, 9 April 2015


Logo_sc33.png

Grub 2 recovery

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