Stephen Powell wrote: ... > Yes, that is absolutely correct. An LDL- or CMS-format disk, > by definition, has one and only one partition, and it is > non-modifiable. By that I mean that the size and location > of the partition can only be changed by reformatting the disk > with a different block size, or for a CMS disk, by reserving > the disk if it has just been formatted by CMS, has not been written > to by Linux at all, and has not been reserved since formatting. > Other than that, the partition is non-modifiable. The partition > is writable. That is, you can create a file system or a > swap space on it. But the size and location of the one-and- > only-one partition cannot be changed. > > The end of the > metadata (treated like a VTOC) is, by definition, the block > which precedes the start of the first (and only) partition. > The start of the metadata is the first block (block 0). > The disk contains no free space, by definition. > Formerly, start was set to 24 and vtoc_end was set to 23, > hard coded. That is correct only for a block size of 4096, > and for a CMS format disk, only if it is not reserved. > >> If you really do want to use the start sector of partition #1, >> we can pursue that separately.
Thanks for all the explanation. It sounds like you really do want to use that p1 start sector number. You might want to use a new function to return that number, e.g., static PedSector partition_1_start_sector (const PedDisk *disk) { const PedPartition *part = ped_disk_get_partition(disk, 1); assert (part); const LinuxSpecific *arch_specific = LINUX_SPECIFIC (disk->dev); PedSector start = (part->geom.start * disk->dev->sector_size / arch_specific->real_sector_size / disk->dev->hw_geom.sectors); return start; } [Beware, I've just typed that in, and didn't test at all. It might not even compile. The computation is the same as the one done in the dasd_write loop. ] _______________________________________________ bug-parted mailing list bug-parted@gnu.org http://lists.gnu.org/mailman/listinfo/bug-parted