Re(2): info about /dev/root
Bill Maltby LFS Related
lfsbill at wlmcs.com
Mon May 13 14:13:26 PDT 2002
This is confirmation that Lech Pankowski's solution appears
to solve the problem of how to get what device is really root.
Furthermore, I can confirm that it works when operating within
an initial ramdisk environment and after the pivot_root is
done to remount the *real* root device as the new root, which is
where my concern had been.
I've cc'd lfs-dev in case it may have any use in the book proper.
Thank you Lech.
billm at wlmcs.com
On Thu, 9 May 2002, Bill Maltby LFS Related wrote:
> On Thu, 9 May 2002, Lech Pankowski wrote:
> > .......
> > > Another way to find the real root device might be:
> > >
> > > $ /usr/sbin/rdev
> > > /dev/ide/host0/bus0/target0/lun0/part2 /
> > Unfortunately, rdev only shows what *initial* root device was declared
> > when the kernel was built. What happens when lilo root= is applied? Is
> > it updated? I *think* so, but haven't checked. But worse, the actual
> > root can be changed during boot procedures and would not be reflected
> > via the rdev command.
> > Bill Maltby
> > billm at wlmcs.com
> > Man rdev says: "...With no arguments rdev outputs /etc/mtab line for
> > the
> > current root filesystem." Isn't it the filesystem actually mounted as
> > a root??
> Oh boy! I may have been wrong big-time! At byte offsets beginning at
> 504 in the kernel image, there's some info regarding swap, root device,
> initial ramdisk and whether to prompt for the initial ramdisk. At the
> time the kernel is built, this info is stashed there. It can be modified
> later as well. But you know that already.
> I presume that after lilo and any other procedures that modify the
> information has run, the disk image of the kernel will be static.
> Now you have brought to my attention something I had "glossed over"
> before. The "image" parameter is optional. If you don't give it,
> does it call the kernel asking for root dev? I hadn't thought of that
> before. I had always operated on the disk image when using rdev. If it
> does call the kernel, I think you're right. It could then issue a line
> (hopefully) equivalent to an mtab entry for the current root. I had it
> stuck in my head that it always went to the disk image of the kernel.
> It is *possible* it does this, but wouldn't make sense to me (now).
> I have several LFS bootable images images on my machines and an
> initrd that that lets me get a command prompt in /linuxrc. I will
> get in there and do some "pivot-root" operations and rdev and see
> what issues. It will be a couple days before I get to it.
> But, I think you have provided the solution we were looking for
> to find what the real mounted root device is.
> > Regards,
> > --
> > Leszek P.
> > (lpankowski at bia.computerland.pl)
> Bill Maltby
> billm at wlmcs.com
> Unsubscribe: send email to listar at linuxfromscratch.org
> and put 'unsubscribe lfs-support' in the subject header of the message
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message
More information about the lfs-dev