public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* Recover btrfs partition after accidental reformat
@ 2022-03-07 20:10 Emil
  2022-03-07 23:29 ` Chris Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Emil @ 2022-03-07 20:10 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I did a boo boo and reformatted my btrfs partition with NTFS (used the wrong /dev/sdX). It was a single drive with standard options (metadata dup, data single) and it was the only partition of the drive.

I have not written any data to the ntfs partition.

Is there any chance of data recovery? The only thing I found was a backup superblock:

[bluemond@BlueQ ~]$ sudo btrfs insp dump-su -s 2 /dev/sdh1
superblock: bytenr=274877906944, device=/dev/sdh1
---------------------------------------------------------
csum_type               0 (crc32c)
csum_size               4
csum                    0x69883d2a [match]
bytenr                  274877906944
flags                   0x1
                        ( WRITTEN )
magic                   _BHRfS_M [match]
fsid                    6dc337f5-2146-4aa5-a9c1-8faf1e2994c5
metadata_uuid           6dc337f5-2146-4aa5-a9c1-8faf1e2994c5
label
generation              7004
root                    436338688
sys_array_size          129
chunk_root_generation   7002
root_level              0
chunk_root              22020096
chunk_root_level        0
log_root                0
log_root_transid        0
log_root_level          0
total_bytes             2000397864960
bytes_used              125869297664
sectorsize              4096
nodesize                16384
leafsize (deprecated)   16384
stripesize              4096
root_dir                6
num_devices             1
compat_flags            0x0
compat_ro_flags         0x3
                        ( FREE_SPACE_TREE |
                          FREE_SPACE_TREE_VALID )
incompat_flags          0x341
                        ( MIXED_BACKREF |
                          EXTENDED_IREF |
                          SKINNY_METADATA |
                          NO_HOLES )
cache_generation        0
uuid_tree_generation    7004
dev_item.uuid           0c86cfd6-fc28-4f99-9b4a-6bd3546aa523
dev_item.fsid           6dc337f5-2146-4aa5-a9c1-8faf1e2994c5 [match]
dev_item.type           0
dev_item.total_bytes    2000397864960
dev_item.bytes_used     131021668352
dev_item.io_align       4096
dev_item.io_width       4096
dev_item.sector_size    4096
dev_item.devid          1
dev_item.dev_group      0
dev_item.seek_speed     0
dev_item.bandwidth      0
dev_item.generation     0



I tried using photorec, but the btrfs partition was pretty fresh and I had a ntfs partition with lots of data before that so it finds all kinds of data from the old ntfs partition.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-08 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07 20:10 Recover btrfs partition after accidental reformat Emil
2022-03-07 23:29 ` Chris Murphy
2022-03-08 22:20   ` Emil
2022-03-08 23:04     ` Chris Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox