Re: WD20EARS (4KB sector size) lost Luks header after reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> > This confirms that you did create the LUKS container at the
>> > right place, namely the LUKS header is at 64 x 512 B offset.
>>
>> 64x512 =32768
>> 32768  !=  32256
>>
>> 512 bytes is partition table? should it be 32780?
>> I am probably missing something.
>
> No, you see what I missed. Your LUKS sector is at 63 sectors
> offset, not 64. However the partition starts at 64 and therefore
> the LUKS sector is not at its start.
>
> I don't know what went wrong here, but partitions 1-4 are special in
> that you can change them without any changes to the disk except
> in the first sector (for partitions >= a chained partition sector
> is writte to disk and that can kill a LUKS header and do other dmage).
>
> This smeans you can just delete the partiton with fdisk and create
> a new one, which will the start at sector 63 and should have
> your LUKS container in it. It will not be 4kB alingned, though.
> You should unplug and replug the disk after the partition creation.
>
> If this goes wrong, you still have the first 100MB as backup.

;-)). you are the man :).

Working like a charm.  Deleted partition, created new starting at 63,
unplug/plug and luks partition is there. Thanks.

I owe you at least a drink.


>

>> I don't know enough about partition tables and headers but it looks like
>> /dev/sdm1 is starting little bit too far and LUKS header stays before the
>> beginning of /dev/sdm1 (first partition).
>
> Indeed.
>
>> Only obvious reason (at lease for me)  for this could be in this 4Kb
>> sector size.
>
> I think something has gone wrong when you did the alignment.
> Did you first create a not-4kB aligned partition and delete
> that again? If so the kernel would could remembered the partition
> but not that it got deleted and replaced (that needs a disk unplug).
> The reason is that the kernel sees partition changes only under some
> circumstances.

Wow great assumption. I did exactly that. I was doing this remotely
(I was not able to unplug) and I forgot first time to set 4kB sector size.
I deleted partition (which already was luksFormated too) and recreated
it again but this time in 4kB format.


Thanks a lot.


One more question because this is going pretty well now :) :

Do you have an idea how could I recreate 4kB aligned partition
without deleting data from the disk? This is more facultative question,
because I know have my data.

I thought about shrinking this partition, creating a second parition
 with 500gb to copy all data on this new partition, creating first paritition
in 4kB aligned format, copying all data back to this partition etc.

That could maybe  even work if XFS would support shrinking. But it
does not as I can remember ;-). Could partition start be moved from
sector 63 to sector 64 and keep working filesystem (of couse at the same
time risking to destroy some of the data)? Or is this (if possible) would
destroy filesystem totally?


M.
_______________________________________________
dm-crypt mailing list
dm-crypt@xxxxxxxx
http://www.saout.de/mailman/listinfo/dm-crypt



[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux