[Parted-maintainers] Bug#578097: [parted-devel] Debian Bug #578097: No support for CMS-formatted disks

Stephen Powell zlinuxman at wowway.com
Mon Jun 7 15:12:30 UTC 2010


On Sat, 05 Jun 2010 05:51:52 -0400 (EDT), Jim Meyering wrote:
> Stephen Powell wrote:
>> Well, my paperwork just came through today for assignment of copyright.
>> And it's just in time.  Here is a link to my second round of enhancements.
>>
>>    http://www.wowway.com/~zlinuxman/parted/dasd_complete.diff
>>
>> These changes require my previous changes as a prerequisite.  Let me
>> know if you have any trouble with them.  The enhancement is
>>
>> * Support all valid combinations of DASD format (CDL, LDL, and CMS),
>>   DASD type (CKD and FBA), and DASD driver (ECKD, FBA, and DIAG) supported
>>   by the Linux kernel.  Only CDL format on CKD DASD using the ECKD
>>   driver is supported for read/write operations on partitions
>>   (create, delete, move, and resize).  For all other combinations
>>   of DASD format, DASD type, and DASD driver that are supported by the
>>   Linux kernel, parted recognizes the pre-existing implicit partition;
>>   but it does not allow that partition to be deleted, moved, or resized;
>>   nor does it allow the creation of another partition on that DASD device.
> 
> Hi Stephen,
> 
> Now that your paperwork has gone through and I've released parted-2.3,
> we can work on getting your changes committed.

Great!
> 
> Would you please outline a few sets of shell/parted commands
> that I can run on a dasd disk to exercise as much of this new
> code as possible?
> 

During development, I tested things primarily with the command

   parted /dev/dasde print free

This assumes that /dev/dasde is the device being looked at.  Substitute
the appropriate Linux device name as appropriate.  There are variables
in the /sys file system in the Linux kernel that can be used for comparison
purposes to see if parted is returning the same partition start and size as
the Linux kernel.  For example, if the device number is 0400 and the device
name is /dev/dasde, then the disk size can be examined by means of

   cat /sys/bus/ccw/devices/0.0.0400/block/dasde/size

the starting sector of the first partition can be examined by means of

   cat /sys/bus/ccw/devices/0.0.0400/block/dasde/dasde1/start

and the size of the first partition can be examined by means of

   cat /sys/bus/ccw/devices/0.0.0400/block/dasde/dasde1/size

(This testing was done using a 2.6.32 kernel and version 1.8.3 of s390-tools.)
The units used for measurement in all three of the above variables
are 512-byte pseudo-sectors, with the sectors numbered starting with zero.
Remember that parted reports output in decimal K (10**3), decimal M (10**6)
and decimal G (10**9); not binary K (2**10), binary M (2**20), or binary G (2**30).

The only other command that I issued was

   parted /dev/dasde print 1

but it was that command that brought my attention to the problems that
parted has with file systems.  I didn't touch the file system code,
only code related to recognizing partitions.  I got errors related
to file systems even on disk formats, such as CDL, that I didn't
touch.  Someone needs to look at that.

To summarize, here are all the supported combinations of dasd type,
driver, and disk format that parted now recognizes.  These are the
same combinations recognized by the Linux kernel.

Dasd type   Driver   Disk format        Type of support
=========   ======   ===========        ===============
CKD         ECKD     CDL                read-write*
CKD         ECKD     LDL                read-only*
CKD         ECKD     CMS non-reserved   read-only
CKD         ECKD     CMS reserved       read-only
CKD         DIAG     LDL                read-only
CKD         DIAG     CMS non-reserved   read-only
CKD         DIAG     CMS reserved       read-only
FBA         FBA      CMS non-reserved   read-only
FBA         FBA      CMS reserved       read-only
FBA         DIAG     CMS non-reserved   read-only
FBA         DIAG     CMS reserved       read-only

* supported by parted 2.2

read-write means that partitions can be created, deleted, moved, or resized,
and that up to three partitions may exist on the device.  read-only means
that the single pre-existing partition is recognized, but it cannot
be deleted, moved, or resized, nor can another partition be added.  read-only
does not mean that no write operations can be performed.  For example,
parted should be able to make a file system on the partition.  It just can't
alter the definition of the partition itself or create another partition.

Also, keep in mind that there is a bug in the kernel that keeps certain types
of devices from working properly.  To be specific, CMS reserved disks on FBA
DASD using the DIAG driver with a logical block size greater than 512 are
not properly recognized by the Linux kernel.  See Debian bug report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582281 for details.
Parted assumes that this kernel bug has been fixed.  There is a link
to a patch file for this kernel bug in the Debian bug report log.

> Thanks for all your work.
> 
> Jim

You're welcome.
> 
> P.S. Please excuse the high latency.
> I'll be available only sporadically for the next couple months.

OK.

-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-





More information about the Parted-maintainers mailing list