Skip to content

Instantly share code, notes, and snippets.

@liangx8
Last active April 24, 2017 19:28
Show Gist options
  • Save liangx8/6848565 to your computer and use it in GitHub Desktop.
Save liangx8/6848565 to your computer and use it in GitHub Desktop.
boot Linux ISO from hard disk
boot a Linux live/install ISO from hard disk
- Ubuntu 13.04
set root=(hd0,gpt3)
set isofile=/linux.iso
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile
initrd (loop)/casper/initrd.gz
boot
- Debian 7
set root=(hd0,gpt3)
set isofile=/linux.iso
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live config union=aufs noswap noprompt vga=788 ip=frommedia toram=filesystem.squashfs findiso=$isofile
linux (loop)/live/initrd.img
boot
- ARCH Linux
set root=(hd0,gpt3)
set isofile=/linux.iso
loopback loop $isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisobasedir=arch archisolabel=ARCH_201310 findiso=$isofile
initrd (loop)/arch/boot/x86_64/archiso.img
boot
archisolabel is depend on the label of CD
Actually, there still is a mount failure error when starting. That can be resolved by setup a loop device manually.
Assume archlinux.iso locate at /dev/sdb1
mkdir /hd
mount /dev/sdb1 /hd
losetup /hd/archlinux.iso /dev/loop0
# type exit to continue
exit
grub2 recuse mode
There is still way to save the system if grub2 can't find grub directory but it's exists your hard driver. Below code can recuse your system.
set root=(the partition that has grub directory)
set prefix=/grub directory
insmod normal
normal
# install gpt model
insmod part_gpt
@techno2088
Copy link

i'm trying to install arch from iso on harddisk
but it fails to launch with the same error device didn't show up after 30 secound....
when i try to execute losetup /hd/archlinux.iso /dev/loop0
i get error losetup /dev/loop0 failed to setup loop device inappropriate ioctl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment