themaddoctor / linux-mybook-tools

tools for opening some encrypted WD My Book drives in linux
GNU General Public License v3.0
182 stars 26 forks source link

Fail at create wd-layer1 /dev/sdb #29

Open awooooool opened 5 years ago

awooooool commented 5 years ago

when I try the "create wd-layer1 /dev/sdb" command, it says

"device-mapper: reload ioctl on failed: No such file or directory"

My drive is WD MyBook Essential 3TB with JMicron controller Any ideas? Thanks in advance

Edit: Now I got it to work, forgot to make the script in the appendix But when I try to mount it, it says

aulialuthfi@aulialuthfi-Lenovo-Y720-15IKB:~/wd$ sudo file -sL /dev/mapper/wd /dev/mapper/wd: DOS/MBR boot sector MS-MBR XP english at offset 0x12c "Invalid partition table" at offset 0x144 "Error loading operating system" at offset 0x163 "Missing operating system", disk signature 0x246c6; partition 1 : ID=0x7, start-CHS (0x10,0,1), end-CHS (0x3ff,0,1), startsector 256, 732558080 sectors aulialuthfi@aulialuthfi-Lenovo-Y720-15IKB:~/wd$ sudo kpartx -a /dev/mapper/wd aulialuthfi@aulialuthfi-Lenovo-Y720-15IKB:~/wd$ sudo mkdir -p /mnt/wd aulialuthfi@aulialuthfi-Lenovo-Y720-15IKB:~/wd$ sudo mount /dev/mapper/wd1 /mnt/wd mount: /mnt/wd: wrong fs type, bad option, bad superblock on /dev/mapper/wd1, missing codepage or helper program, or other error.

any ideas? thanks in advance

themaddoctor commented 5 years ago

Your partition table probably uses a different block size than your system. Try using the section about using a loop-back device.

Would you send me a copy of your keyblock, please?

awooooool commented 5 years ago

which one is the keyblock?

lemme try the loopback thing

Edit: Where should I put the keyblock?

fabianf83 commented 5 years ago

Hi there,

I also stuck on when I try the "create wd-layer1 /dev/sdb" "device-mapper: reload ioctl on failed: No such file or directory"

themaddoctor commented 5 years ago

post your keyblock here so I can see what you found

fabianf83 commented 5 years ago

00000000 57 44 76 31 94 07 00 00 00 88 df e8 00 00 00 00 |WDv1............| 00000010 00 00 00 00 00 00 f0 00 00 00 00 00 00 00 00 00 |................| 00000020 01 00 00 00 00 00 46 50 00 00 00 00 00 00 00 00 |......FP........| 00000030 00 02 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 20 00 37 96 00 00 00 01 00 00 00 00 57 44 76 31 | .7.........WDv1| 00000060 18 d9 11 54 7c 89 c1 3c c2 3b 9e 6a 4c da b9 39 |...T|..<.;.jL..9| 00000070 ef fa 2e 33 95 45 0e f7 98 58 fc a0 d4 2e f5 ec |...3.E...X......| 00000080 8b f9 fb 98 44 07 9e 68 6d f7 85 14 58 ea ed a8 |....D..hm...X...| 00000090 9e 4b a2 96 6a 1a 4d 27 4c b1 19 60 41 ee 5c 5b |.K..j.M'L..`A.[| 000000a0 e5 15 41 c4 ec fa a5 26 cc 47 9d 91 fd 30 44 33 |..A....&.G...0D3| 000000b0 5f cf f6 c6 2b 3e 7c 80 c3 94 ad b3 f1 4b 5a 07 |_...+>|......KZ.| 000000c0 14 82 19 ff 1e b0 7a 88 30 72 02 30 cd e5 7c 3d |......z.0r.0..|=| 000000d0 dc 5a 0a d4 52 b2 64 25 25 d3 9b 2d f8 c1 19 93 |.Z..R.d%%..-....| 000000e0 57 de e8 59 69 ca 8f d8 8a 22 ee 54 75 e0 39 2e |W..Yi....".Tu.9.| 000000f0 99 6d db 3c 0c fd 69 1f 69 8b d6 5c f8 55 e8 23 |.m.<..i.i...U.#| 00000100 5b 93 2d ec f9 ca d6 a4 cf 58 82 54 80 51 c4 7f |[.-......X.T.Q..| 00000110 a3 3b c8 7f 11 77 e8 de 5f 73 ff bb 96 57 20 56 |.;...w..s...W V| 00000120 7b d0 ff 6e fb fd 86 ba 7a 0c d0 23 a2 34 da c3 |{..n....z..#.4..| 00000130 42 6d 1d 9b 55 38 96 ca 14 cc d6 6b 28 65 3f 29 |Bm..U8.....k(e?)| 00000140 b8 79 7a fd 59 ec 3f cd 4f 2e 42 fb af 27 bb 6f |.yz.Y.?.O.B..'.o| 00000150 b7 58 c2 3b b7 ec 09 d4 15 38 b3 f3 81 df 22 e5 |.X.;.....8....".| 00000160 be d7 ee 5c e8 07 cc e4 f1 7b 11 70 2e 31 f7 95 |........{.p.1..| 00000170 4b c8 e9 2f 6f db 5a ac 34 2a c2 fc 70 1f d0 83 |K../o.Z.4*..p...| 00000180 5f d2 ea 4a 29 ec 99 be cf 81 5d a0 85 75 15 0a |..J).....]..u..| 00000190 1a 68 23 1e 2d 23 fc 8a 4d 24 16 04 d9 76 20 9d |.h#.-#..M$...v .| 000001a0 50 47 ff 1c 1f e2 7b 5f 21 a1 4e 77 21 90 37 fd |PG....{_!.Nw!.7.| 000001b0 f7 21 fb 21 05 9b b0 fa 45 71 8b 18 ff 03 5a f0 |.!.!....Eq....Z.| 000001c0 2c 42 97 5d ae 19 c3 34 2b a4 df 25 50 d9 7a 4a |,B.]...4+..%P.zJ| 000001d0 33 a5 8f 18 57 53 78 c0 08 24 2f 92 75 3f d6 c3 |3...WSx..$/.u?..| 000001e0 53 f5 9c ca f2 84 bf e1 ea 1b 3f a7 30 eb 1c d4 |S.........?.0...| 000001f0 bf 2f 91 ca 74 39 32 69 ab 48 6b 9e d8 9e 6e 1d |./..t92i.Hk...n.|

