1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Peter Rajnoha 317fae4024
dev-type: detect mixed dos partition with gpt's PMBR
Detect when we have mixed dos partition with gpt's PMBR partition.

This is not a sane configuration, but detect it anyway, just in case
someone configures such partition layout manually and forcefully and
incorrectly defines one of the partition types to be the GPT's PMBR.

For example:

  ❯  fdisk -l /dev/sdc

  Device     Boot Start    End Sectors Size Id Type
  /dev/sdc1        2048  67583   65536  32M 83 Linux
  /dev/sdc2       67584 262143  194560  95M ee GPT

Before:
(The partition filter passes even though there's real existing dos
partition - the empty GPT PMBR overrides it.)

  ❯  pvcreate /dev/sdc
  WARNING: PMBR signature detected on /dev/sdc at offset 510. Wipe it? [y/n]:
  Wiping PMBR signature on /dev/sdc.
  Physical volume "/dev/sdc" successfully created.

With this patch applied:
(The GPT PMBR does not override the existence of the dos partition.)

  ❯  pvcreate /dev/sdc
    Cannot use /dev/sdc: device is partitioned
2024-10-03 09:55:36 +02:00
..
activate cleanup: typos in comments 2024-08-30 16:51:15 +02:00
cache cleanup: typos in comments 2024-08-30 16:51:15 +02:00
cache_segtype metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
commands cleanup: fix typos 2024-09-27 13:42:45 +02:00
config lvmlockd: configurable sanlock lease sizes on 4K disks 2024-09-27 17:59:03 -05:00
datastruct cleanup: eliminate unused assign 2021-03-11 00:18:01 +01:00
device dev-type: detect mixed dos partition with gpt's PMBR 2024-10-03 09:55:36 +02:00
display cleanup: typos in comments 2024-08-30 16:51:15 +02:00
error error: try with modprobe 2024-05-27 15:16:26 +02:00
filters cleanup: typos in comments 2024-08-30 16:51:15 +02:00
format_text metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
integrity metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
label cleanup: typos in comments 2024-08-30 16:51:15 +02:00
locking cov: potentially overflowing expression 2024-09-30 15:00:03 +02:00
log cov: annotate 2024-09-30 15:00:03 +02:00
lvmpolld cleanup: typos in logging 2024-08-30 16:51:15 +02:00
metadata lv_manip: handle swap devices in fs-related checks for lvreduce/lvextend 2024-10-02 13:31:54 +02:00
mirror metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
misc cleanup: typos in comments 2024-08-30 16:51:15 +02:00
mm memlock: use value of 0 to disable memory locking 2024-09-27 13:42:45 +02:00
notify cleanup: fix typos 2024-09-27 13:42:45 +02:00
properties cleanup: typos in comments 2024-08-30 16:51:15 +02:00
raid metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
report vdo: depcreate unused settings 2024-09-26 16:25:12 +02:00
snapshot metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
striped metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
thin metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
unknown metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
uuid cleanup: use _ for static var 2024-06-03 15:30:05 +02:00
vdo vdo: depcreate unused settings 2024-09-26 16:25:12 +02:00
writecache metadata: use lv_hash in segment-specific metadata parsing 2024-09-10 11:51:15 -05:00
zero const: _ops segtype handler 2024-05-04 01:01:57 +02:00
Makefile.in devices: factor common list functions 2022-11-07 11:38:46 -06:00