Skip to main content
deleted 40 characters in body
Source Link
jdwolf
  • 2.3k
  • 9
  • 13

Many live Linux distributions support iso loopback mounting during boot while GRUB supports loading Linux from within an ISO. Combine these and its possible to boot a live Linux iso just as a file. This should serve your requirements but be warned some don't support this or at least they do not officially support it.

First install GRUB to your USB drive:

Mount usb to mnt

mount /dev/sdb1 /mnt/usb

To install so legacy BIOS boots the USB use:

grub-install --target=i386-pc --boot-directory=/mnt/usb/boot /dev/sdb

For UEFI use:

grub-install --target=x86_64-efi --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable

if /mnt/usb/boot doesn't exist create it with mkdir then do:

grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg

Then edit /mnt/usb/boot/grub/grub.cfg with:

menuentry "Debian live ISO" {
  insmod loopback
  insmod iso9660
  set isofile="/debian.iso"
  loopback loop $isofile
  linux (loop)/install.amd/vmlinuz findiso=$isofile
  linux (loop)/install.amd/vmlinuz vga=788 -- quiet
  initrd (loop)/install.amd/initrd.gz
}

Many live Linux distributions support iso loopback mounting during boot while GRUB supports loading Linux from within an ISO. Combine these and its possible to boot a live Linux iso just as a file. This should serve your requirements but be warned some don't support this or at least they do not officially support it.

First install GRUB to your USB drive:

Mount usb to mnt

mount /dev/sdb1 /mnt/usb

To install so legacy BIOS boots the USB use:

grub-install --target=i386-pc --boot-directory=/mnt/usb/boot /dev/sdb

For UEFI use:

grub-install --target=x86_64-efi --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable

if /mnt/usb/boot doesn't exist create it with mkdir then do:

grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg

Then edit /mnt/usb/boot/grub/grub.cfg with:

menuentry "Debian live ISO" {
  insmod loopback
  insmod iso9660
  set isofile="/debian.iso"
  loopback loop $isofile
  linux (loop)/install.amd/vmlinuz findiso=$isofile
  linux (loop)/install.amd/vmlinuz vga=788 -- quiet
  initrd (loop)/install.amd/initrd.gz
}

Many live Linux distributions support iso loopback mounting during boot while GRUB supports loading Linux from within an ISO. Combine these and its possible to boot a live Linux iso just as a file. This should serve your requirements but be warned some don't support this or at least they do not officially support it.

First install GRUB to your USB drive:

Mount usb to mnt

mount /dev/sdb1 /mnt/usb

To install so legacy BIOS boots the USB use:

grub-install --target=i386-pc --boot-directory=/mnt/usb/boot /dev/sdb

For UEFI use:

grub-install --target=x86_64-efi --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable

if /mnt/usb/boot doesn't exist create it with mkdir then do:

grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg

Then edit /mnt/usb/boot/grub/grub.cfg with:

menuentry "Debian live ISO" {
  insmod loopback
  insmod iso9660
  set isofile="/debian.iso"
  loopback loop $isofile
  linux (loop)/install.amd/vmlinuz findiso=$isofile vga=788 -- quiet
  initrd (loop)/install.amd/initrd.gz
}
Source Link
jdwolf
  • 2.3k
  • 9
  • 13

Many live Linux distributions support iso loopback mounting during boot while GRUB supports loading Linux from within an ISO. Combine these and its possible to boot a live Linux iso just as a file. This should serve your requirements but be warned some don't support this or at least they do not officially support it.

First install GRUB to your USB drive:

Mount usb to mnt

mount /dev/sdb1 /mnt/usb

To install so legacy BIOS boots the USB use:

grub-install --target=i386-pc --boot-directory=/mnt/usb/boot /dev/sdb

For UEFI use:

grub-install --target=x86_64-efi --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable

if /mnt/usb/boot doesn't exist create it with mkdir then do:

grub-mkconfig -o /mnt/usb/boot/grub/grub.cfg

Then edit /mnt/usb/boot/grub/grub.cfg with:

menuentry "Debian live ISO" {
  insmod loopback
  insmod iso9660
  set isofile="/debian.iso"
  loopback loop $isofile
  linux (loop)/install.amd/vmlinuz findiso=$isofile
  linux (loop)/install.amd/vmlinuz vga=788 -- quiet
  initrd (loop)/install.amd/initrd.gz
}