Apaguei todos os arquivos em um /dev/sdb1
disco de 4 TB. Isso foi feito com o rsync --delete
comando.
Antes de ser interrompido, o rsync gravou cerca de 10 GB de dados.
Claro que não há instantâneo no disco.
O btrfs
sistema de arquivos foi montado na /home/user/Downloads
pasta.
Então eu queria saber se havia uma maneira de restaurar os dados.
Até agora (depois de desmontar meu disco), tentei:
- restauração btrfs:
btrfs restore -i /dev/sdb1 /mnt/RESTORE/
O que restaurou apenas os novos arquivos de 10 GB.
- O script btrfs-undelete que consigo fazer funcionar:
./btrfs.sh /dev/sdb1 /home/user/Downloads/* /mnt/RESTORE/
Resultado:
[...]
Trying root 3001138823168... (1096/1103)
Trying root 853360640... (1097/1103)
Trying root 50626560... (1098/1103)
Trying root 31309824... (1099/1103)
Trying root 31129600... (1100/1103)
Trying root 30900224... (1101/1103)
Trying root 30818304... (1102/1103)
Trying root 30408704... (1103/1103)
Didn't find 'home/user/D*/*
- Eu também tentei restaurar manualmente o arquivo com
btrfs restore -t 3001556484096 /dev/sdb1 /mnt/RESTORE/
:
parent transid verify failed on 3001556484096 wanted 96918 found 96231
parent transid verify failed on 3001556484096 wanted 96918 found 96231
parent transid verify failed on 3001556484096 wanted 96918 found 96231
Ignoring transid failure
ERROR: root [1 0] level 0 does not match 1
Couldn't read tree root
Could not open root, trying backup super
parent transid verify failed on 3001556484096 wanted 96918 found 96231
parent transid verify failed on 3001556484096 wanted 96918 found 96231
parent transid verify failed on 3001556484096 wanted 96918 found 96231
Ignoring transid failure
ERROR: root [1 0] level 0 does not match 1
Couldn't read tree root
Could not open root, trying backup super
parent transid verify failed on 3001556484096 wanted 96918 found 96231
parent transid verify failed on 3001556484096 wanted 96918 found 96231
parent transid verify failed on 3001556484096 wanted 96918 found 96231
Ignoring transid failure
ERROR: root [1 0] level 0 does not match 1
Couldn't read tree root
Could not open root, trying backup super
btrfs-find-root -a /dev/sdb1
saída :
Superblock thinks the generation is 96918
Superblock thinks the level is 1
[...]
Well block 3001381945344(gen: 94646 level: 0) seems good, but generation/level doesn't match, want gen: 96918 level: 1
Well block 3001359089664(gen: 94635 level: 0) seems good, but generation/level doesn't match, want gen: 96918 level: 1
Well block 853360640(gen: 94238 level: 0) seems good, but generation/level doesn't match, want gen: 96918 level: 1
btrfs rescue super-recover -v /dev/sdb1
saída :
All Devices:
Device: id = 1, name = /dev/sdb1
Before Recovering:
[All good supers]:
device name = /dev/sdb1
superblock bytenr = 65536
device name = /dev/sdb1
superblock bytenr = 67108864
device name = /dev/sdb1
superblock bytenr = 274877906944
[All bad supers]:
All supers are valid, no need to recover
Então qualquer ajuda será apreciada :)
Atualização 1:
Infelizmente, consegui restaurar apenas alguns arquivos corrompidos. Aqui está o que fiz seguindo o script btrfs-undelete .
- Obtenha cada ID para um
/tmp/ID
arquivo:
btrfs-find-root -a /dev/sdb1 2>&1 | grep ^Well | sed -r -e 's/Well block ([0-9]+).*/\1/' | sort -rn > /tmp/ID
- Restaurar tudo o que puder do ID:
for i in $(cat /tmp/ID) ; do mkdir /mnt/RESTORE/"$i"; btrfs restore -o -iv -t "$i" /dev/sdb1 /mnt/RESTORE/"$i" 2>&1; done
Acho que agora a única maneira é encontrar um software de recuperação de arquivos...