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

Stephen Powell zlinuxman at wowway.com
Thu Oct 28 19:02:59 UTC 2010


On Thu, 28 Oct 2010 12:26:00 -0400 (EDT), Jim Meyering wrote:
> Thank you.
> I confirmed that it applies and doesn't cause any trouble on x86_64/linux.
> I'll actually look at the code and make sure tests pass on an
> s390x next week, assuming I can get access.
> 
> Speaking of tests, can you outline a couple
> that will exercise some (more the merrier) of this new code?

I primarily use the print command for testing.  For example,
suppose that device number 0200 is /dev/dasda.  I would issue
the command

   parted /dev/dasda unit s print free

and compare the starting sector and number of sectors to the
output of

   cat /sys/bus/ccw/devices/0.0.0200/block/dasda/dasda1/start

and

   cat /sys/bus/ccw/devices/0.0.0200/block/dasda/dasda1/size

to check to see if parted is calculating the size of the
partition the same way as the Linux kernel does.  (Believe it
or not I found a bug in the Linux kernel this way about five
months ago.  See

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582281

for details.)  The key, of course, is to try as many different
combinations of DASD type (CKD and FBA), DASD format (CDL, LDL,
CMS non-reserved, and CMS reserved), and DASD driver (ECKD, FBA,
and DIAG) as possible.  Only the following combinations are supported
by the Linux kernel:

   DASD type     DASD format     DASD driver
   ---------     -----------     -----------
   CKD           CDL             ECKD
   CKD           LDL             ECKD
   CKD           LDL             DIAG
   CKD           CMS-NR          ECKD
   CKD           CMS-NR          DIAG
   CKD           CMS-R           ECKD
   CKD           CMS-R           DIAG
   FBA           CMS-NR          FBA
   FBA           CMS-NR          DIAG
   FBA           CMS-R           FBA
   FBA           CMS-R           DIAG

The DIAG driver can only be used when Linux for s390 is
running in a virtual machine under z/VM.  And the CMS DASD format
can only be created by the CMS operating system, which only
runs in a virtual machine under z/VM.  So nine of the eleven
combinations will require z/VM in some way to test them.

parted only supports the first combination for read-write operations.
The others are supported read-only.  By read-only I mean that
a new partition cannot be created, the pre-existing partition
cannot be deleted, and the pre-existing partition cannot be
moved or changed in size.  I do not mean
that write operations cannot be performed on the data in the
partition.  They can.  For example, a file system or swap space
can be created on the partition.

The other variant is the block size of the disk.  The block size
can be 512, 1024, 2048, or 4096.  With 11 combinations of
DASD type, DASD format, and driver times 4 possible block sizes
that yields 44 possible configurations for exhaustive testing.
And that does not take into account variations in the size of
the disk.

I have tested all combinations that do not involve the CDL
format, since I didn't touch that code.  One thing I did discover
during testing: it is essential to take the disk offline

   echo 0 >/sys/bus/ccw/devices/0.0.nnnn/online

where nnnn is the device number, and
bring it online again

   echo 1 >/sys/bus/ccw/devices/0.0.nnnn/online

after changing the block size of the disk.
Simply refreshing the operating system's view of the partition
table is not sufficient.  (Of course, all partitions on the
disk that are currently mounted must be unmounted before the
disk can be taken offline; but you wouldn't normally
re-format the disk while partitions are mounted anyway.
Similarly, any active swap spaces on the disk must be
deactivated before taking the disk offline.)

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





More information about the Parted-maintainers mailing list