I am in an installer (a linux in a ramdisk) and I want to eject the CD if it was what the BIOS originally booted from (you know, the boot order menu), is this information available somewhere in /proc ?

I'd really like to avoid relying on breadcrumbs in grub and kernel parameters if I can, so that people altering my work don't have to keep the breadcrumbs trail intact. I'm pretty sure this information is made available somewhere to the kernel.


You could identify the boot device using:

dmesg | grep -m1 BOOT_IMAGE

If root= is a UUID or /dev/[sh]d* it's probably booting from a hard disk. If it's a straight ramdisk it's probably a CD, although I'm not sure how a USB drive is represented.

  • what about a PXE boot, too? Thanks for your time.
    – nraynaud
    Sep 1 '18 at 4:06
  • Hmm, good question. I don't have a server set up to test.
    – Kevin
    Sep 1 '18 at 4:10
  • it's going to be a ramdisk too, it's almost like a CD
    – nraynaud
    Sep 1 '18 at 5:03

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.