meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| datarecovery:lvm [2023/01/27 07:45] – created niziak | datarecovery:lvm [2023/01/28 18:52] (current) – niziak | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| <code bash> | <code bash> | ||
| journalctl | grep 'dev sda, sector' | journalctl | grep 'dev sda, sector' | ||
| + | |||
| + | 82053408 | ||
| + | 85981440 | ||
| + | 85981536 | ||
| + | 85981544 | ||
| + | 85981552 | ||
| + | 85981560 | ||
| + | 85981568 | ||
| + | 85981696 | ||
| + | 85981704 | ||
| + | 85981712 | ||
| + | 85981720 | ||
| + | 85981728 | ||
| + | 85981736 | ||
| + | 85981744 | ||
| + | 85981752 | ||
| + | 85984832 | ||
| + | 85984840 | ||
| + | 85984848 | ||
| + | 85984856 | ||
| + | 85984864 | ||
| + | 85984872 | ||
| + | 85984880 | ||
| + | 85984888 | ||
| + | 85984896 | ||
| + | 85984904 | ||
| + | 85984928 | ||
| + | |||
| </ | </ | ||
| Line 19: | Line 47: | ||
| 40 51 08 a0 06 20 e5 Error: UNC 8 sectors at LBA = 0x052006a0 = 85984928 | 40 51 08 a0 06 20 e5 Error: UNC 8 sectors at LBA = 0x052006a0 = 85984928 | ||
| 40 51 80 80 06 20 e5 Error: UNC 128 sectors at LBA = 0x05200680 = 85984896 | 40 51 80 80 06 20 e5 Error: UNC 128 sectors at LBA = 0x05200680 = 85984896 | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | Disk /dev/sda: 111,79 GiB, 120034123776 bytes, 234441648 sectors | ||
| + | Disk model: KINGSTON SA400S3 | ||
| + | Units: sectors of 1 * 512 = 512 bytes | ||
| + | Sector size (logical/ | ||
| + | I/O size (minimum/ | ||
| + | Disklabel type: gpt | ||
| + | Disk identifier: 711FEF16-FBD0-45BB-BA56-52B93B733D8E | ||
| + | |||
| + | Device | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Calculate LVM position for bad sector '' | ||
| + | 85984896 - 1050624 = 84934272 | ||
| + | |||
| + | Get PE size <code bash> | ||
| + | |||
| + | LBA block (secotr) size is 512, so each PE takes 8192 sectors. | ||
| + | |||
| + | |||
| + | The same information you can found in: | ||
| + | <code bash> | ||
| + | # cat / | ||
| + | extent_size = 8192 # 4 Megabytes | ||
| + | # cat / | ||
| + | pe_start = 2048 | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | echo 84934272 / 8192 | bc | ||
| + | 10367 | ||
| + | </ | ||
| + | |||
| + | Region is used by thin provisioning: | ||
| + | |||
| + | pvdisplay -v -m | ||
| + | |||
| + | Physical extent 8128 to 24425: | ||
| + | Logical volume / | ||
| + | Logical extents 0 to 16297 | ||
| + | |||
| + | |||
| + | !!! DONT KNOW HOW TO REMAP LVM SECTORS | ||
| + | |||
| + | |||
| + | lvcreate -l1 pve -n bb85984896 / | ||
| + | |||
| + | |||
| + | ===== Zeroing sectors ===== | ||
| + | |||
| + | Confirm that sector read fails: | ||
| + | |||
| + | <code bash> | ||
| + | dd if=/dev/sda of=/ | ||
| + | hdparm --read-sector 85981696 /dev/sda | ||
| + | hdparm --write-sector 85981696 --yes-i-know-what-i-am-doing | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | 40 51 08 b8 06 20 e5 Error: UNC 8 sectors at LBA = 0x052006b8 = 85984952..85984959 | ||
| + | 40 51 08 b0 06 20 e5 Error: UNC 8 sectors at LBA = 0x052006b0 = 85984944..85984951 | ||
| + | 40 51 08 a8 06 20 e5 Error: UNC 8 sectors at LBA = 0x052006a8 = 85984936..85984943 | ||
| + | 40 51 08 a0 06 20 e5 Error: UNC 8 sectors at LBA = 0x052006a0 = 85984928..85984935 | ||
| + | 40 51 80 80 06 20 e5 Error: UNC 128 sectors at LBA = 0x05200680 = 85984896 | ||
| + | |||
| + | <code bash> | ||
| + | for i in {85984896..85985023}; | ||
| </ | </ | ||