Problém
Při pokusu o vytvoření fyzického svazku se zobrazí níže uvedená chyba
chyba:
# pvcreate /dev/mappper/mpath25 Device /dev/mappper/mpath25 not found (or ignored by filtering).
Problém lze libovolně reprodukovat následujícím krokem:
# pvcreate /dev/mappper/mpath25
Řešení
Při kontrole bylo zjištěno, že počáteční sektor nebyl vynulován.
# pvcreate /dev/mappper/mpath25 Device /dev/mappper/mpath25 not found (or ignored by filtering).
# fdisk -l /dev/mapper/mpath25 Disk /dev/mapper/mpath25 doesn't contain a valid partition table
To ukazuje, že na disku nebyl přítomen žádný prasat. Chcete-li získat další podrobnosti o chybě, můžete spustit příkaz pvcreate s podrobnou volbou „-vvv“:
# pvcreate -vvv /dev/mapper/mpath25 Processing: pvcreate -vvv /dev/mapper/mpath25 O_DIRECT will be used Setting global/locking_type to 1 Setting global/wait_for_locks to 1 File-based locking selected. Setting global/locking_dir to /var/lock/lvm metadata/pvmetadataignore not found in config: defaulting to n metadata/pvmetadatasize not found in config: defaulting to 255 metadata/pvmetadatacopies not found in config: defaulting to 1 Locking /var/lock/lvm/P_orphans WB _do_flock /var/lock/lvm/P_orphans:aux WB _do_flock /var/lock/lvm/P_orphans WB _undo_flock /var/lock/lvm/P_orphans:aux dm version OF [16384] dm status (253:11) OF [16384] /dev/mapper/mpath25: New preferred name ### indicates that it can find the device Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: size is 629145600 sectors Closed /dev/mapper/mpath25 /dev/mapper/mpath25: size is 629145600 sectors Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 Using /dev/mapper/mpath25 Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes /dev/mapper/mpath25: No label detected Closed /dev/mapper/mpath25 dm status (253:11) OF [16384] Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: size is 629145600 sectors Closed /dev/mapper/mpath25 /dev/mapper/mpath25: size is 629145600 sectors Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 Using /dev/mapper/mpath25 Opened /dev/mapper/mpath25 RW O_EXCL O_DIRECT Closed /dev/mapper/mpath25 /dev/mapper/mpath25: size is 629145600 sectors Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 /dev/mapper/mpath25: size is 629145600 sectors Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 dm status (253:11) OF [16384] Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: size is 629145600 sectors Closed /dev/mapper/mpath25 /dev/mapper/mpath25: size is 629145600 sectors Opened /dev/mapper/mpath25 RO O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 Using /dev/mapper/mpath25 /dev/mapper/mpath25: size is 629145600 sectors Setting devices/data_alignment to 0 Setting devices/default_data_alignment to 0 /dev/mapper/mpath25: Setting PE alignment to 128 sectors. /dev/mapper/mpath25: Setting PE alignment offset to 0 sectors. Opened /dev/mapper/mpath25 RW O_DIRECT Wiping /dev/mapper/mpath25 at sector 8 length 8 sectors /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 Set up physical volume for "/dev/mapper/mpath25" with 629145600 available sectors Scanning for labels to wipe from /dev/mapper/mpath25 Opened /dev/mapper/mpath25 RW O_DIRECT /dev/mapper/mpath25: block size is 4096 bytes Closed /dev/mapper/mpath25 Zeroing start of device /dev/mapper/mpath25 Opened /dev/mapper/mpath25 RW O_DIRECT Wiping /dev/mapper/mpath25 at sector 0 length 4 sectors /dev/mapper/mpath25: block
Poslední záznam ve výstupu ladění označující, že příčina je v oblasti nulování prvního sektoru.
Chcete-li implementovat řešení, proveďte následující kroky:
1. U celých diskových zařízení musí být vymazána pouze tabulka oddílů, což účinně zničí všechna data na tomto disku. To lze provést vynulováním prvního sektoru pomocí:
# dd if=/dev/zero of=bs=512 count=1.
2. Provedením pvcreate vytvořte fyzický svazek:
# pvcreate [device]
3. Migrujte řešení podle potřeby do jiných prostředí.