All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arno Wagner <arno@wagner.name>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] WD20EARS (4KB sector size) lost Luks header after	reboot
Date: Tue, 14 Sep 2010 19:33:32 +0200	[thread overview]
Message-ID: <20100914173332.GB32723@tansi.org> (raw)
In-Reply-To: <AANLkTinX5yfjax2KghiaFPAYVN9yrX10XHe11E3S1=fm@mail.gmail.com>

Hi,

On Tue, Sep 14, 2010 at 06:55:36PM +0200, Ma Begaj wrote:
> Hi,
> 
> 
> I got a new HDD a few days ago and I put it in an external case and connected
> it over USB with my home server. It is a 2000GB WD disk,  WD20EARS.

That would be one of the 2kB sector drives...
 
> I already read a few articles how should I format this "special"
> drive, and I did it like this:
> http://ubuntuforums.org/showthread.php?t=1456251
> 
> I set the partition to begin on sector 64 (instead of 63), run
> luksFormat, run luksOpen,
> created XFS and copied my files on this disk. I umounted it later and
> I rebooted
> the server today.
> 
> First thing I noticed is that disk/paritions are not visible in
> /dev/disk/by-uuid/ although
> /dev/sdm and /dev/sdm1 are available. fdisk also does not look same 
> as before:

Not good.

> fdisk output:
> --------------
> root@road:/dev/disk/by-uuid#  fdisk /dev/sdm
> 
> The number of cylinders for this disk is set to 243201.
> There is nothing wrong with that, but this is larger than 1024,
> and could in certain setups cause problems with:
> 1) software that runs at boot time (e.g., old versions of LILO)
> 2) booting and partitioning software from other OSs
>    (e.g., DOS FDISK, OS/2 FDISK)
> 
> Command (m for help): p
> 
> Disk /dev/sdm: 2000.3 GB, 2000398934016 bytes
> 255 heads, 63 sectors/track, 243201 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> Disk identifier: 0x00000000
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdm1               1      243202  1953514552   83  Linux

You did create one large partition?

What is the output of "fdisk -lu /dev/sdm1"?


> --------------
> 
> "Start" is 1 instead of 64.... pretty strange because I set it to 64
> when I was making this partition.

You set it to 64 sectors. The 1 is a cylinder. You cannto see in this
view where exactly the partition starts. Use the -u option to fdisk.

> 
> luksOpen does not work and luksDump/isLuks reported that /dev/sdm1 is
> not luks partition.

Interesting.
 
> I have cryptsetup 1.0.5 on my server.

Aehm, that is hiostoric. Please try with the current one,
which would be 1.1.3.
 
> There are two questions for me here:
> 1. I have luksDump of /dev/sdm1 before this happened. Can I use
> luksDump ouput  to
> recover/overwrite Luks partition?

I think not, but I am not sure. Before trying that, lets figure
out whether this is simply an offset issue. Can you look 
through the start of the disk and give the offset where the
"LUKS" string is exactly?

Something like this should do the trick:

hd /dev/sdm | grep LUKS

> fdisk reports "start" on sector 1 instead of 64, which means that
> something there went wrong.

No, see above.

> Or not? Ideas? If I can use luksDump to recover luks-header should the
> partition table maybe be
> rewritten beginning with sector 64 before I recreate luks header.
> 
> 
> 2. How all this could happen?
> 
> I would be very happy to experiment with this, to repeat all the steps
> to recreat the situation
>  if I know that I am able to recover my partition. Any ideas before I
> start to play with this?
> How much of the partition header should I backup before starting with
> all of this?

See the FAQ. If you back up the first 100MB, you are on the safe side.
 
 
> Thanks a lot for any advice.
> 
> M.
> 
> p.s. I have all the data but I would like to avoid copying again
> because I have to copy everything
> (over 500gb) over SSH trough a 10mb connection

Half a pound (500g) of 'b' though a 10 milli-bit connection?
Sounds like a pain (yes, capitalization can carry meaning).

Arno
-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 

  reply	other threads:[~2010-09-14 17:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14 16:55 [dm-crypt] WD20EARS (4KB sector size) lost Luks header after reboot Ma Begaj
2010-09-14 17:33 ` Arno Wagner [this message]
2010-09-14 18:50   ` Ma Begaj
2010-09-14 20:32     ` Arno Wagner
2010-09-14 21:37       ` Ma Begaj
2010-09-14 22:13         ` Arno Wagner
2010-09-14 23:02           ` Ma Begaj
2010-09-15 10:29             ` Heinz Diehl
2010-09-15 11:21               ` Ma Begaj
2010-09-15 14:09             ` Arno Wagner
2010-09-16  7:30               ` Ma Begaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100914173332.GB32723@tansi.org \
    --to=arno@wagner.name \
    --cc=dm-crypt@saout.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.