2002-11-17 22:44:21

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: hexa minor number...

From: Marcelo Leal <[email protected]>

I have one linux file server, that serves filesystems to
some machines (FreeBSD, Solaris, windows and etc...).
My problem is the /dev filesystem. The freebsd wants to
create a /dev/da0s1e device with a hexa minor number (0x00020014),
and the linux machine write decimal (20).
Did you know how i fix this?

[Maybe your /dev/da0s1e was really da2s1e?]

My opinion is that linux truncate the numbers to "255" (8bits).
My linux filesystem is xfs. So, the filesystem supports....
If i could to write 13192 (decimal), i guess that it will work too.
But the linux do not do it.

Yes, that is an old problem. It requires a kernel patch.
Linux dev_t is split into 8+8 bits for major+minor.
FreeBSD uses 8+24.
Solaris uses 14+18.

There are plans to change Linux dev_t into 12+20, but things
will still fail (since FreeBSD has more minor bits and Solaris
has more major bits).

For some purposes it sometimes helps to mount /dev using NFS v2.

[NFS v3 transmits 2 32-bit integers with the mknod command.
NFS v2 used create instead of mknod, and stuffs major,minor
in the size field. For communication between FreeBSD and Solaris
that happens to work, since the 32-bit number is transferred as
a cookie.]

[stat and mknod form a channel between the user application
and the bits in the filesystem; unfortunately, under Linux
this channel truncates the values passed along; however, a
rather small patch makes Linux behave and leave a dev_t in peace;
if this is important for you I can dig up this old patch again,
or recreate it; even though the patch is small, some hassle is
involved - on the one hand, with a 32-bit dev_t you still have
problems with FreeBSD and Solaris (but using NFS v2 might help),
on the other hand, with a 64-bit dev_t you can handle all filesystems,
but if I recall correctly that required a new system call, and
recompilation of glibc]


Andries


Let me cc linux-kernel and Linus.
There is a feature freeze in 2.5. Probably that means that
this truncation of major and minor numbers will not be removed,
but it would still be interesting to hear what people say today.