I'm trying to manually create my own custom usb drive, with a bunch of iso files on it, and a partition for data. I used the instruction I put here to create my key, but to sum-up, I have done

  • a partition /dev/sda1 for data
  • a partition /dev/sda2 that has grub installed
  • a partition /dev/sda3 that contains my iso files in the folder linux-iso/

I put in the file grub2/grub/conf (on /dev/sda2) the following file :

insmod loopback
insmod iso9660

menuentry 'XUbuntu 16.04 "Xenial Xerus" -- amd64' {
          set isofile="/linux-iso/xubuntu-16.04.1-desktop-amd64.iso"
          search --no-floppy --set -f $isofile
          loopback loop $isofile
          linux  (loop)/casper/vmlinuz.efi locale=fr_FR bootkbd=fr console-setup/layoutcode=fr iso-scan/filename=$isofile boot=casper persistent file=/cdrom/preseed/ubuntu.seed noprompt ro quiet splash noeject --
          initrd (loop)/casper/initrd.lz

menuentry 'Debian 9.3.0 amd64 netinst test 3' {
          set isofile="/linux-iso/debian-9.3.0-amd64-netinst.iso"
          search --no-floppy --set -f $isofile
          loopback loop $isofile
          linux (loop)/install.amd/vmlinuz priority=low config fromiso=/dev/sdb3/$isofile
          initrd (loop)/install.amd/initrd.gz

This way, when I load ubuntu everything works great... But when I load debian it fails at the step "Configure CD-Rom", with the error:

Incorrect CD-ROM detected.
The CD-ROM drive contains a CD which cannot be used for installation.
Please insert a suitable CD to continue with the installation."

I also tried to mount /dev/sdb3 at /cdrom, but in that case I've an error on the next step:

Load installer components from CD:
There was a problem reading data from the CD-ROM. Please make sure it is in the drive.
Failed to copy file from CD-ROM. Retry?"

Do you know how to solve this problem?

Thank you!

  • just my 2 cents, I think grub must be on /dev/sda1, well at least this is what I have done and there is no problem, and whats the purpose of the usb? If you are trying to install debian perhaps you must pass some arguments to the installer and remember that these installer was not done to be launched that way, so matbe tweaking conf files inside the iso is required. Based on debian.org/CD/netinst you wont receive a fail like that. – riccs_0x Dec 11 '17 at 20:25
  • check here debian.org/releases/wheezy/amd64/ch04s03.html.en – riccs_0x Dec 11 '17 at 20:27
  • 1
    are you sure fromiso is still working with Debian stretch (== Debian 9.3) (note that @riccs_0x link refers to Debian wheezy)? Does maybe this help you: unix.stackexchange.com/questions/220239/… ? – Tomáš Pospíšek Dec 11 '17 at 22:11
  • @riccs_0x The problem with syslinux is that memtest seems to work only on non-UEFI system. Or if it's not the case, then I don't know why I get an error "Failed to allocate memory for kernel command line, bailing out" when I try it... – tobiasBora Dec 12 '17 at 1:15
  • 1
    @riccs_0x multiboot usb has the same problem with the debian netinstall. – tobiasBora Dec 13 '17 at 12:31

It seems that it isn't grub related or that your conf is at fault; it seems that it is Debian related, based on this article and citing textually:

Now the first time I tried to boot the most recent Debian installer this way, I ran into a bit of a problem. It turns out that the initrd that comes on the ISO itself does not contain the installer scripts you need to install from an ISO on a hard drive. It assumes you will boot only off a DVD or USB disk. Because of that, I discovered I had to download a different Debian installer initrd and put it on the rescue disk for things to work. I was able to find an initrd that worked here.

By here it means this file but in your case it should be this other file.
I suggest reading the full article and the parts about the issue. Good luck

| improve this answer | |
  • 1
    Great, that works perfectly! I'm just sad that there is no easy way to say in UEFI mode "just run the .iso as if it was a CD", but it's life. Thank you very much! – tobiasBora Dec 14 '17 at 18:15

I also received the error "Incorrect CD-ROM detected". The following kernel options, and trick to set the device worked for me.

probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"

menuentry "Debian stretch 9.4 amd64 net install" {
    set isofile="$bootdir/debian-9.4.0-amd64-netinst.iso"
    loopback loop $isofile
    linux (loop)/install.amd/vmlinuz boot=live config iso-scan/ask_second_pass=true iso-scan/filename=${imgdevpath}/${isofile}
    initrd (loop)/install.amd/initrd.gz
| improve this answer | |
  • Great idea too. – riccs_0x Jul 26 '18 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.