Difference between revisions of "Reinstalling GRUB from a Netboot"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
(Created page with "<span data-link_translate_fr_title="Reinstallation de GRUB depuis un Netboot" data-link_translate_fr_url="Reinstallation de GRUB depuis un Netboot"></span>:fr:Reinstallatio...")
 
Line 20: Line 20:
 
Once your netboot is effective on your server, you will have to follow the following commands:  
 
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
+
     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 /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 /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 /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 --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
+
     mount -t proc /proc /mnt/proc           # For Grub2 to find /proc/mounts
     chroot /mnt /bin/bash # root the mounted disk
+
     chroot /mnt /bin/bash                   # root the mounted disk
     mount -a # mount partitions in chroot
+
     mount -a                               # mount partitions in chroot
     apt-get install grub-pc # install Grub2 software (on the now-rooted disk)
+
     apt-get install grub-pc                 # install Grub2 software (on the now-rooted disk)
     update-grub # create a new configuration file: grub.cfg
+
     update-grub                             # create a new configuration file: grub.cfg
     grub-install --force /dev/sda # install grub on MBR
+
     grub-install --force /dev/sda           # install grub on MBR
  
 
Now you just have to unmount the partitions mounted in the chroot:
 
Now you just have to unmount the partitions mounted in the chroot:

Revision as of 10:08, 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

< style="background-color: #e78581;"> /!\ Le montage des partitions peut entraîner une perte de données. Faites attention à la dangerosité de vos 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: Qu’est ce que le netboot et comment le lancer

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?