USB stick update: Debian is back, plus GRML

In the previous post on the multi-boot usb stick, Debian had to be dropped, due to missing support of iso-loading in the Debian installer iso images. Thanks to helpful comments from Jonathan McDowell and private emails, we found a way around this. In addition to having again an installable Debian image, I also added GRML support.

multi-usb-disk

There are a few tricks necessary to get this going, though. Let us start with the easy part, grml:

Grml

Quoting from the home page of Grml

Grml provides an excellent selection of software packages for installation, deployment and system rescue. You’ll get sysadmin’s favourite tools. Choose between a x86 and an amd64 version depending on your needs or just grab the multiboot ISO grml96, providing 64bit and 32bit ISOs in one single place.

I went for the 64bit version Version 2014.11 (named “Gschistigschasti”, a typical Austrian expression for ‘fuss’), as most computers nowadays are anyway 64bit capable, downloaded the image file grml64-full_2014.11.iso, and saved it into my USB stick’s boot/iso/ directory, where there are already the other iso images.

Then, with the help of the Grml web page which provides guidance how to boot from ISO, I added the following entry to my grub.cfg:

submenu "GRML 2014.11 ---> " {
  menuentry "Grml Rescue System 64bit" {
        iso_path="/boot/iso/grml64-full_2014.11.iso"
        export iso_path
        loopback loop (hd0,1)$iso_path
        set root=(loop)
        kernelopts=" ssh=SOME_PASSWORD_HERE toram  "
        export kernelopts
        configfile /boot/grub/loopback.cfg
  } 
}

Note that if you add the ssh=SOME_PASSWORD_HERE part, an ssh server is started and the root login password will be set to SOME_PASSWORD_HERE, so choose it wisely (and different from your normal passwords!). If you don’t want a running ssh server, simply remove the ssh parameter.

That’s it, booting into Grml takes quite some time, but worked out nicely.

Debian Jessie installation

As mentioned in the previous post, booting Debian/Jessie installation images via any method didn’t work, since the iso images is never found. It turned out that the current installer iso images do not contain the iso-scan package, which is responsible for searching and loading of iso images.

But with a small trick one can overcome this: One needs to replace the initrd that is on the ISO image with one that contains the iso-scan package. And we do not need to create these initrd by ourselves, but simply use the ones from hd-media type installer. I downloaded the following four gzipped initrds from one of the Debian mirrors: i386/initrd text mode, i386/initrd gui mode, amd64/initrd text mode, amd64/initrd gui mode, and put them into the USB stick’s boot/debian/install.386, boot/debian/install.386/gtk, boot/debian/install.amd, boot/debian/install.amd/gtk, respectively. Finally, I added entries similar to this one (rest see the grub.cfg file):

submenu "Debian 8.0 Jessie NetInstall ---> " {
    set isofile="/boot/iso/firmware-8.0.0-amd64-i386-netinst.iso"
    menuentry '64 bit Install' {
        set background_color=black
        loopback loop (hd0,1)$isofile
        linux    (loop)/install.amd/vmlinuz iso-scan/ask_second_pass=true iso-scan/filename=$isofile vga=788 -- quiet 
        initrd   /boot/debian/install.amd/initrd.gz
    }
    ...
}

Again an important point, don’t forget the two kernel command line options: iso-scan/ask_second_pass=true iso-scan/filename=$isofile, otherwise you probably will have to make the installer scan all disks and drives completely, which might take ages.

With that in place, the stick now is back to full working, plus an added Grml. Thanks everyone for the suggestions.

