All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Need help with sync'ing dmsetup info to disk
@ 2011-07-12 15:30 Johann Burkard
  2011-07-13 12:51 ` Arno Wagner
  0 siblings, 1 reply; 7+ messages in thread
From: Johann Burkard @ 2011-07-12 15:30 UTC (permalink / raw)
  To: dm-crypt

Hello,

I have a big problem with one of my machines: Upon booting, there are no  
entries in /dev/mapper and the system doesn't start. It looks like this:

ls -l /dev/mapper
crw------- 1 10, 59 control

Fortunately, I was able to read the dmsetup tables from a backup of the  
disk. They look like this:

sda2_crypt: 0 234241709 crypt twofish-cbc-essiv:sha256  
0000000000000000000000000000000000000000000000000000000000000000 0 8:2 2056
data-drive: 0 216662016 linear 252:0 17572224
data-swap: 0 17571840 linear 252:0 384

Now, I tried a Ubuntu live CD to restore them. I edited the table  
definitions to point to /dev/sda2 (which is the crypto partition) and  
called dmsetup create sda2_crypt ..., dmsetup create data-drive ...,  
dmsetup create data-swap ...

However, once I reboot into the original OS on the disk, the entries are  
gone again.

When I try to create the entries with dmsetup in the initrd, I get this  
error:

(initramfs) dmsetup create sda2_crypt --table '0 1234....'
device-mapper: reload ioctl failed: Invalid argument
Command failed

How can I save the dmsetup tables to disk from the Ubuntu live CD?

Thanks for any help.

Johann

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-crypt] Need help with sync'ing dmsetup info to disk
  2011-07-12 15:30 [dm-crypt] Need help with sync'ing dmsetup info to disk Johann Burkard
@ 2011-07-13 12:51 ` Arno Wagner
  2011-07-13 19:18   ` Johann Burkard
  0 siblings, 1 reply; 7+ messages in thread
From: Arno Wagner @ 2011-07-13 12:51 UTC (permalink / raw)
  To: dm-crypt

The first question would be: What did you change?
Also, tbis liiks like a problem with dmsetup, not
cryptsetup. 

More info needed:
- What Distribution?
- What configuration?
- What did you do immediately before ot borke? Nay updated?

Arno

On Tue, Jul 12, 2011 at 05:30:38PM +0200, Johann Burkard wrote:
> Hello,
> 
> I have a big problem with one of my machines: Upon booting, there
> are no entries in /dev/mapper and the system doesn't start. It looks
> like this:
> 
> ls -l /dev/mapper
> crw------- 1 10, 59 control
> 
> Fortunately, I was able to read the dmsetup tables from a backup of
> the disk. They look like this:
> 
> sda2_crypt: 0 234241709 crypt twofish-cbc-essiv:sha256
> 0000000000000000000000000000000000000000000000000000000000000000 0
> 8:2 2056
> data-drive: 0 216662016 linear 252:0 17572224
> data-swap: 0 17571840 linear 252:0 384
> 
> Now, I tried a Ubuntu live CD to restore them. I edited the table
> definitions to point to /dev/sda2 (which is the crypto partition)
> and called dmsetup create sda2_crypt ..., dmsetup create data-drive
> ..., dmsetup create data-swap ...
> 
> However, once I reboot into the original OS on the disk, the entries
> are gone again.
> 
> When I try to create the entries with dmsetup in the initrd, I get
> this error:
> 
> (initramfs) dmsetup create sda2_crypt --table '0 1234....'
> device-mapper: reload ioctl failed: Invalid argument
> Command failed
> 
> How can I save the dmsetup tables to disk from the Ubuntu live CD?
> 
> Thanks for any help.
> 
> Johann
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
> 

-- 
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 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-crypt] Need help with sync'ing dmsetup info to disk
  2011-07-13 12:51 ` Arno Wagner
@ 2011-07-13 19:18   ` Johann Burkard
  2011-07-14  3:36     ` Bryan Kadzban
  0 siblings, 1 reply; 7+ messages in thread
From: Johann Burkard @ 2011-07-13 19:18 UTC (permalink / raw)
  To: dm-crypt

Hello,

Am 13.07.2011, 14:51 Uhr, schrieb Arno Wagner <arno@wagner.name>:
> The first question would be: What did you change?

I think Xubuntu did an update before I couldn't start the computer anymore  
but I'm not sure.

> More info needed:
> - What Distribution?

Xubuntu 10.10 (which is Ubuntu 10.10 with XFCE FWIK).

> - What configuration?

It's a notebook that has a 128 GB Samsung SSD in it. /dev/sda1 is mounted  
at /boot. I use GRUB.

/dev/sda2 is the crypto partition which houses / and swap. Here's the  
layout:

