btrfs バックアップファイルがマウントされない - 無効なファイルシステムタイプ、無効なオプション、無効なスーパーブロック

btrfs バックアップファイルがマウントされない - 無効なファイルシステムタイプ、無効なオプション、無効なスーパーブロック

誤ってすべてのユーザーディレクトリファイルを削除しました。 GitHubにアップロードしていない重要なファイルやスクリプトがたくさんあります。私は教訓を得て、バックアップする必要があります。私はLinuxエコシステムに比較的新しい人です。どんな助けでも大変感謝します。ついています。 16時間 – 何か他のことを試してみてください。

image.ddデータ復旧パッケージを介してファイルを生成しました。testdisk

問題:このimage.ddbtrfsファイルをマウントできません。


すべてのステップ:

$ sudo file /home/image.dd
image.dd: BTRFS Filesystem sectorsize 4096, nodesize 16384, leafsize 16384, UUID=f3c3509c-fbe0-41d7-9af6-df1b3de1139c, 5435559936/103767080960 bytes used, 1 devices

image.ddファイルサイズ:

$ du -h /home/image.dd
90G /home/image.dd

注:残りのスペースが不足しています。たとえば、1GBほど残っています。

$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda            8:0    0 232.9G  0 disk  
|-sda1         8:1    0     1G  0 part  /boot
|-sda2         8:2    0  96.7G  0 part  
| `-cryptlvm 254:0    0  96.6G  0 crypt /
|-sda3         8:3    0  68.4G  0 part  /mnt/3
`-sda4         8:4    0  66.9G  0 part  /mnt/4
sr0           11:0    1  1024M  0 rom   

ブロックループデバイスを設定するには、Lostupを使用します。

$ sudo losetup -f /home/image.dd
$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0          7:0    0    89G  0 loop  
sda            8:0    0 232.9G  0 disk  
|-sda1         8:1    0     1G  0 part  /boot
|-sda2         8:2    0  96.7G  0 part  
| `-cryptlvm 254:0    0  96.6G  0 crypt /
|-sda3         8:3    0  68.4G  0 part  /mnt/3
`-sda4         8:4    0  66.9G  0 part  /mnt/4
sr0           11:0    1  1024M  0 rom   

コンテンツを評価して修正するためにブロックデバイスをインストールしましたが、エラーが発生しました。

$ sudo mount /dev/loop0 /mnt/backup
mount: /mnt/backup: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

注:ブロックデバイスを作成するためにkpartxも試しましたが、同じマッサージを受けました。

ここでエラーが発生します。

$ sudo btrfs check /dev/loop0
[1/7] checking root items
[2/7] checking extents
ERROR: block device size is smaller than total_bytes in device item, has 95611650048 expect >= 103767080960
ERROR: errors found in extent allocation tree or chunk allocation
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
Opening filesystem to check...
Checking filesystem on /dev/loop0
UUID: f3c3509c-fbe0-41d7-9af6-df1b3de1139c
found 5435559936 bytes used, error(s) found
total csum bytes: 5179888
total tree bytes: 127172608
total fs tree bytes: 113983488
total extent tree bytes: 6193152
btree space waste bytes: 21944841
file data blocks allocated: 5312581632
 referenced 5307400192

私はこれを試みます:

$ sudo mount -t btrfs -r -o /dev/loop0 /mnt/backup
mount: /mnt/backup: can't find in /etc/fstab.

$ cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/creepy
UUID=4ecde757-fcb5-479c-bdea-a5d2cfa3d072   /           btrfs       rw,relatime,space_cache=v2,subvolid=5,subvol=/  0 0

# /dev/sda1
UUID=4C90-DE53          /boot       vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 2

このコマンドを実行すると:

$ sudo testdisk /log /dev/loop0

以下は、いくつかの追加の詳細とtestdiskによって生成されたログファイルです。

$ cat testdisk.log
Failed to set locale, using default 'C'.


Mon Jul 31 04:42:45 2023
Command line: TestDisk /log /dev/loop0

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <[email protected]>
https://www.cgsecurity.org
OS: Linux, kernel 6.4.3-artix1-2 (#1 SMP PREEMPT_DYNAMIC Mon, 17 Jul 2023 15:17:04 +0000) x86_64
Compiler: GCC 12.2
ext2fs lib: 1.47.0, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.4
Hard disk list
Disk /dev/loop0 - 95 GB / 89 GiB - 186741504 sectors, sector size=512

Partition table type (auto): None
Disk /dev/loop0 - 95 GB / 89 GiB
Partition table type: None

Interface Advanced
   P btrfs                          0  186741503  186741504
     btrfs blocksize=4096, 95 GB / 89 GiB
Change partition type:
   P btrfs                          0  186741503  186741504
     btrfs blocksize=4096, 95 GB / 89 GiB

Interface Advanced
   P btrfs                          0  186741503  186741504
     btrfs blocksize=4096, 95 GB / 89 GiB
New options :
 Dump : No
 Align partition: Yes
 Expert mode : No

TestDisk exited normally.
```

ベストアンサー1

おすすめ記事