Difference between revisions of "Reinstalling GRUB from a Netboot"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
Line 6: Line 6:
 
This documentation explains the procedure for reinstalling GRUB from a Netboot
 
This documentation explains the procedure for reinstalling GRUB from a Netboot
  
< style="background-color: #e78581;">
+
<div style="background-color: #e78581;">
<b> /!\ Le montage des partitions peut entraîner une perte de données. Faites attention à la dangerosité de vos manipulations. /!\  </b>
+
<b> /!\ Mounting partitions may result in data loss. Be aware of the danger of your manipulations. /!\  </b>
 
</div>
 
</div>
  
Line 15: Line 15:
 
From your extranet interface, you have the possibility to launch it on your machine.
 
From your extranet interface, you have the possibility to launch it on your machine.
  
You can also use this documentation: [[Qu’est ce que le netboot et comment le lancer]]
+
You can also use this documentation: [[What is that the netboot and how to launch?]]
  
 
== Orders to be carried out == <!--T:3-->
 
== Orders to be carried out == <!--T:3-->

Revision as of 10:11, 25 November 2022

fr:Reinstallation de GRUB depuis un Netboot
This article has been created by an automatic translation software. You can view the article source here.


This documentation explains the procedure for reinstalling GRUB from a Netboot

/!\ Mounting partitions may result in data loss. Be aware of the danger of your manipulations. /!\

Launching the netboot

The netboot is a network boot mode on a Linux light image that allows, among other things, to perform operations on a system that no longer boots in normal mode.

From your extranet interface, you have the possibility to launch it on your machine.

You can also use this documentation: What is that the netboot and how to launch?

Orders to be carried out

Once your netboot is effective on your server, you will have to follow the following commands:

   fdisk -l                                # to help you find the partition where your ubuntu is
   mount /dev/sdaX /mnt                    # mount it by replacing the X with the correct partition number
   mount --bind /dev /mnt/dev              # symbolic link from the current /dev folder to the mounted disk
   mount --bind /dev/pts /mnt/dev /pts     # symbolic link from the current /dev/pts folder to the mounted disk
   mount --bind /sys /mnt/sys              # symbolic link from the current /sys folder to the mounted disk
   mount -t proc /proc /mnt/proc           # For Grub2 to find /proc/mounts
   chroot /mnt /bin/bash                   # root the mounted disk
   mount -a                                # mount partitions in chroot
   apt-get install grub-pc                 # install Grub2 software (on the now-rooted disk)
   update-grub                             # create a new configuration file: grub.cfg
   grub-install --force /dev/sda           # install grub on MBR

Now you just have to unmount the partitions mounted in the chroot:

   umount -a

From here, you can exit the mounted disk by pressing ctrl+D. Then, unmount this disk:

   sudo umount /mnt/{dev/pts,dev,sys,proc}
   sudo umount /mnt

All you have to do is reboot your machine.

Source : How do I reinstall GRUB?