Reparació del sistema
Booting From grub>
This is how to set the boot files and boot the system from the grub> prompt. We know from running the ls command that there is a Linux root filesystem on (hd0,1), and you can keep searching until you verify where /boot/grub is. Then run these commands, using your own root partition, kernel, and initrd image:
grub> set root=(hd0,msdos1) grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1 grub> initrd /boot/initrd.img-3.13.0-29-generic grub> boot
The first line sets the partition that the root filesystem is on. The second line tells GRUB the location of the kernel you want to use. Start typing /boot/vmli, and then use tab-completion to fill in the rest. Type root=/dev/sdX to set the location of the root filesystem. Yes, this seems redundant, but if you leave this out you’ll get a kernel panic. How do you know the correct partition? hd0,1 = /dev/sda1. hd1,1 = /dev/sdb1. hd3,2 = /dev/sdd2. I think you can extrapolate the rest.
The third line sets the initrd file, which must be the same version number as the kernel.
The fourth line boots your system.
$ sudo update-grub2
Reviure el sistema
Per reviure un sistema operatiu Linux instal·lat, cal arrencar en mode Live des de l'arxiu iso. Després cal obrir un terminal i executar les següents comandes. En l'exemple, cal substituir la entrada /dev/sda6 pe la partició específica on estigui instal·lat el directori arrel (/).
$ sudo mount /dev/sda6 /mnt $ sudo mount -o bind /dev /mnt/dev $ sudo mount -o bind /sys /mnt/sys $ sudo mount -t proc /proc /mnt/proc $ sudo chroot /mnt $ grub-mkconfig -o /boot/grub/grub.cfg $ update-grub2 $ grub-install /dev/sda $ exit $ sudo reboot
Webgrafia
Schroder, C. (2014). How to Rescue a Non-booting GRUB 2 on Linux. Linux.com. https://www.linux.com/training-tutorials/how-rescue-non-booting-grub-2-linux/
Gite, V. (2013). Linux Delete / Remove MBR. NixCraft. https://www.cyberciti.biz/faq/linux-clearing-out-master-boot-record-dd-command/
Debian Wiki. (s. f.).GrubEFIReinstall. Wiki.Debian.org. https://wiki.debian.org/GrubEFIReinstall