The Journey of Resolving Ubuntu Installer Issues ("stdin: Invalid argument")

By Kuberteas | Kuberteas Stories | 23 Nov 2024


Background

The Ubuntu installer as been causing issues for quite some time, I finally found the solution. This blog post describes the solutions found, as well as further troubleshooting information in case the issue doesn't resolve a reader who needs help.

Issue Logs

When the issue surfaces, the such logs are shown during the installer's boot sequence:

stdin: Invalid argument
stdin: Invalid argument
stdin: Invalid argument
[...]
stdin: Invalid argument
stdin: Invalid argument
Unable to find a medium container a live file system
Attempt interactive netboot from a URL?
yes no (default yes):

When looking inside the /casper.log file, I could observe such errors:

Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting.)

This means the installer failed to mount the hard-disk containing Windows and thus Ubuntu decided to abort (even though the installer is booting from an USB key).

Solution: Disable Windows Fast Boot

Assumption: Ubuntu decides to give up instead of ignoring/skipping the unmountable hard-drives.
Resolution: disable Windows' fast boot.

Steps:

  • 1. Boot into Windows
  • 2. In the Windows settings, go to "Power Options" > "Choose what the power buttons do" > uncheck "Turn on fast start-up"
    • Screenshots for this step: 
    • 08f11d46387faaee57fd85ab570e7b2f3f44945ae1e1a41ef62ee480a9c91a16.png
    • 8bd27af8221849acc1e345d1fa0037f37fb6f94984f581f195de887325b267d1.png
  • 3. Save the changes and reboot into the Ubuntu installer
  • 4. The installer should now work

Further Troubleshooting

If the solution didn't work, then try one or multiple solutions from this list:

  • 1. Check if more hard-drives are failing to be mounted or something else is wrong by looking at the installer logs:
    • When you see this message, enter no​, this will present to a initramfs​ shell (busybox):

      Unable to find a medium container a live file system
      Attempt interactive netboot from a URL?
      yes no (default yes):
      
    • Analyze the logs using this command: awk 'NR<=40{print $0}' /casper.log​

      1. This is the equivalent of running: head -n 40 /casper.log​
      2. head​ and tail​ commands are not available inside initramfs​ (highly minimal busybox variant)
      3. Note: file location may differ depending on the version (confirmed as valid for Ubuntu 24.04)
    • You should be able to see the errors and thus be able to find a solution for them.

  • 2. If you are using Rufus to create a bootable medium, ensure that:
    • You didn't enable persistency (must say "0 (No persistence)")
      • dcf2e24313b1e2fa9047d31426b3fd70c086cbcbb9f8db44b5e5a9df419b7c6a.png
    • You are using DD Mode instead of ISO Mode to flash the USB key.
  • 3. In the BIOS settings, try the following (you can revert them once Ubuntu is installed):
    • Make the USB key priority #1

      • Assumption: Ubuntu may try to mount the wrong storage medium during the installer's boot sequence (e.g., Windows' hard-disk instead of the USB key)
    • Make sure Legacy USB mode is enabled

    • Disable secure boot

    • Enable CSM boot

  • 4. Remove all hard-drives except the one you want to install Ubuntu into.
  • 5. As soon as you see "stdin: Invalid argument", immediately unplug and replug the USB key.
    • Note: it may be impossible to achieve depending on how fast the installer is.

How do you rate this article?

1



Kuberteas Stories
Kuberteas Stories

Blog posts surrounding technological adventures

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.