I have dd-ed a btrfs partition (from a Jolla phone), as per some last resort instructions to have a safety copy of it (see: notes in Mer's Sailfish/Backup Device wiki page, ). Perhaps wrongly so, after reading the Btrfs Gotchas wiki page.
[updated]
I want to copy a few files from within the subvolume home
. Note, the files were not deleted. When I mount the subvolume of interest, I can navigate in directories and list files. However, every attempt to read or copy fails.
[updated] After dd
ing back the image to an empty micro-SD card (an attempt to see if the failure to copy files, i.e. cp: reading 'filename': Input/output error
, is due to what is mentioned
at http://superuser.com/a/793638/128768), as root, I do:
# list tree roots
btrfs restore -l /dev/sdc
tree key (EXTENT_TREE ROOT_ITEM 0) 46944256 level 2
tree key (DEV_TREE ROOT_ITEM 0) 35631104 level 0
tree key (FS_TREE ROOT_ITEM 0) 157016064 level 0
tree key (CSUM_TREE ROOT_ITEM 0) 82132992 level 2
tree key (QUOTA_TREE ROOT_ITEM 0) 67289088 level 0
tree key (UUID_TREE ROOT_ITEM 0) 32456704 level 0
tree key (259 ROOT_ITEM 0) 29503488 level 0
tree key (264 ROOT_ITEM 33) 116465664 level 2
tree key (265 ROOT_ITEM 34) 116400128 level 1
tree key (299 ROOT_ITEM 866702) 40960000 level 3
tree key (325 ROOT_ITEM 2361424) 119631872 level 2
tree key (327 ROOT_ITEM 2361546) 152805376 level 3
tree key (328 ROOT_ITEM 2361547) 84439040 level 2
tree key (DATA_RELOC_TREE ROOT_ITEM 0) 122241024 level 0
As per https://superuser.com/a/875265/128768, I do:
# mount the card
mount /dev/sdc /mnt/ddjolla
# enter in
cd /mnt/ddjolla/
# then, list subvolumes
btrfs subvolume list .
ID 259 gen 10 top level 5 path @swap
ID 264 gen 2361991 top level 5 path factory-@
ID 265 gen 2361991 top level 5 path factory-@home
ID 299 gen 2362013 top level 5 path @_old
ID 325 gen 2361991 top level 299 path @_old/factory-@
ID 327 gen 2484920 top level 5 path @
ID 328 gen 2484927 top level 5 path @home
# set default subvolume to one from which to revert files
btrfs subvolume set-default 328 /mnt/ddjolla
# unmount
umount /mnt/blah
Looks good so far. At this point,
# try to find root(s)
btrfs-find-root /dev/sdc
Superblock thinks the generation is 2484930
Superblock thinks the level is 1
whatever is on-going is too slow, consumes CPU resources and there is no sign of progress.
I "discovered", now, that likely the filesystem of the sdcard in which I directed the output file of dd
was a FAT one! (See comments in Q&A full phone backup guide in https://together.jolla.com/questions/) Likely this was a no-go (for files >4GB) and the most of the data, from the original partition, are lost (which, apparently, was >4GB). Is that so?
For the records, here another piece of info
btrfs check /dev/sdc
Checking filesystem on /dev/sdc
UUID: 0f8a2490-53ed-4ff6-ba34-b81df3430387
checking extents
checking free space cache
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 46130921472
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 47204663296
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 49352146944
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 50425888768
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 51499630592
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 52573372416
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 53647114240
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 54720856064
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 55794597888
btrfs: csum mismatch on free space cache
failed to load free space cache for block group 56868339712
checking fs roots
checking csums
checking root refs
checking quota groups
Qgroup is already inconsistent before checking
Counts for qgroup id: 265 are different
our: referenced 38080512 referenced compressed 38080512
disk: referenced 38080512 referenced compressed 38080512
our: exclusive 38002688 exclusive compressed 38002688
disk: exclusive 4096 exclusive compressed 4096
diff: exclusive 37998592 exclusive compressed 37998592
found 9357398016 bytes used err is 1
total csum bytes: 8866964
total tree bytes: 264663040
total fs tree bytes: 237322240
total extent tree bytes: 14561280
btree space waste bytes: 79581505
file data blocks allocated: 9901109248
referenced 8732901376
Is there anyway to troubleshoot this one and do btrfs restore -r ...
as described in the reference answer? If not, and likely this is the case, perhaps this may serve as a useful mistake to avoid similar ones in the future.
No comments:
Post a Comment