[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#447755: Minidisk support (was: Installation Question)

On 2009-12-24 at 10:56:59 -0500, Frans Pop wrote:
> Please send the replies for these questions to the BR instead of the list!

Replying to the bug report, per your request.

On 2009-12-24 at 10:56:59 -0500, Frans Pop wrote:
> If you can provide me with *exact* info I need and if you can reply 
> quickly, I may be able to add support for this.

I'll certainly try!

On 2009-12-24 at 10:56:59 -0500, Frans Pop wrote:
> If you could provide me with access to a system that has these disks 
> mounted that might work as well.

I personally wouldn't mind doing that, but management will not permit that.

On 2009-12-24 at 10:56:59 -0500, Frans Pop wrote:
> To start with:
> - What device name does such a partition have?
> - How could it be distinguished from a partitionable dasd?

The definitive documentation for this is in
"Device Drivers, Features, and Commands", which is available on the
Internet.  I'm not sure which version of that document corresponds to the
level of code that Debian is using, but to answer these questions just
about any version will do.  Here is one link that you can use, if you don't
already have a link to go on:


Devices supported by the dasd drivers all have a major node number of 94.
Four minor numbers are reserved for each dasd device, though not all of them
are necessarily assigned.  The first dasd device recognized will have a
device name of /dev/dasda and will have a minor number of 0.  Thus, (94,0)
is the (major,minor) pair assigned to the *device itself*.  A DASD device
may have up to three partitions, which take up the next three minor numbers.
So if the first dasd device recognized has its maximum number of three
partitions, (94,1), (94,2), and (94,3) would be the major and minor numbers
of the first, second, and third partitions, respectively, on that device.
The corresponding device names are /dev/dasda1, /dev/dasda2, and /dev/dasda3.

The second dasd device recognized has a (major,minor) pair of (94,4) for the
device itself, and up to three partitions, numbered (94,5), (94,6), and (94,7).
The corresponding device names are /dev/dasdb (device itself), /dev/dasdb1
(first partition), /dev/dasdb2 (second partition) and /dev/dasdb3 (third
partition).  Note that the second device recognized has a (major,minor)
pair of (94,4) in all cases.  It does not matter how many partitions the
first device actually has.  It may be zero partitions.  No matter.  The
second device still starts at (94,4).

The first 26 devices take up /dev/dasda through /dev/dasdz.  After that,
it does to two letters: /dev/dasdaa, /dev/dasdab, /dev/dasdac, ... /dev/dasdzz.
Then it goes to three letters: /dev/dasdaaa ... then finally to four:
/dev/dasdaaaa ... /dev/dasdnwtl.  This is a total of 262144 devices
supported (devices, not partitions).

The correspondence between Linux device names and s390 device numbers is
tricky.  I believe the "dasd" parameter passed to the dasd_mod
kernel module is processed left-to-right, if it exists, and Linux device names
and s390 device numbers are associated from there first.  After that, I believe it
scans the list of subchannels, in subchannel id order, picks out the
dasd devices, and assigns linux device names in that order.  But subchannel
id order and device number order are generally not the same.  In other
words, just because s390 device number 0200 corresponds to /dev/dasda
doesn't necessarily mean that s390 device number 0201 will correspond to
/dev/dasdb.  It could be anything.

In modern versions of the linux kernel, you don't need to issue mknod
commands to define these devices: udev does it for you.
udev also creates symbolic links to make it easy to refer to a device by s390
device number.  For example, if s390 device number 0200 corresponds to
/dev/dasda, and it has one partition, udev will create the following symbolic

cd /dev/disk/by-path
ln -s ../../dasda ccw-0.0.0200
ln -s ../../dasda1 ccw-0.0.0200-part1

Thus, /dev/disk/by-path/ccw-0.0.0200 is a symbolic link to /dev/dasda and
/dev/disk/by-path/ccw-0.0.0200-part1 is a symbolic link to /dev/dasda1.
udev only creates device nodes and symbolic links for devices and
partitions that actually exist.

When the kernel brings a device online, it tries to read the first few
blocks to determine the format.  If the read is unsuccessful, or if it
does not recognize the format, udev only creates a device name.  If
it recognizes one of the four supported formats: cdl, ldl, CMS non-reserved,
or CMS reserved, then it also creates one or more partition names.  cdl
is the only format that can have more than one partition.  The other
three formats, by definition, only have one partition.  In the case of
CMS reserved, the partition is created explicitly by the CMS RESERVE
command.  In the case of ldl and CMS non-reserved, the partition is implicit.

Note that, while you don't have the facilities to create CMS non-reserved
or CMS reserved disks, you *can* create ldl disks!  Just manually format the
thing prior to running the install with dasdfmt -d ldl.  If you can get the
code to work with a pre-formatted ldl disk, you're 95% done.

If there's anything else you need, please let me know.

Reply to: