问题
我有一个 2TB 外部硬盘,有 2 个分区(1.4TB 加密分区btrfs
和 500GB 分区exfat
)。
而且我无法挂载btrfs
分区,500GBexfat
就可以了。
语境
它的电缆或插座丢失了,所以如果我稍微移动它,它就会断开连接。
我正在将一些文件复制到btrfs
分区,在传输过程中它停止了,我可能不小心触摸或移动了驱动器或电缆。
为什么我要将数据保存在这样的驱动器上?因为我很愚蠢,应该丢失我的数据。
错误
我尝试挂载分区:
$ sudo cryptsetup luksOpen /dev/sdc1 mydata
Enter passphrase for /dev/sdc1:
$ sudo mount /dev/mapper/mydata /home/user/test
mount: /home/user/test: wrong fs type, bad option, bad superblock on /dev/mapper/mydata, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
$ dmesg
....
....
[ 5370.588850] EXT4-fs (dm-0): VFS: Can't find ext4 filesystem
[ 5370.589194] EXT4-fs (dm-0): VFS: Can't find ext4 filesystem
[ 5370.589569] EXT4-fs (dm-0): VFS: Can't find ext4 filesystem
[ 5370.610095] ISOFS: Unable to identify CD-ROM format.
[ 5370.610451] FAT-fs (dm-0): bogus number of reserved sectors
[ 5370.610454] FAT-fs (dm-0): Can't find a valid FAT filesystem
[ 5370.610953] hfs: can't find a HFS filesystem on dev dm-0
[ 5370.611440] hfsplus: unable to find HFS+ superblock
更新
我将在本节中添加任何询问的信息:
$ mount -t btrfs
// doesn't show the external drive partitions
$ btrfs filesystem show
// doesn't output anything
$ sudo file -sL /dev/mapper/mydata
/dev/mapper/mydata: data
$ sudo hexdump -C /dev/mapper/mydata | less
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010000 63 75 4c 3c 92 25 48 d0 ee 2a 51 52 dd 68 3e 61 |cuL<.%H..*QR.h>a|
00010010 97 11 4e ae cb 91 26 4b 76 95 4d 38 3c 78 a7 2a |..N...&Kv.M8<x.*|
00010020 7a 20 1c ce 5b 46 bd bd 71 e3 2d 3c 72 9c d4 d5 |z ..[F..q.-<r...|
00010030 b1 79 cb d2 30 d9 6d ca 13 01 4e 43 14 c6 99 7e |.y..0.m...NC...~|
00010040 d7 f9 47 ab b7 32 8a 4e 38 7b 73 7f a2 17 58 fc |..G..2.N8{s...X.|
00010050 a4 66 52 c6 5a 09 b1 b8 0a db cc 46 ef e8 17 7b |.fR.Z......F...{|
00010060 c9 c0 94 7a da 98 19 b6 1e 5e dc b5 c9 37 86 e5 |...z.....^...7..|
00010070 fb eb b4 ad 02 e5 36 72 3a b3 47 1e 0a 78 8c f8 |......6r:.G..x..|
00010080 d4 a7 83 cb be 9a dd c1 d0 f1 29 f0 47 78 5f f7 |..........).Gx_.|
00010090 31 27 85 e6 65 0d 11 55 0d 92 c5 0b ae f9 e6 67 |1'..e..U.......g|
000100a0 fd 1b ee 03 21 10 9e 73 76 1e 1c 39 ae 50 1c 41 |....!..sv..9.P.A|
000100b0 77 2f 42 e8 08 ce f9 e7 23 b6 5a 82 4e 6b 5d 03 |w/B.....#.Z.Nk].|
000100c0 01 ee 19 74 8a 31 00 25 54 c3 14 e6 eb 18 83 03 |...t.1.%T.......|
000100d0 33 a9 d1 d2 58 e9 5a f6 5c 3f 61 26 75 b0 c2 61 |3...X.Z.\?a&u..a|
000100e0 24 c5 c9 f3 dc 6b 3a f6 09 3d ce 5f 86 42 a2 d2 |$....k:..=._.B..|
000100f0 d9 d1 00 bb e0 f0 8f c1 f4 6b 93 51 1d 51 94 53 |.........k.Q.Q.S|
00010100 39 2d 43 94 da fc fb 9b b3 e2 75 cf 88 f0 1e c4 |9-C.......u.....|
00010110 5e 2f a9 8a f1 eb 88 55 17 c9 32 6d 21 d3 82 1f |^/.....U..2m!...|
00010120 59 4e 7a b9 18 0a 77 d4 62 19 65 54 62 af 9d bc |YNz...w.b.eTb...|
00010130 6f 45 7c 0a 2f a3 93 69 a6 27 29 8c 6f 1d d8 57 |oE|./..i.').o..W|
00010140 2a 83 60 e7 e3 cd 05 de 79 d7 51 b5 25 47 81 c0 |*.`.....y.Q.%G..|
00010150 b9 7d ab b7 e6 85 b8 85 e2 60 58 11 5f c3 78 30 |.}.......`X._.x0|
00010160 8c 10 1d d3 f4 cd 49 38 6b 25 c9 bf 47 47 d9 e5 |......I8k%..GG..|
00010170 15 65 42 e7 a9 87 4d 7a d5 11 64 5b cd 78 50 97 |.eB...Mz..d[.xP.|
00010180 38 eb 6c c6 5a ee 4b fe 6e 8f dc 84 88 a9 fa ea |8.l.Z.K.n.......|
00010190 47 f6 a0 00 44 8c 65 c4 7d 54 a1 a7 25 9d cd e0 |G...D.e.}T..%...|
000101a0 d9 7a 9e 10 ed b7 ae 68 05 7a 48 7b fa ae 5c 54 |.z.....h.zH{..\T|
000101b0 49 13 98 a2 56 b4 d1 16 56 67 11 07 f9 8a 4b dc |I...V...Vg....K.|
000101c0 68 10 37 40 92 e4 a1 f1 77 0a 91 ec 6a bd 09 f1 |[email protected]...|
000101d0 15 c3 5e 49 b9 0a 98 0d 40 4c a4 83 5e 54 af 75 |..^I....@L..^T.u|
000101e0 1b 9d ab 60 65 2e 50 10 cf f6 fc 6e 29 23 b8 48 |...`e.P....n)#.H|
000101f0 d2 e8 5b 79 26 ca ab f8 94 e4 91 19 ff 4f d9 e9 |..[y&........O..|
00010200 3d 74 a3 b9 fd ec 3d 43 a7 52 d3 c4 17 36 e7 24 |=t....=C.R...6.$|
00010210 3d e9 58 c0 0a dc 44 52 51 2d 7c 72 de 76 07 53 |=.X...DRQ-|r.v.S|
00010220 12 13 d1 18 20 54 7a ed 22 77 6d 86 b8 c6 fc 74 |.... Tz."wm....t|
00010230 c8 bb 8b b4 f0 60 d2 44 f4 a0 17 c0 d4 86 18 1c |.....`.D........|
00010240 f1 3a 08 de 0f d8 40 d7 2e 80 2e f4 4c 62 28 02 |.:[email protected](.|
00010250 0c 82 a8 42 6a 55 0a 53 9e af cc a3 2f 90 6f ad |...BjU.S..../.o.|
00010260 9a 8e ae d7 3a 57 07 b3 82 2c b9 50 dc 67 ee 4f |....:W...,.P.g.O|
00010270 48 f3 c8 8b 8c 43 dd d4 5a 00 df 31 79 3b 26 d0 |H....C..Z..1y;&.|
00010280 b3 b5 68 dc cf c4 a7 d6 c4 8b 00 12 f7 7a 80 c6 |..h..........z..|
// This is only the first page
$ sudo strings /dev/mapper/mydata | less
cuL<
M8<x
N8{s
Aw/B
\?a&u
S9-C
I8k%
`e.P
DRQ-|r
1y;&
n~EJ
j/t}
H>*c<
Ky@A
>oO~
[hTdX
9 ko
_k.V
i/T9
7`4N(B"~
@8"'
;0cu+
uo2Eqa
-}+U
,$!2
iOV&
b\`m'
]VRH
=j`A
hMPz
=[f+
Q$W3.
`d:&
\B,0
OH}u{
SyL(/
|>7l
d}1
-8%r-
>+yx!
){:!
hoS.
%f:;
// This is only the first page
$ sudo hexdump --skip 64M -C -n 512 /dev/mapper/mydata | less
04000000 2b 00 ee 8a d2 f3 fa ab e9 67 fe 27 12 57 8a b8 |+........g.'.W..|
04000010 91 4f e7 2c 41 59 79 9f f4 1b ac b0 0b 68 18 55 |.O.,AYy......h.U|
04000020 eb 62 c4 f1 41 63 95 91 f6 3d c0 4c 0b 37 02 36 |.b..Ac...=.L.7.6|
04000030 34 e0 f3 b4 5d 8b bd 1d 55 6b dc 4c c4 02 b3 2b |4...]...Uk.L...+|
04000040 6a 2f 74 50 00 76 d1 31 8e cc 4e 64 53 14 ff 61 |j/tP.v.1..NdS..a|
04000050 bf dc 48 94 6b 12 26 1e 36 68 c3 d1 aa 83 3d 15 |..H.k.&.6h....=.|
04000060 01 51 12 bb d8 44 f2 01 59 fe 61 30 20 46 9d 3b |.Q...D..Y.a0 F.;|
04000070 1e 3c 93 21 1c 89 26 7f a2 cf ab e1 1a 3e 58 b2 |.<.!..&......>X.|
04000080 00 a0 dd cb dc 44 ff 69 f4 63 d8 ee 55 15 7a 6b |.....D.i.c..U.zk|
04000090 cc 2a 15 9f 2f 0f a6 c7 e3 7d b7 40 d4 31 16 d8 |.*../....}[email protected]..|
040000a0 36 79 79 7d ca c5 7c b6 7e ab bf b8 1e 6c f3 41 |6yy}..|.~....l.A|
040000b0 aa ce bb 49 5e a8 c7 5a b3 fe 5b 73 ac ef f4 8b |...I^..Z..[s....|
040000c0 22 01 0e 3f 22 d8 da 9f 2d 86 fd e7 81 ab 78 1e |"..?"...-.....x.|
040000d0 dd 5c 61 c2 c2 0b 3e 0b 97 3d ae c9 c0 85 58 7f |.\a...>..=....X.|
040000e0 71 0b 20 4e 19 52 51 69 a0 be e2 41 bc 01 a0 ad |q. N.RQi...A....|
040000f0 cc fc 49 3f 16 2a f5 a5 ae 1d ca 22 65 75 df 56 |..I?.*....."eu.V|
04000100 b9 39 c2 20 8d 19 97 27 e5 ec c6 67 9f 53 e8 0d |.9. ...'...g.S..|
04000110 ed ff 25 16 a1 1f 0e 23 7f 5d 3b 8a 00 a2 33 94 |..%....#.];...3.|
04000120 6b 0d 7d d8 a7 81 45 4b 73 41 00 41 da 58 e2 14 |k.}...EKsA.A.X..|
04000130 0d 0c 37 bc 91 36 32 57 9f 03 f0 f8 26 2c c0 01 |..7..62W....&,..|
04000140 2e a4 ba 5b 28 35 8f 44 b9 5f b1 be 6f 5d 37 06 |...[(5.D._..o]7.|
04000150 d6 14 38 3d 3d 79 e0 30 16 3f 38 f5 78 e7 d5 c2 |..8==y.0.?8.x...|
04000160 37 9d 44 01 65 ce f7 31 d3 71 87 6c 33 bf 54 81 |7.D.e..1.q.l3.T.|
04000170 1a c0 37 c2 8b 32 19 42 b4 7b 16 c5 d3 52 a5 8b |..7..2.B.{...R..|
04000180 3d 1e 9e e5 e5 7e 7a b1 0d 1a fb 03 48 ae 97 05 |=....~z.....H...|
04000190 20 2b ce 99 61 85 da 30 ce a5 c6 21 b2 06 b7 f7 | +..a..0...!....|
040001a0 43 3d 18 d9 6e af df 05 5c 24 b9 be b2 fa dc 8e |C=..n...\$......|
040001b0 e6 2f 59 6c 30 6b ee b8 de 10 6d 82 0b 1e 71 14 |./Yl0k....m...q.|
040001c0 10 ef f5 10 d7 75 09 64 3a 6b f1 47 67 9f 2d 6a |.....u.d:k.Gg.-j|
040001d0 d1 73 d4 6c 73 bf 35 79 33 b8 30 f2 97 3b 08 6f |.s.ls.5y3.0..;.o|
040001e0 54 0f 38 ae 2c ea 94 c1 84 7a 8f 1d d7 69 5b e8 |T.8.,....z...i[.|
040001f0 4f 95 e8 de f0 cc d0 20 49 83 b8 15 27 05 72 4a |O...... I...'.rJ|
04000200
$ sudo hexdump -C /dev/sdc1 | less
00000000 4c 55 4b 53 ba be 00 01 61 65 73 00 00 00 00 00 |LUKS....aes.....|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 78 74 73 2d 70 6c 61 69 |........xts-plai|
00000030 6e 36 34 00 00 00 00 00 00 00 00 00 00 00 00 00 |n64.............|
00000040 00 00 00 00 00 00 00 00 73 68 61 32 35 36 00 00 |........sha256..|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 40 |...............@|
00000070 6b b3 a5 73 7a 87 ea e7 03 12 74 76 42 6b 2b c0 |k..sz.....tvBk+.|
00000080 1c e2 f3 60 1e d1 87 6d 54 5c 76 fe f7 87 a3 36 |...`...mT\v....6|
00000090 da 7c e7 79 ab bd ce 3a 6a 45 4a 39 73 2a 1e bf |.|.y...:jEJ9s*..|
000000a0 f5 83 bc eb 00 01 1f f6 36 35 36 62 31 31 62 38 |........656b11b8|
000000b0 2d 64 36 38 38 2d 34 62 62 66 2d 62 36 34 63 2d |-d688-4bbf-b64c-|
000000c0 66 64 33 63 61 62 30 32 64 36 64 31 00 00 00 00 |fd3cab02d6d1....|
000000d0 00 ac 71 f3 00 11 f5 14 90 05 11 44 d4 61 d2 57 |..q........D.a.W|
000000e0 60 f3 b1 f0 37 0e 65 57 fb c8 a2 e6 09 a3 d1 b1 |`...7.eW........|
000000f0 59 c2 66 22 79 b1 84 e3 00 00 00 08 00 00 0f a0 |Y.f"y...........|
00000100 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000120 00 00 00 00 00 00 00 00 00 00 02 00 00 00 0f a0 |................|
00000130 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000150 00 00 00 00 00 00 00 00 00 00 03 f8 00 00 0f a0 |................|
00000160 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000180 00 00 00 00 00 00 00 00 00 00 05 f0 00 00 0f a0 |................|
00000190 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 00 00 00 00 00 00 00 00 00 00 07 e8 00 00 0f a0 |................|
000001c0 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001e0 00 00 00 00 00 00 00 00 00 00 09 e0 00 00 0f a0 |................|
000001f0 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 0b d8 00 00 0f a0 |................|
00000220 00 00 de ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000240 00 00 00 00 00 00 00 00 00 00 0d d0 00 00 0f a0 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001000 42 d1 38 45 68 28 e8 ad 08 3f 2b de 72 6a 41 48 |B.8Eh(...?+.rjAH|
00001010 47 f3 3c bb 8b 95 40 5b 3d e9 c5 37 00 41 5d 3c |G.<...@[=..7.A]<|
00001020 f4 eb 35 90 29 79 4e a8 ca ff eb 85 f7 42 ec 81 |..5.)yN......B..|
00001030 c2 6c e0 2d d0 6b 5d 95 4b 43 e7 b3 62 d1 58 74 |.l.-.k].KC..b.Xt|
当要求确认输出时,我确实物理断开并重新连接了驱动器,并使用其他名称进行了测试,mydata
结果是相同的。
在一份不直接相关的说明中,我得到了好奇心,并测试了我电脑的另一个分区(在另一张磁盘上),该分区也已btrfs
加密,但未加密,结果如下:
$ sudo hexdump -C /dev/sda1 | less
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010000 7a 9f 1b a6 00 00 00 00 00 00 00 00 00 00 00 00 |z...............|
00010010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010020 d6 b9 03 49 28 83 47 2f 90 20 ab 6f 95 c7 05 26 |...I(.G/. .o...&|
00010030 00 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00010040 5f 42 48 52 66 53 5f 4d cb 01 00 00 00 00 00 00 |_BHRfS_M........|
00010050 00 80 10 e7 25 00 00 00 00 40 79 01 00 00 00 00 |....%....@y.....|
00010060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010070 00 00 b0 98 4f 00 00 00 00 60 f4 f6 27 00 00 00 |....O....`..'...|
00010080 06 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00010090 00 10 00 00 00 40 00 00 00 40 00 00 00 10 00 00 |.....@...@......|
000100a0 81 00 00 00 7f 01 00 00 00 00 00 00 00 00 00 00 |................|
000100b0 00 00 00 00 03 00 00 00 00 00 00 00 61 03 00 00 |............a...|
000100c0 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 |................|
000100d0 00 00 00 b0 98 4f 00 00 00 00 00 80 41 29 00 00 |.....O......A)..|
000100e0 00 00 10 00 00 00 10 00 00 00 10 00 00 00 00 00 |................|
000100f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00010100 00 00 00 00 00 00 00 00 00 00 00 71 2b f6 ab 7c |...........q+..||
00010110 2e 45 26 a3 88 95 5b a3 25 55 b9 d6 b9 03 49 28 |.E&...[.%U....I(|
00010120 83 47 2f 90 20 ab 6f 95 c7 05 26 44 6f 77 6e 6c |.G/. .o...&Downl|
00010130 6f 61 64 73 00 00 00 00 00 00 00 00 00 00 00 00 |oads............|
00010140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010230 00 00 00 cb 01 00 00 00 00 00 00 00 00 00 00 00 |................|
00010240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00010320 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 |................|
00010330 00 00 00 e4 00 00 50 01 00 00 00 00 00 00 80 00 |......P.........|
00010340 00 00 00 00 02 00 00 00 00 00 00 00 00 00 01 00 |................|
00010350 00 00 00 00 22 00 00 00 00 00 00 00 00 00 01 00 |...."...........|
00010360 00 00 01 00 00 10 00 00 02 00 01 00 01 00 00 00 |................|
00010370 00 00 00 00 00 00 50 01 00 00 00 00 71 2b f6 ab |......P.....q+..|
00010380 7c 2e 45 26 a3 88 95 5b a3 25 55 b9 01 00 00 00 ||.E&...[.%U.....|
00010390 00 00 00 00 00 00 d0 01 00 00 00 00 71 2b f6 ab |............q+..|
000103a0 7c 2e 45 26 a3 88 95 5b a3 25 55 b9 00 00 00 01 ||.E&...[.%U.....|
000103b0 00 00 00 00 00 22 00 00 00 00 00 00 00 00 00 01 |....."..........|
000103c0 00 00 00 01 00 00 10 00 00 02 00 01 00 01 00 00 |................|
000103d0 00 00 00 00 00 00 00 50 01 00 00 00 00 71 2b f6 |.......P.....q+.|
000103e0 ab 7c 2e 45 26 a3 88 95 5b a3 25 55 b9 01 00 00 |.|.E&...[.%U....|
000103f0 00 00 00 00 00 00 00 d0 01 00 00 00 00 71 2b f6 |.............q+.|
00010400 ab 7c 2e 45 26 a3 88 95 5b a3 25 55 b9 00 00 00 |.|.E&...[.%U....|
00010410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
// This is only the first page