is sysfs filesystem hardcoded to mount at /sys?

James Wilkinson james at westexe.demon.co.uk
Sat Dec 4 23:24:01 UTC 2004


Robert P. J. Day wrote:
>   is it mandatory that the sysfs filesystem always be mounted at /sys?
> that is, do all processes needing access to that filesystem invariably
> refer to /sys as its location?

Of course, those aren't necessarily the same thing. You should be able
to symlink /sys to where you've actually mounted it. Then everything
that expects sysfs to be mounted on /sys should still be able to find
the contents of sysfs. But you'd probably have to set this up in the
initrd: the symlink would need to be there *before* the main root fs is
mounted.

I'm also not sure that you've asked the right question. There probably
exists at least one program that needs access to sysfs that can be
configured to look somewhere else. But that's not good enough: you need
all programs that access /sys to invariably look elsewhere.

I don't think udev can be configured to look elsewhere, for one: I think
that's hard-coded. So you'd need to be able to create an old-fashioned
/dev for the system even to boot.

But I suspect that mounting sysfs elsewhere, even if you get the system
to boot, will cause hotplugging and a number of other systems either to
Not Work, or possibly have wierd bugs (sysfs is mounted, so I'll just
look ... oops!)

Why do you want to move it elsewhere?

James.

-- 
E-mail address: james | "The duke had a mind that ticked like a clock and,
@westexe.demon.co.uk  | like a clock, it regularly went cuckoo."
                      |     -- Terry Pratchett, Wyrd Sisters




More information about the fedora-list mailing list