[parted-devel] [PATCH] libparted/dasd: improve lvm/raid flag handling for DASD-CDL
Wang Dong
dongdwdw at linux.vnet.ibm.com
Mon Apr 24 02:11:36 UTC 2017
On 04/21/2017 08:47 PM, Phil Susi wrote:
> On 4/20/2017 10:07 PM, Wang Dong wrote:
>> But the flag cannot be read with the presence of the filesystem previously.
>> That's why the change.
> How so? The flag is in the partition table. What data is written to
> the partition has nothing to do with the flag. Whether you have a
> filesystem or not, the flag is still there in the partition table.
>
▷ ▷ if ((strncmp(PART_TYPE_RAID, str, 6) == 0) &&¶
451▷ ▷ (ped_file_system_probe(&part->geom) == NULL))¶
452▷ ▷ ▷ ped_partition_set_flag(part,
PED_PARTITION_RAID, 1);¶
453▷ ▷ else¶
454▷ ▷ ▷ ped_partition_set_flag(part,
PED_PARTITION_RAID, 0);¶
455¶
456▷ ▷ if ((strncmp(PART_TYPE_LVM, str, 6) == 0) &&¶
457▷ ▷ (ped_file_system_probe(&part->geom) == NULL))¶
458▷ ▷ ▷ ped_partition_set_flag(part,
PED_PARTITION_LVM, 1);¶
459▷ ▷ else¶
460▷ ▷ ▷ ped_partition_set_flag(part,
PED_PARTITION_LVM, 0);¶
Maybe I did not put it clearly. The flag is on the partition table. But
it cannot be read with a filesystem existence.
The code above is from libparted/labels/dasd.c, function dasd_read(),
master branch.
As I also tested it, with a filesystem, when I set the flag in
interactive mode, I can read the flag with "print".
But I can not get it after I re-read the device. And I can verify the
flag's existence with other tool.
If I set the flag in script mode, I cannot read the flag either. That
means user cannot see the flag, although it exists.
If I missed something, please let me know. Thanks in advance.
>> Nothing goofy. Just the property of the lvm/raid. Because when to
>> make a partition to lvm/raid, the filesystem will be ripped out.
> Not by parted it won't. We just update the partition table, and it is
> up to the user to mess with the filesystem. If they don't run pvcreate
> on the partition after setting the lvm flag, then the filesystem is
> still there and works just fine. These flags simply don't matter in
> practice, and so I never bother setting them even though I do use raid
> and lvm.
>
--
Best regards. Wang Dong
More information about the parted-devel
mailing list