yet another header reconstruction question
A message that is not in the archive (sent off-list or not yet received): [email protected]
@Michael , Arno , Sven :
Thanks for your replies and the help you are offering . Thats real support compared to experience with QNAP support ;-)) I *can* login as root to the QNAP box - but I am not a shell guru .
I hope I will be able to unlock my LUKS Copntainer without losing my Data .
I used the graphical GUI of QNAP which offered this possibility to add a disk to an existing RAID , e.g. I clicked a Button named "Add hard drive" in the RAID Management Section , selected the newly added disk, and waited for the desaster to complete
(german slang : mausi klickibunti ) .
Somehow the command output was written to the Device and not elsewhere (/dev / null or shell )
Quoted 2 lines · Michael
What was the exact device layout?
Physical storage then MD RAID
Yes. I have the box not at my desk here. Sorry.
Quoted 1 line
then LUKS
At least I found a corrupted LUKSHeader there in /dev/md0
Quoted 1 line
then some file system,
I hope so , thats where my data lives .
YESS Sir
Quoted 2 lines
or physical storage then LUKS then MD RAID
then some file system, or some other arrangement?
No
Quoted 1 line
What was the exact command used to "add a disk"?
QNAP may know it , I not. I didnt find anything in dmesg / kernel log or elsewhere .
From the best of my limited knowledge as I interpret the findings when I login as root in the cli , I see the RAID created with mdadm as built dirctly on the disk partitions sd[d|e|f|g|h|c]3
where /dev/sdc is the disk I added .
the raid itself is up with all disks , (all disks 'U' ) , valid / valid superblock I can get and read data from the block device /dev/md0
as you have seen in my last email.
@ Arno :
Quoted 2 lines
What did you do?
Did you pipe the output from mdadm into/dev/md0?
No.
Quoted 3 lines
If so, there might be a chance to recover this.
First, make that header backup now, if you have not already.
I have at least the first 64 MB of /dev/md0 extracted with dd if=/dev/md0 of=of=file_with_first_64_MB_of_md0 bs=1024 count=65535 The hex Dump was extracted from this .
I hope that is enough for a header backup (approx. 2MiB + xxx as stated in the FAQ) ?
Quoted 1 line
The data that is missing depends on the QNAP device.
SS839 PRO
Quoted 1 line
Defaults can be changed on compile.
I only have binaries , no sources , no compiler
Quoted 7 lines
Easiest option is
likely to make a new LUKS container on it and try what is in there. You should be able to use the loop-device procedure from FAQ Item 2.6 from the commandline for that. If those values do not work, next option is to have the QNAP create a LUKS container on a new disk and see what it does.
I'll try it that weekend or next when I have time to do it .
@Sven :
Quoted 2 lines
btw: I agree, if just the short output of mdadm was written to the disk chances are quite good for recovery.
I hope so. I tried dd on files to replace the first 512 bytes of a file , but the target file was completely replaced with this command :
dd if=512_bytes_with_fixed_header of=file_with_first_64_MB_of_md0 bs=512 count=1
Now I dont know if dd's behaviour is different on block device level , or is there another better way to replace / correct the first bytes of /dev/md0 ?
Greetings , Florian
On 18 Feb 2016 09:51 +0100, from [email protected] (Florian Dotzer):
Quoted 1 line
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><br/>
Please resend as not HTML.
Quoted 88 lines
@Michael , Arno , Sven :<br/>
<br/>
Thanks for your replies and the help you are offering . Thats real support compared to experience with QNAP support ;-))<br/> I *can* login as root to the QNAP box - but I am not a shell guru .<br/>
I hope I will be able to unlock my LUKS Copntainer without losing my Data .<br/>
<br/>
I used the graphical GUI of QNAP which offered this possibility to add a disk to an existing RAID ,<br/>
e.g. I clicked a Button named "Add hard drive" in the RAID Management Section ,<br/>
selected the newly added disk, and waited for the desaster to complete<br/>
<br/>
(german slang : mausi klickibunti ) .<br/>
<br/>
Somehow the command output was written to the Device and not elsewhere (/dev / null or shell )<br/>
<br/>
Michael wrote :<br/>
> What was the exact device layout?<br/>
> Physical storage then MD RAID<br/>
Yes. I have the box not at my desk here. Sorry.<br/>
<br/>
> then LUKS<br/>
At least I found a corrupted LUKSHeader there in /dev/md0<br/>
<br/>
> then some file system,<br/>
I hope so , thats where my data lives .<br/>
<br/>
YESS Sir<br/>
<br/>
> or physical storage then LUKS then MD RAID<br/>
>then some file system, or some other arrangement?<br/>
No<br/>
<br/>
>What was the exact command used to "add a disk"?<br/>
QNAP may know it , I not. I didnt find anything in dmesg / kernel log or elsewhere .<br/>
<br/>
From the best of my limited knowledge as I interpret the findings when I login as root in the cli ,<br/>
I see the RAID created with mdadm as built dirctly on the disk partitions sd[d|e|f|g|h|c]3<br/> <br/>
where/dev/sdcis the disk I added .<br/>
the raid itself is up with all disks , (all disks 'U' ) , valid / valid superblock<br/>
I can get and read data from the block device /dev/md0<br/>
as you have seen in my last email.<br/>
<br/>
<br/>
<br/>
@ Arno :<br/>
<br/>
> What did you do?<br/>
> Did you pipe the output from mdadm into /dev/md0?<br/>
No.<br/>
> If so, there might be a chance to recover this.<br/>
<br/>
> First, make that header backup now, if you have not already.<br/>
<br/>
I have at least the first 64 MB of/dev/md0extracted with dd if=/dev/md0 of=of=file_with_first_64_MB_of_md0 bs=1024 count=65535<br/> The hex Dump was extracted from this .<br/>
I hope that is enough for a header backup (approx. 2MiB + xxx as stated in the FAQ) ?<br/>
<br/>
> The data that is missing depends on the QNAP device.<br/>
SS839 PRO<br/>
> Defaults can be changed on compile.<br/>
I only have binaries , no sources , no compiler<br/>
> Easiest option is<br/>
> likely to make a new LUKS container on it and try what<br/>
> is in there. You should be able to use the loop-device<br/>
> procedure from FAQ Item 2.6 from the commandline for<br/>
> that. If those values do not work, next option is to<br/>
> have the QNAP create a LUKS container on a new disk<br/>
> and see what it does.<br/>
<br/>
I'll try it that weekend or next when I have time to do it .<br/>
<br/>
<br/>
@Sven :<br/>
<br/>
>btw: I agree, if just the short output of mdadm was written to the disk<br/>
>chances are quite good for recovery.<br/>
<br/>
I hope so. I tried dd on files to replace the first 512 bytes of a file , but<br/>
the target file was completely replaced with this command :<br/>
<br/>
dd if=512_bytes_with_fixed_header of=file_with_first_64_MB_of_md0 bs=512 count=1<br/>
<br/>
Now I dont know if dd's behaviour is different on block device level ,<br/>
or is there another better way to replace / correct the first bytes of/dev/md0?<br/>
<br/>
<br/>
Greetings , Florian<br/>
</div></div></body></html>
Signature · 3 lines
Michael Kjörling • https://michael.kjorling.se • [email protected] “People who think they know everything really annoy those of us who know we don’t.” (Bjarne Stroustrup)
Florian,
While at it (resending in plain text) make sure to include the output of lsblk if possible. This should give us an idea of the layout as currently being used.
Regards
-Sven
Am 18.02.2016 um 10:34 schrieb Michael Kjörling:
Quoted 94 lines
On 18 Feb 2016 09:51 +0100, from [email protected] (Florian Dotzer):
Quoted 1 line
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><br/>
Please resend as not HTML.
Quoted 88 lines
@Michael , Arno , Sven :<br/>
<br/>
Thanks for your replies and the help you are offering . Thats real support compared to experience with QNAP support ;-))<br/> I *can* login as root to the QNAP box - but I am not a shell guru .<br/>
I hope I will be able to unlock my LUKS Copntainer without losing my Data .<br/>
<br/>
I used the graphical GUI of QNAP which offered this possibility to add a disk to an existing RAID ,<br/>
e.g. I clicked a Button named "Add hard drive" in the RAID Management Section ,<br/>
selected the newly added disk, and waited for the desaster to complete<br/>
<br/>
(german slang : mausi klickibunti ) .<br/>
<br/>
Somehow the command output was written to the Device and not elsewhere (/dev / null or shell )<br/>
<br/>
Michael wrote :<br/>
> What was the exact device layout?<br/>
> Physical storage then MD RAID<br/>
Yes. I have the box not at my desk here. Sorry.<br/>
<br/>
> then LUKS<br/>
At least I found a corrupted LUKSHeader there in /dev/md0<br/>
<br/>
> then some file system,<br/>
I hope so , thats where my data lives .<br/>
<br/>
YESS Sir<br/>
<br/>
> or physical storage then LUKS then MD RAID<br/>
>then some file system, or some other arrangement?<br/>
No<br/>
<br/>
>What was the exact command used to "add a disk"?<br/>
QNAP may know it , I not. I didnt find anything in dmesg / kernel log or elsewhere .<br/>
<br/>
From the best of my limited knowledge as I interpret the findings when I login as root in the cli ,<br/>
I see the RAID created with mdadm as built dirctly on the disk partitions sd[d|e|f|g|h|c]3<br/> <br/>
where/dev/sdcis the disk I added .<br/>
the raid itself is up with all disks , (all disks 'U' ) , valid / valid superblock<br/>
I can get and read data from the block device /dev/md0<br/>
as you have seen in my last email.<br/>
<br/>
<br/>
<br/>
@ Arno :<br/>
<br/>
> What did you do?<br/>
> Did you pipe the output from mdadm into /dev/md0?<br/>
No.<br/>
> If so, there might be a chance to recover this.<br/>
<br/>
> First, make that header backup now, if you have not already.<br/>
<br/>
I have at least the first 64 MB of/dev/md0extracted with dd if=/dev/md0 of=of=file_with_first_64_MB_of_md0 bs=1024 count=65535<br/> The hex Dump was extracted from this .<br/>
I hope that is enough for a header backup (approx. 2MiB + xxx as stated in the FAQ) ?<br/>
<br/>
> The data that is missing depends on the QNAP device.<br/>
SS839 PRO<br/>
> Defaults can be changed on compile.<br/>
I only have binaries , no sources , no compiler<br/>
> Easiest option is<br/>
> likely to make a new LUKS container on it and try what<br/>
> is in there. You should be able to use the loop-device<br/>
> procedure from FAQ Item 2.6 from the commandline for<br/>
> that. If those values do not work, next option is to<br/>
> have the QNAP create a LUKS container on a new disk<br/>
> and see what it does.<br/>
<br/>
I'll try it that weekend or next when I have time to do it .<br/>
<br/>
<br/>
@Sven :<br/>
<br/>
>btw: I agree, if just the short output of mdadm was written to the disk<br/>
>chances are quite good for recovery.<br/>
<br/>
I hope so. I tried dd on files to replace the first 512 bytes of a file , but<br/>
the target file was completely replaced with this command :<br/>
<br/>
dd if=512_bytes_with_fixed_header of=file_with_first_64_MB_of_md0 bs=512 count=1<br/>
<br/>
Now I dont know if dd's behaviour is different on block device level ,<br/>
or is there another better way to replace / correct the first bytes of/dev/md0?<br/>
<br/>
<br/>
Greetings , Florian<br/>
</div></div></body></html>
Quoted 4 lines · Florian Dotzer
I tried dd on files to replace the first 512 bytes of a file , but the target file was completely replaced with this command :
dd if=512_bytes_with_fixed_header of=file_with_first_64_MB_of_md0 bs=512 count=1
When the target is a file, you need to include "conv=notrunc" so that the file will not be truncated to zero length when it is opened. That is not an issue when the target is a block device, but there is no harm in using "conv=notrunc" there, too.
Signature · 2 lines
Bob Nichols "NOSPAM" is really part of my email address.
Do NOT delete it.