>> sda2_crypt: 0 234241709 crypt twofish-cbc-essiv:sha256
>> 0000000000000000000000000000000000000000000000000000000000000000 0
>> 8:2 2056
>> data-drive: 0 216662016 linear 252:0 17572224
>> data-swap: 0 17571840 linear 252:0 384

> - What did you do immediately before ot borke? Nay updated?

Can't remember exactly.

Do you know how I can save the dmsetup tables to disk?
-- 
Regards,

Johann Burkard

<http://johannburkard.de>
<http://twitter.com/johannburkard>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-crypt] Need help with sync'ing dmsetup info to disk
  2011-07-13 19:18   ` Johann Burkard
@ 2011-07-14  3:36     ` Bryan Kadzban
  2011-07-14 19:13       ` Johann Burkard
  0 siblings, 1 reply; 7+ messages in thread
From: Bryan Kadzban @ 2011-07-14  3:36 UTC (permalink / raw)
  To: Johann Burkard; +Cc: dm-crypt

Johann Burkard wrote:
> Do you know how I can save the dmsetup tables to disk?

That's not how it works.  dmsetup does not save tables to disk.

cryptsetup reads the LUKS header off disk (if you use LUKS).  See the
FAQ for the layout of this header (and where the key slots go).  But if
you use non-luks, there is no metadata saved anywhere; the initrd will
have to reconstruct everything from its configuration (and possibly keys
read from the user).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-crypt] Need help with sync'ing dmsetup info to disk
  2011-07-14  3:36     ` Bryan Kadzban
@ 2011-07-14 19:13       ` Johann Burkard
  2011-07-15  3:13         ` Bryan Kadzban
  0 siblings, 1 reply; 7+ messages in thread
From: Johann Burkard @ 2011-07-14 19:13 UTC (permalink / raw)
  To: dm-crypt

Hello,

Am 14.07.2011, 05:36 Uhr, schrieb Bryan Kadzban  
<cryptsetup@kdzbn.homelinux.net>:
> That's not how it works.  dmsetup does not save tables to disk.
>
> cryptsetup reads the LUKS header off disk (if you use LUKS).  See the
> FAQ for the layout of this header (and where the key slots go).

thanks Bryan. Would you say that I should restore the LUKS header from the  
old backup? Would that work?
-- 
Regards,

Johann Burkard

<http://johannburkard.de>
<http://twitter.com/johannburkard>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-crypt] Need help with sync'ing dmsetup info to disk
  2011-07-14 19:13       ` Johann Burkard
@ 2011-07-15  3:13         ` Bryan Kadzban
  2011-07-15  5:57           ` Johann Burkard
  0 siblings, 1 reply; 7+ messages in thread
From: Bryan Kadzban @ 2011-07-15  3:13 UTC (permalink / raw)
  To: Johann Burkard; +Cc: dm-crypt

Johann Burkard wrote:
> Hello,
> 
> Am 14.07.2011, 05:36 Uhr, schrieb Bryan Kadzban 
> <cryptsetup@kdzbn.homelinux.net>:
>> That's not how it works.  dmsetup does not save tables to disk.
>> 
>> cryptsetup reads the LUKS header off disk (if you use LUKS).  See
>> the FAQ for the layout of this header (and where the key slots go).
> 
> thanks Bryan. Would you say that I should restore the LUKS header
> from the old backup? Would that work?

Depends on what changed.  If you have a backup, it may help.  I'd grab a
backup of the current bits on disk before changing anything permanent,
though.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dm-crypt] Need help with sync'ing dmsetup info to disk
  2011-07-15  3:13         ` Bryan Kadzban
@ 2011-07-15  5:57           ` Johann Burkard
  0 siblings, 0 replies; 7+ messages in thread
From: Johann Burkard @ 2011-07-15  5:57 UTC (permalink / raw)
  To: dm-crypt

Hello,

Am 15.07.2011, 05:13 Uhr, schrieb Bryan Kadzban  
<cryptsetup@kdzbn.homelinux.net>:
> Depends on what changed.  If you have a backup, it may help.  I'd grab a
> backup of the current bits on disk before changing anything permanent,
> though.

thanks Bryan, I did that but the LUKS headers of both the backup and the  
disk are identical. What to do now?
-- 
Regards,

Johann Burkard

<http://johannburkard.de>
<http://twitter.com/johannburkard>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-07-15  5:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 15:30 [dm-crypt] Need help with sync'ing dmsetup info to disk Johann Burkard
2011-07-13 12:51 ` Arno Wagner
2011-07-13 19:18   ` Johann Burkard
2011-07-14  3:36     ` Bryan Kadzban
2011-07-14 19:13       ` Johann Burkard
2011-07-15  3:13         ` Bryan Kadzban
2011-07-15  5:57           ` Johann Burkard

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.