how can I determine the root device?

Dallas Clement dallas.a.clement at gmail.com
Thu Jun 21 07:40:31 PDT 2007


Hi Mike,  Thanks for the reply.  I guess what I am really trying to
determine is which device I booted Linux from.  Do you know of any way
to do that?  I am booting into initramfs and I would like to determine
the boot device major/minor numbers while running my init script.

On 6/20/07, Mike Frysinger <vapier at gentoo.org> wrote:
> On Wednesday 20 June 2007, Dallas Clement wrote:
> > Does anyone know of a way to determine the root device from which the
> > kernel has been booted?  I've heard of a utility called "rdev" which
> > will do this.  Just wondering if something like this is included in
> > busybox or if there is a way to determine this from files found in the
> > proc filesystem or something...
>
> rdev works by comparing the major/minor from stat("/") to the major/minor of
> the device nodes in /dev/
>
> depending on what you want to do, /dev/root may also work
> -mike
>
>


More information about the busybox mailing list