15 Responses

  1. Brian Potkin says:

    Regarding the kernel command line options:

    1. iso-scan/ask_second_pass=true

    does a full disk search if an ISO image is not found first time round. Surely this will incease the scanning time? Also, the location of your isofile probably makes it unlikely to be used.

    2. iso-scan/filename=$isofile

    The templates file in the iso-scan udeb has

    Template: iso-scan/filename
    Type: text
    Description: for internal use only
    For use by other parts of d-i, such as base-installer

    I am really, really unsure this does what you think it does.

    • Hi Brian,
      thanks for all your comments. One thing I simply noticed is that without the two command line options, I have to do a *full* scan of all HDs, which is very painful on my big hd. On the other hand, if I add the above two options, only the devices are probed, and then after *very* short time the list of possible iso images is presented.

      So what I have written comes from experimentation 😉

      It might be that the iso-scan/filename part is not necessary (actrually, I, too have read through the source code a bit, and found that it is only used internally, but who knows).

      So I repeat: With these two options the iso images are found after scanning for devices and presented to the user for selection, while without the options they are not found and the dialog “scan all hds” is shown to the user.

  2. Brian Potkin says:

    Again regarding kernel command line options.

    iso-scan first determines what devices are available. It always must do this. It then presents a list of what it has found. You choose from the list but can help speed things up from the command line as follows.

    Find the UUID of the partition the ISO is on. e.g. blkid /dev/sdc1.

    Tell the installer you want to enter the device manually:

    shared/ask_device=manual

    Give the installer the device name:

    shared/enter_device=/dev/disk/by-uuid/A408-9C87

  3. Brian Potkin says:

    A minor point and not necessarily necessary.

    search –fs-uuid –set=root UUID

    allows

    loopback loop (hd0,1)$isofile

    to become

    loopback loop $isofile

  4. Brian Potkin says:

    It isn’t obvious why the kernel has to come from the ISO file and the initrd from hd-media. It would simplify the GRUB stanza if both were both from hd-media.

    • Convenience – I only need to download *one* file from somewhere else instead of two files. Of course one could use the whole hd-media infrastructure.

  5. Ralf says:

    Thanks a lot, this is very helpful! Being able to directly boot iso files is great. It would be even better if (like is the case for Grml) one would not have to copy part of the boot menu of the iso, to the stick… but I understand this requires additional supports for that from within the iso.

    I found the following command very helpful, which boots a USB key in Qemu:

    qemu-system-x86_64 -enable-kvm -drive file=/dev/sdX,format=raw -boot c -m 256

    However, I can’t seem to get GParted to work. When I boot it (both in Qemu and on real hardware), It shows:

    Loading, please wait…
    modprobe: Can’t load module crc32c_intel (kernel/arch/x86/crypto/crc32c-intel.ko): No such device
    modprove: module dm-raid45 not found in modules.dep

    And then it falls back to BusyBox, which complains

    /bin/sh: can’t access tty; job control turned off
    (initramfs) mount: mounting aufs on /root/ failed: No such device

    I copied the grub.cfg you provided, just updating the filename of GParted to

    set isofile=”/boot/iso/gparted-live-0.22.0-2-i586.iso”

    Both SystemRescueCD and Grml boot fine. Do you have any idea what could be the problem?

    (Btw, I had to use the Firefox Debugging tools and increase the height of the iframe to be able to even post this comment. The controls to enter the name etc. move out of the window…)

    • Ralf says:

      I now tried using the gparted-live-0.22.0-1-i586.iso file, and that files is working! I am getting some weird errors on boot, but gparted eventually comes up.

      However, gparted is already contained in the SystemRescueCD anyway, so it’s not such a big deal.

  6. ax says:

    Hey I was looking for a solution to this problem on Tails 1.4/debian and found your site.
    But still I wasn’t happy with your solution either and ended up finding the answer!
    I just used the iso as is and did the same they do on linux Mint Linux configuration…
    My config:

    set tailsiso=’/boot/tails-i386-1.4.1.iso’

    menuentry ‘Tails 64bit’ {
    loopback loop $tailsiso
    linux (loop)/live/vmlinuz2 findiso=$tailsiso iso-scan/filename=$tailsiso boot=live config live-media=removable apparmor=1 security=apparmor nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 splash noautologin module=Tails quiet
    initrd (loop)/live/initrd2.img
    }

    You just need to add findiso=$tailsiso AND iso-scan/filename=$tailsiso

    ;D

  7. Maddes says:

    Seems Debian 8.2.0 has this fixed again, got it working with

    set iso_path=’/iso’
    export iso_path
    #
    set iso_file=”${iso_path}/debian-live-8.2.0-amd64-lxde-desktop.iso”
    export iso_file
    #
    menuentry ‘Debian Live with LXDE Desktop’ {
    loopback loop “${iso_file}”
    linux (loop)/live/vmlinuz findiso=”${iso_file}” boot=live components quiet splash
    initrd (loop)/live/initrd.img
    }

    • Hi Maddes,
      that might be the case for the live cd you are using, but maybe not for the install mini image. But I will check it out. Thanks for the hint.

  8. Thomas says:

    Hi Norbert,

    you made my day!

    Got ‘devuan netinst iso’ working on my multiboot usb stick.

    Tried the hints above with ‘findiso’ from Maddes and ax. These does not work with ‘devuan netinst iso’. I assume ‘debian netinst iso’ will also not.

    Regards
    Thomas

    • You’re welcome! Yes, as far as I see the problem is persistent. I recently rebuilt my USB stick with new versions of Tails and new Debian installer, and needed to do the same tricks.

  1. 2015/05/31

    […] USB stick update: Debian is back, plus GRML […]

Leave a Reply

Your email address will not be published. Required fields are marked *