martes, 12 de junio de 2012

Montar ISO en GRUB2

Desde el GRUB2 se pueden montar  imágenes ISO para arrancar diferentes sistemas "LIVE" sin instalarlos en el HD.
Como root editamos el archivo /etc/grub.d/40_custom y le añadimos las configuraciones que queramos.

Para hacer efectivos los cambios, utilizamos el comando update-grub2.

Este es el contenido de mi archivo /etc/grub.d/40_custom


#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Ubuntu 12.04-amd64" {
        set isofile="/ubuntu-12.04-dvd-amd64.iso"
        insmod ext2
        set root='(hd0,msdos3)'
        loopback loop (hd0,3)$isofile
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject quiet splash setkmap=es_ES
        initrd (loop)/casper/initrd.lz
}


menuentry "Ubuntu 12.04-precise" {
#       insmod ntfs #para cargar el sistema ntfs que es donde esta el archivo
        set isofile="/precise-dvd-amd64.iso"
        insmod ext2
        set root='(hd0,msdos3)'
        loopback loop (hd0,3)$isofile
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject quiet splash setkmap=es_ES
        initrd (loop)/casper/initrd.lz
}

menuentry "BT5R1"{
        set isofile="/BT5R1-GNOME-32.iso"
        insmod ext2
        set root='(hd0,msdos3)'
        loopback loop (hd0,3)$isofile
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject locale=es_ES bootkbd=es console-setup/layoutcode=es
        initrd (loop)/casper/initrd.lz
}
menuentry "Sabayon"{
        set isofile="/Sabayon_Linux_9_amd64_G.iso"
        insmod ext2
        set root='(hd2,msdos3)'
        loopback loop (hd0,3)$isofile
        linux (loop)/boot/sabayon root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=sabayon.igz isoboot=$isofile
        initrd (loop)/boot/sabayon.igz
}

menuentry "Archlinux-2011.08.19-netinstall-x86_64.iso" {
set isofile="/archlinux-2011.08.19-core-x86_64.iso"
loopback loop (hd0,3)$isofile
#linux (loop)/arch/boot/x86_64/vmlinuz boot=arch findiso=$isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201108 img_dev=/dev/sdc3 img_loop=$isofile earlymodules=loop
initrd (loop)/arch/boot/x86_64/archiso.img
}
menuentry "Fedora 17 Live" {
        set isofile="/Fedora-17-x86_64-Live-Desktop.iso"
        loopback loop (hd0,3)$isofile
        linux (loop)/isolinux/vmlinuz0 root=live:$isofile rootfstype=auto ro liveimg quiet rhgb rd.luks=0 rd.md=0
        initrd (loop)/isolinux/initrd0.img
}

No hay comentarios:

Publicar un comentario