[Wylug-help] USB Flash: device numbers, filenames and grub
Dave Fisher
wylug-help at davefisher.co.uk
Mon Jan 29 14:48:18 GMT 2007
On Mon, Jan 29, 2007 at 08:49:17AM +0000, John Hodrien wrote:
> > On Sat, 27 Jan 2007, Dave Fisher wrote:
> >From what my experiments indicate, the personal udev rules are not yet
> >applied at the time when the kernel needs to mount the root filesystem
> >(or at least, when the kernel needs to know the filesystem device
> >address).
>
> If you're using an initrd then don't assume; tear it apart and look. It's
> either going to be a cpio archive or a ext2 filesystem, so poke around and
> see
> what it does.
Thanks John, I look into it.
I didn't really assume, I merely didn't know enough about intrds to guide me in
digging around inside one.
All the initrd documentation that I've found so far, says that the initrd's
/linuxrc normally determines how the root filesystem is mounted.
Or:
"If /linuxrc is not executed or when /linuxrc terminates, the normal
root file system is mounted." (initrd man page)
There is no linuxrc in any of the initrds that I've looked into.
However, http://en.wikipedia.org/wiki/Initrd says:
"Most initial root file systems implement "/linuxrc" as a shell script
and thus include a minimal shell (usually /bin/ash) along with some
essential user-space utilities (usually the BusyBox toolkit)."
I'm guessing (not assuming) from what I see in the extracted initrd,
that the busybox utilities have configuration and init files similar to
those in a normal linux filesystem.
For example, I can see an /etc/udev/rules.d/ directory in the initrd,
including a rules file which seems to assign device names as it might on
a normal filesystem.
Could I do any harm by adding my own rules file to that directory (as
Anne does for a normal system), then re-archiving the initrd and trying
to boot from it?
> >One possibility that occurred to me was that the suggested personal
> >rules file (/etc/udev/rules.d/10-local.rules) might not be loaded
> >sufficiently early for its rules to apply.
> >
> >Even if this were true, I'm not sure whether it is feasible to load it
> >earlier, and in a safe/reliable way.
> >
> >Does anyone know something about that?
>
> I'd be tempted to try and ignore it all together. If you use something that
> doesn't rely on consistent device naming then perhaps you'll have more
> success: LVM. Basically this scans available devices, rather than assuming
> their location.
The ability to scan 'available devices, rather than assuming their location'
does sound interesting, but I've barely the faintest idea about how I might use
it in this case.
What do you have in mind, i.e. how might it work?
If the booting kernel can scan LVMs for a device matching a root="" parameter
set in grub, what exactly would it be trying to match?
N.B. I realise that may be a big and/or utterly implausible, "if". I've simply
not got enough knowledge to deduce what you have in mind, hence the question
and the vague guess.
I've read incomplete snippets of documentation suggesting that Live CDs don't
require the booting kernel to be given a root="" parameter at all ... and that
the technique can be adapted to boot from a specific USB device rather than a
specific CDROM.
Does anyone know of some documentation that actually explains the process?
Dave
More information about the Wylug-help
mailing list