Use Lilo or grub to mount and boot from ISO


Recommended Posts

Well, I guess the title says it all. I saw some threads on other forums about using some boot files on a flash drive to mount and bot an ISO image from on the same drive.

I want to do this from a CF card in an SFF pc. I need to boot from the CF card, but the ISO is a bootable CD and is not yet written to boot from flash. It then occured to me that a bootloader like this could be very useful for booting from any cd imagewithout having to burn a CD. This could even be used on a harddrive with multiple images which can be upgraded simpley by replacing the ISO file.

Any thoughts?

Here are the threads I read:

http://damnsmalllinux.org/cgi-bin/forums/i...t=ST;f=5;t=4914

http://www.gibraltar.at/pipermail/gibralta...-June/002917.ht

Linux can mount an ISO image and treat it like a mounted device and read the files.

You just have to find some way to boot an intial kernel, if I am not mistaken. I believe what you are thinking of is very doable in Linux.

I am not very familiar with linux, yet, so this is a little over my head, but I did find this article about using grup to load and boot from a diskimage pulled from tftp, si it should be fairly similar.

http://www.faqs.org/docs/Linux-HOWTO/Clone-HOWTO.html

It is possible to boot from an ISO using GRUB/LILO, but there is an alternative way.

It envolves to make a previous extraction of the contents of the ISO to an HD partition.

This is the procedure that is most commonly used to boot Live CD's from HD without

the need to write them to a CD. Also running a LiveCD from HD, speeds up the system

as the access speeds from an HD are not compared with the ones that CD drives have.

Here's how to boot a LiveCD from HD (using grub, Knoppix [or knoppix based LiveCD iso] and a Linux system):

-create a mountpoint to mount the ISO with loopback:

mkdir /mnt/LiveISO

-mount the image:

mount -t iso9660 -o loop,ro /DOWNLOADS/Knoppix-3.7-en.iso /mnt/LiveISO

-create a directory on the device where you are going to boot from:

mkdir /mnt/hda4/KNOPPIX

-copy the contents of the mounted image to that directory:

