Mostrando entradas con la etiqueta grub2. Mostrar todas las entradas
Mostrando entradas con la etiqueta grub2. Mostrar todas las entradas

31 may 2014

Establecer el inicio por defecto en Fedora 20 - GRUB2

Antes era todo tan facil con GRUB legacy... en fin, ahora para seleccionar la entrada por defecto en GRUB2 hay que hacer unos pasitos de mas, aca el paso a paso.

13 jun 2011

Recuperar grub2 teniendo en distintas particiones /boot y /

Me vi obligado a recuperar grub2 en una pc que tenia Linux Mint y le habian instalado Windows 7 luego, asi que borraron el MBR. Como encontre que todos los tuto estan mal, o solo hablan de tener una particion unica para todo Linux y muchos tenemos, como corresponde, el /boot apartado en ext2, decidi compartir como se hace correctamente. Esto es valido para Mint, Debian, Ubuntu, Fedora (usando grub legacy), ArchLinux, Gentoo, etc.

1)Booteamos en un LiveCD con Mint o Ubuntu o algo que posea grub2.
2)Ejecutamos esto al pie de la letra =>
-----------------------------------------------------------------------------
Abrimos un terminal
Ponemos sudo su para hacernos root si es que no lo somos.
fdisk -l para ver la particion de /boot y / en los /dev/sdaX

Luego:

mount /dev/sdaX /mnt (donde X es la particion /)

(Reemplazamos el /dev /dev/pts /proc y /sys por nuestro sistema virtual para luego hacerle un chroot y que quede completo)

mount --bind /dev /mnt/dev 
mount --bind /dev/pts  /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys  /mnt/sys

chroot /mnt   (cambiamos el / del live por nuestro / del disco ojo que todo lo que toquen cambiara el sistema instalado)

mount /dev/sdaX /boot   (donde X es el /boot real del disco, que previamente vimos con fdisk -l

grub-install --recheck /dev/sda (instalamos grub en el MBR)
update-grub2 (al estar en chroot mode, el / es nuestro sistema real, asi que genera un grub.cfg y detecta los sistemas Linux y Windows)

Resultado:

Generating grub.cfg ...
Found background image: linuxmint.png
Found Debian background: linuxmint.png
Found linux image: /boot/vmlinuz-2.6.38-2-686
Found initrd image: /boot/initrd.img-2.6.38-2-686
Found linux image: /boot/vmlinuz-2.6.32-5-686
Found initrd image: /boot/initrd.img-2.6.32-5-686
Found Windows 7 (loader) on /dev/sda1
done


Nota, para los que se pregunten que es --bind:

The bind mounts.
              Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is
                     mount --bind olddir newdir
              or shortoption
                     mount -B olddir newdir
              or fstab entry is:
                     /olddir /newdir none bind

              After  this  call  the same contents is accessible in two places.  One can also remount a single file (on a
              single file).

              This call attaches only (part of) a single filesystem, not possible submounts. The  entire  file  hierarchy
              including submounts is attached a second place using
                     mount --rbind olddir newdir
              or shortoption
                     mount -R olddir newdir

              Note  that the filesystem mount options will remain the same as those on the original mount point, and can‐
              not be changed by passing the -o option along with --bind/--rbind. The mount options can be  changed  by  a
              separate remount command, for example:

                     mount --bind olddir newdir
                     mount -o remount,ro newdir