themaddoctor commented 5 years ago

That error could be because the rev16 module was not loaded, or /dev/sdb is the wrong drive, for example.

fabianf83 commented 5 years ago

thanks a lot for ur fast help problem was that rev16 module was missing.

if I try to mount the wd i get this error root@ubuntu:/home/ubuntu/Desktop/cppi-1.12/wd1# sudo kpartx -a /dev/mapper/wd root@ubuntu:/home/ubuntu/Desktop/cppi-1.12/wd1# sudo mkdir -p /mnt/wd root@ubuntu:/home/ubuntu/Desktop/cppi-1.12/wd1# sudo mount /dev/mapper/wd1 /mnt/wd mount: /mnt/wd: special device /dev/mapper/wd1 does not exist.

Also the loop device wont work root@ubuntu:/home/ubuntu/Desktop/cppi-1.12/wd1# sudo mount /dev/loop11 /mnt/wd mount: /mnt/wd: wrong fs type, bad option, bad superblock on /dev/loop11, missing codepage or helper program, or other error.

normaly it should NTFS FS

my knowign is at the end now -.-

themaddoctor commented 5 years ago

Send a dump of the first 2MB and I will look at it when I have some time. sudo dd if=/dev/sdb count=4096 out=dump.bin

Zip it and upload it here.

fabianf83 commented 5 years ago

Thank u here it is

dump.zip

themaddoctor commented 5 years ago

Looks OK to me. I decrypted it with the key that I extracted from your keyblock.

fdisk -l fabianf83-jms538s-start-decrypted.bin

Disk fabianf83-jms538s-start-decrypted.bin: 2 MiB, 2097152 bytes, 4096 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00021365

Device Boot Start End Blocks Id System fabianf83-jms538s-start-decrypted.bin1 2048 3906963455 1953480704 7 HPFS/NTFS/exFAT

fabianf83 commented 5 years ago

Okay, I dont Know what I made wrong. I rebooted and startet again. This time it was working. I can recover the Data now.

Just for ur information. With Ubunu I had problems with sudo apt-get build-dep linux-image-$(uname-r) GCC

both resources arn't available anymore. Thank u so much for ur help

themaddoctor commented 5 years ago

That's great. Glad it worked out.

Sorry it looked like I was shouting. Some markdown issue. I fixed my comment to be more friendly.

Could you add the version of Ubuntu you used? And the names of the packages that you did install? Thanks.

fabianf83 commented 5 years ago

Ubuntu 18.04.3 LTS

bash GNU coreutils util-linux sudo cryptsetup (in Ubuntu, use “sudo apt-get install cryptsetup”) openssl file kmod or modutils are included in Ubuntu alreadz

kernel development (may be called “kernel-dev”) (in Ubuntu, use “sudo apt-get build-dep linux-image-$(uname -r)”)

$ sudo apt-get build-dep linux-image-$(uname -r) Reading package lists... Done E: You must put some 'source' URIs in your sources.list

GCC (the same version that was used to build your kernel) $ sudo apt-get install GCC Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package GCC

vim (for the xxd utility) multipath-tools git (to clone the repostitory) *not named in your documentation Need to install and there was no problem with installation

best regards Fabian