[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Which device did I boot from?



On Fri, 2007-06-22 at 19:37 +0200, Matus UHLAR - fantomas wrote:
> > Dallas Clement wrote:
> > > I'm trying to determine which device I booted Linux from at run-time.
> > > I'd like to obtain the boot device's major/minor numbers or at least
> > > it's name while executing an init script from initramfs.
> 
> why?
> 

I'm trying to run a custom Linux install script from initramfs.  I want
to avoid the possibility of mistakenly installing Linux over the top of
my boot device. :)  Hence, needing to know with certainty which device I
booted Linux from.

I'm trying to boot Linux from a USB drive on a system that may have
other USB, IDE, SCSI drives present, each of which could possibly have
GRUB/Linux already installed.

Ideally I would like to determine the root device without ever having
mounted any other devices.

If I know which is the boot device, I can present a menu of choices
excluding the boot device on which Linux can be installed which would
involve partitioning, formatting, and copying files.



Reply to: