My motherboard burned. After getting a new motherboard and attaching the disks, recovering a failed PV fails, because the hard disk size has decreased.
# pvcreate --test --uuid "wcUYiJ-ULvA-YcLK-xlLM-qTof-uCD4-u2p0FH" --restorefile /etc/lvm/backup/home-vg /dev/sda
TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
WARNING: Couldn't find device with uuid wcUYiJ-ULvA-YcLK-xlLM-qTof-uCD4-u2p0FH.
Device /dev/sda excluded by a filter.
Now the PV doesn't fit the disk any more. I know that the disk has shrunk not only from PVM backup file, but also I have an output from fdisk before the disaster. Earlier fdisk reported disk size was 9.1 TiB, now it shows:
# fdisk -l /dev/sda
Disk /dev/sda: 8,19 TiB, 9000659811328 bytes, 17579413694 sectors
Disk model: WDC WD100EFAX-68
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sda1 1 4294967295 4294967295 2T ee GPT
Partition 1 does not start on physical sector boundary.
The partiton table of the disk is also corrupt. The correct partiton table should look like this:
Disk /dev/sdd: 9,1 TiB, 10000831348736 bytes, 19532873728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: E965D649-FADC-4450-BB9A-EA0B7E6191DE
Device Start End Sectors Size Type
/dev/sdd1 2048 671090687 671088640 320G Linux filesystem
/dev/sdd2 671090688 19532873694 18861783007 8,8T Linux filesystem
# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.5
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Disk /dev/sda: 17579413694 sectors, 8.2 TiB
Model: WDC WD100EFAX-68
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): E965D649-FADC-4450-BB9A-EA0B7E6191DE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 2048, last usable sector is 19532873694
Partitions will be aligned on 2048-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 2048 671090687 320.0 GiB 8300
2 671090688 19532873694 8.8 TiB 8300
How to proceed? I would like to preserve as much data as possible, of course.