5

I'm trying to install Ubuntu Server 20.04 on a remote server. Problem is, I cannot attach a USB drive and the hosting provider does not allow me to mount ISO images, all I have is a pre-installed Ubuntu system.

To launch the Ubuntu server setup I followed the instructions in this article to add a grub menuentry so I can boot from the Ubuntu Server ISO. Here's the menuentry:

menuentry "Ubuntu 20.04 ISO" {
   set isofile="/root/ubuntu-20.04.1-live-server-amd64.iso"
   rmmod tpm
   loopback loop (hd0,2)$isofile
   linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject toram
   initrd (loop)/casper/initrd
}

Now when I select this menu entry, the installer starts, creates a ramdisk, copies the contents of the ISO to memory and I get through the first few steps of the setup, until:

Guided storage configuration

well great, how did the setup fail to discover my hard drive?

when I switch to the terminal and run lsblk I see that sda clearly exists and that sda2 is still mounted at /isodevice - which is unexpected, since the ISO was already copied to ramdisk. umount /dev/sda2 returns "target is busy", but it works with the -l option.

Even then, I get the same error on the guided storage configuration page. What am I missing here? What would prevent the setup from detecting my hard drive, even though lsblk can see it?

update:

I tried it with the legacy installer, as suggested by @elder-geek, using this grub menuentry:

menuentry "Ubuntu 20.04 legacy server ISO" {
    rmmod tpm
    set root=(hd0,2)
    set isofile="/root/ubuntu-20.04.1-legacy-server-amd64.iso"
    loopback loop $isofile
    linux (loop)/install/vmlinuz boot=install iso-scan/filename=$isofile noeject toram
    initrd (loop)/install/initrd.gz
}

With this setup I can boot the legacy installer and walk through the first few steps, but then I get stuck because the installer can't mount the cd-rom drive it expects. Seems like the legacy installer does not support the toram option (unlike casper) and therefore I can't use it to run the installer from RAM, which is a strict requirement if I want to install from an ISO file on a file system that is going to be destroyed during setup.

update: tried it with the 20.10 installer, same issue. lsblk and parted can see my disk from the installer's command line, but the guided storage configuration fails. I'm running out of ideas here...

filed a bug report on launchpad now...

1
  • The version of subiquity in use may have bearing on this issue. You may be impacted by this bug or this one
    – Elder Geek
    Jan 5, 2021 at 22:03

7 Answers 7

5

This is the result of a bug that is over a decade old. The problem is that the ISO image is still mounted, although the installer is started with the toram option. The solution is to unmount the ISO, but there are two pitfalls here:

  1. you can't just umount, you have to detach the loop device first with losetup
  2. you have to do this before you do anything else in the installer. No, you can't even select your keyboard layout :/

As soon as you're on the first screen of the installer, switch to the terminal with F2, then enter

losetup -d /dev/loop0
umount /isodevice

exit the terminal with Ctrl+D and you're good to go.

1
  • I recently encountered this same issue on Ubuntu 22.04, booting directly from a FAT32 partition (extracted from the ISO) as described here. I found these steps were very helpful, but on the newer installer I had to use umount /cdrom -l instead. The -l was important because it was reporting the device as busy. I also had to manually edit the boot parameters to add toram to make sure the install partition was loaded into memory.
    – bjmc
    Jul 23, 2022 at 18:43
3

It appears that you have been impacted by this bug.

It's entirely feasible that you will be successful attempting to install via the legacy installer as a workaround as mentioned in this comment on [subiquity bug 1890651](https://bugs.launchpad.net/subiquity/+bug/1890651/comments/2

If that doesn't do the trick for you, start at the beginning.

  1. Check the hash of your ISO and insure that it matches. For 20.04 they are as follows:

    b45165ed3cd437b9ffad02a2aad22a4ddc69162470e2622982889ce5826f6e3d *ubuntu-20.04.1-desktop-amd64.iso 443511f6bf12402c12503733059269a2e10dec602916c0a75263e5d990f6bb93 *ubuntu-20.04.1-live-server-amd64.iso

If they don't match try to download the file again as it's been corrupted somehow.

Insure you don't have a hardware problem. Boot from live media and Test RAM and Storage for errors the syslog can be helpful here grep error /var/log/syslog as well as tools such as memtest86+ As you may know, Memtest86+ runs without an operating system. Therefore, you must have access to the GRUB menu in Ubuntu. Turn on or restart your system and hold down the ‘Shift’ key to access the GRUB menu. Choose memtest and run the test. Any errors will be reported and indicate RAM must be replaced.

4
  • the link to the legacy installer is broken but I managed to find it. Now my grub menuentry does not work anymore: error: file /casper/vmlinuz not found and indeed, the ISO does not contain a folder named /casper. How do I need to adjust the menuentry so I can boot from the legacy ISO?
    – Klamann
    Jan 7, 2021 at 10:28
  • oh jeez, the legacy installer does not know about the toram option and therefore I can't use it anyways
    – Klamann
    Jan 7, 2021 at 10:54
  • @Klamann which ISO are you attempting to install from? Did you check the hash on your ubuntu-20.04.1-live-server-amd64.iso? There's definitely a casper folder in the ISO
    – Elder Geek
    Jan 20, 2021 at 16:23
  • there's no casper folder in the legacy ISO, but I found a solution using the current installer (see accepted answer)
    – Klamann
    Jan 20, 2021 at 20:28
3

I know this is an old question. But since I ran into this issue recently. I would like to add my solution here. I had to embed my user-data into the ISO. Found this Tool to be helpful. I then added these lines in my user-data

early-commands:
  - losetup -d /dev/loop0
  - umount /isodevice

I then added the autoinstall into my kernel line.

linux (loop)/casper/vmlinuz boot=install iso-scan/filename=$isofile noeject toram autoinstall ds=nocloud\;s=/cdrom/nocloud/ ---
3

I had the same issue when trying to install Ubuntu 22.04 on a Dell Optiplex Micro.

Changing the SATA bios settings fixed it for me. Set the SATA operation to AHCI.

1
  • Had this same issue on a similar system and this worked for me - for some reason SATA settings were set to RAID by default. Jan 24, 2023 at 19:31
0

I had same issue when try install ubuntu 20.04 on Hp ProLiant dl380e gen8

I solved disabling on bios option dynamicSmart Array

https://downloads.linux.hpe.com/SDR/project/ubuntu-hpdsa/rbsu.jpg https://downloads.linux.hpe.com/SDR/project/ubuntu-hpdsa/

enter image description here

0

I had to go into my BIOS, Boot Options, and enable Legacy Mode for my hard disk. I could then install without any problems. This was on a fairly old HP Pavilion Laptop.

0

What worked for me is first installing an ubuntu desktop and then creating a bootable drive with ubuntu drive creator for the ubuntu server and installing it in place of the ubuntu desktop.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .