Files
ext4recovery/test/jj.sh
2026-04-30 11:04:05 +00:00

22 lines
731 B
Bash

python3 -c "
# Read actual PERC metadata chunks - these are NOT zeros
# They're at every 5th chunk position on each physical disk
# For disk 0 (sda), metadata chunks are at:
# phys_byte = data_offset + group*5*CHUNK + 4*CHUNK
# i.e., chunk positions 4, 9, 14, 19... of each disk
CHUNK = 128*512 # 64KB
LV_START = 5120000*512
# Read first few metadata chunks from sda
with open('/dev/sda','rb') as f:
for chunk_num in [4, 9, 14, 19, 24]:
phys = LV_START + chunk_num * CHUNK
f.seek(phys)
data = f.read(512)
nonzero = sum(1 for b in data if b != 0)
print(f'sda metadata chunk {chunk_num}: '
f'phys={phys} nonzero={nonzero}/512 '
f'first8={data[:8].hex()}')
"