cp /mnt/LiveISO/KNOPPIX/* /mnt/hda4/KNOPPIX/

-copy kernel and initrd files to yor boot device:

cp /mnt/LiveISO/boot/* /boot/

-edit the menu.list located in /boot/grub and add an entry like this to it:

title  KNOPPIX
root  (hd0,0)
kernel  /linux26 ramdisk_size=100000 fromhd=/dev/hda4
initrd  /minirt26.gz
savedefault
boot

using LILO should be like this:

image=/boot/linux26
        initrd=/boot/minirt26.gz
        label=KNOPPIX
        append="ramdisk_size=100000 fromhd=/dev/hda4"

This can also be done using an external device such as an USB storage device but GRUB

or LILO has to be installed on it. It can even boot from a win partition by using a floppy with LILO/GRUB

to boot it or adding an entry to the NT bootloader.

Works with all the LiveCD's based on Knoppix, DSL, SLAX... (the fromhd cheatcode of

SLAX is different from the one Knoppix uses).

Not direct boot from an ISO image but pretty usefull to test out a new LiveCD without the need

to burn it.

here's a page for more options using similar techniques:

http://www.knoppix.net/wiki/Hd_Based_HowTo

  • 5 months later...

Hey Lechio

I have also considered this option but I have about 30 live CDs and am looking for a way to dynalically list and select one of them at boot time, mainly for trying out and testing diffrent distros.

I have tried the qemu emulator, althoug it works well it is still a bit sluggish sometimes and sometimes the OS behaves diffrently on the actual Hardware

Any info will be apriciated :)

GX

It is possible to boot from an ISO using GRUB/LILO, but there is an alternative way.

It envolves to make a previous extraction of the contents of the ISO to an HD partition.

This is the procedure that is most commonly used to boot Live CD's from HD without

the need to write them to a CD. Also running a LiveCD from HD, speeds up the system

as the access speeds from an HD are not compared with the ones that CD drives have.

Here's how to boot a LiveCD from HD (using grub, Knoppix [or knoppix based LiveCD iso] and a Linux system):

-create a mountpoint to mount the ISO with loopback:

mkdir /mnt/LiveISO

-mount the image:

mount -t iso9660 -o loop,ro /DOWNLOADS/Knoppix-3.7-en.iso  /mnt/LiveISO

-create a directory on the device where you are going to boot from:

mkdir /mnt/hda4/KNOPPIX

-copy the contents of the mounted image to that directory:

cp  /mnt/LiveISO/KNOPPIX/*  /mnt/hda4/KNOPPIX/

-copy kernel and initrd files to yor boot device:

cp  /mnt/LiveISO/boot/* /boot/

-edit the menu.list located in /boot/grub and add an entry like this to it:

title ?KNOPPIX
root ?(hd0,0)
kernel ?/linux26 ramdisk_size=100000 fromhd=/dev/hda4
initrd ?/minirt26.gz
savedefault
boot

using LILO should be like this:

image=/boot/linux26
 ? ? ? ?initrd=/boot/minirt26.gz
 ? ? ? ?label=KNOPPIX
 ? ? ? ?append="ramdisk_size=100000 fromhd=/dev/hda4"

This can also be done using an external device such as an USB storage device but GRUB

or LILO has to be installed on it. It can even boot from a win partition by using a floppy with LILO/GRUB

to boot it or adding an entry to the NT bootloader.

Works with all the LiveCD's based on Knoppix, DSL, SLAX... (the fromhd cheatcode of

SLAX is different from the one Knoppix uses).

Not direct boot from an ISO image but pretty usefull to test out a new LiveCD without the need

to burn it.

here's a page for more options using similar techniques:

http://www.knoppix.net/wiki/Hd_Based_HowTo

585740612[/snapback]

  • 5 years later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I am not a US citizen nor a Trump fan. Respect to both left and right. But I will, for the sake of fun, predict something for my own. There will come a day when the US and China will collide like titans ( over Taiwan or anything else ). Then, on that day, some people in this comment section will realize how good an idea it was to become independent in areas like that. ( Or atleast try )
    • Microsoft Edge gets tons of security features, including AI model that can see your screen by Usama Jawad Microsoft Edge may not be the most popular browser out there, but it does receive quite frequent updates that sometimes bring surprising new features and axe others that are not as popular. Now, Microsoft has detailed some of the new security enhancements that it has introduced in Edge for Business, typically used by commercial customers. Microsoft has emphasized that security features are baked into Edge for Business and offer native integration with security and governance tools like Defender and Purview. Browser sessions are governed by default on managed devices but can also be governed through dedicated work profiles on unmanaged devices. An important aspect in this area is controlling the use of shadow AI. We have talked about this before, but it essentially restricts employees from using unsanctioned AI apps through data loss prevention (DLP) policies, with Edge redirecting them to trusted AI services like Microsoft 365 Copilot. This feature, available as a pay-as-you-go (PAYG) license, ensures that confidential data never exits AI boundaries set by your organization in Purview. Additionally, Microsoft also has strong DLP policies for contractors. Contractors leveraging a Entra ID-joined work profile provisioned by their contracting company on a device managed by their actual employer can be restricted from downloading files locally. In such scenarios, the file is saved on the contracting firm's OneDrive rather than being downloaded locally. Another useful Edge security feature disallows copying and pasting from unmanaged locations and apps. Similarly, DLP policies can be configured at a granular level to restrict screenshots or downloading of files from certain locations. In the same vein, IT admins can block the installation of extensions, hosted apps, themes and scripts, and control if users can install extensions from external locations. They can also enable the installation of specific extensions and allow users to request access to certain extensions, so that they can be managed on a case-by-case basis. Finally, Edge for Business now has an on-device AI model that uses computer vision to see what's on your screen and block potentially malicious content immediately. This does not rely on site reputation, as it simply monitors what is being displayed on your screen, which means that it is effective against malicious content that takes over your screen and employs scareware tactics. Since this is an on-device AI model, it does use your system's resources, so it's enabled by default only on devices with at least 2GB of RAM and four CPU cores. You can find more details in the Microsoft Mechanics video here.
    • Could you come up with a slightly less depressing background for Tux instead of that gray gradient? Doesn't have to be cheerful, just less of a downer...
    • Linux 7.2's first release candidate gets off to a good start by Paul Hill Credit: Larry Ewing It has been a few weeks since the release of Linux 7.1, and in that time, the Linux 7.2 merge window has been open, where developers can submit their features and patches ready for the upcoming release. That window is now shut, and the release candidate phase has begun so that new features can be tested and further fixes applied. According to the founder of Linux, Linus Torvalds, this week’s release candidate looks “reasonably normal”. Although we are super early in the release candidates, this is a good sign as it makes it more likely that an eighth release candidate will not be needed. Torvalds even mentioned that the update’s stats are only larger than they really are because there was another AMD header drop with a third of the patch just being AMD GPU register definitions, which aren’t big changes but make the code contributed look larger overall. In addition to this, he noted that just over half the patch is drivers, even when excluding the AMD register dump. The rest of the changes are spread out over architecture updates, tooling, documentation, and core kernel updates. In the next week, Torvalds says that he will be chilling out, taking the week “mostly off”. Despite this, he will be reading emails and keeping up with things, so if he is slow responding, now you know why. He said he is hoping for a calm week, but we will just have to see if the second release candidate is actually like that. We should expect seven or eight release candidates before Linux 7.2 is released, so expect it around the end of August. If you missed it a few weeks ago, be sure to check out our coverage of Linux 7.1's release.
    • Ridiculous claim that the labor cost difference of $6000 annually would increase cost per phone by $200. The employees produce 3 phones per month or what?
  • Recent Achievements

    • Dedicated
      Zeynel earned a badge
      Dedicated
    • One Month Later
      JKR earned a badge
      One Month Later
    • Dedicated
      Asgardi earned a badge
      Dedicated
    • Conversation Starter
      jessse3334 earned a badge
      Conversation Starter
    • Reacting Well
      JuvenileDelinquent earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      496
    2. 2
      +Edouard
      248
    3. 3
      PsYcHoKiLLa
      154
    4. 4
      Steven P.
      86
    5. 5
      macoman
      65
  • Tell a friend

    Love Neowin? Tell a friend!