Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   EXT3 Users (http://www.linux-archive.org/ext3-users/)
-   -   damaged encrypted LUKS device (http://www.linux-archive.org/ext3-users/603076-damaged-encrypted-luks-device.html)

Markus Feldmann 11-26-2011 01:15 PM

damaged encrypted LUKS device
 
Hi people,

i had created encrypted device with cryptsetup/LUKS which i setup with
an ext4 filesystem. This device is an external USB harddisk. When i
plugin this device it will be automatically mounted by my gnome3 system
(Debian Wheezey/Testing), but this week i got an error. I did ask the
ask the LUKS developers what is the problem and they told me that this
is an ext4 problem.


The error message from gnome is:

Einhängen von AIRY_1TB nicht möglich

Error mounting: mount: wrong fs type, bad option, bad superblock on /dev/mapper/udisks-luks-uuid-70a2aedf-ce7e-4e12-8f0b-ec7974ebdbd4-uid1000,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so





And from <dmesg> i got the message:

[ 3094.394043] EXT4-fs (dm-0): ext4_check_descriptors: Inode bitmap for group 3328 not in group (block 1235654634)!
[ 3094.394056] EXT4-fs (dm-0): group descriptors corrupted!


Further on, when i try to <fsck -N /dev/sdb> i get:

fsck from util-linux 2.19.1
fsck: fsck.crypto_LUKS: not found
fsck: Error 2 while executing fsck.crypto_LUKS for /dev/sdb


But cryptsetup is installed, only lvm2 is missing, but i dont have a LVM
device and as i researched at "debian.org" there is no package which
provides the command <fsck.crypto_LUKS>.



Any hints/instructions for me?

regards Markus

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Matija Nalis 11-26-2011 03:40 PM

damaged encrypted LUKS device
 
On Sat, Nov 26, 2011 at 03:15:42PM +0100, Markus Feldmann wrote:
> And from <dmesg> i got the message:
> >[ 3094.394043] EXT4-fs (dm-0): ext4_check_descriptors: Inode bitmap for group 3328 not in group (block 1235654634)!
> >[ 3094.394056] EXT4-fs (dm-0): group descriptors corrupted!
>
> Further on, when i try to <fsck -N /dev/sdb> i get:
> >fsck from util-linux 2.19.1
> >fsck: fsck.crypto_LUKS: not found
> >fsck: Error 2 while executing fsck.crypto_LUKS for /dev/sdb
>
> But cryptsetup is installed, only lvm2 is missing, but i dont have a
> LVM device and as i researched at "debian.org" there is no package
> which provides the command <fsck.crypto_LUKS>.
>
> Any hints/instructions for me?

try "e2fsck -C0 /dev/dm-0" (assuming /dev/dm-0 is your block device
after decryption).

And do full block-by-block backup of your external USB disk first!
(using dd(1))

--
Opinions above are GNU-copylefted.

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Markus Peuhkuri 11-28-2011 09:17 AM

damaged encrypted LUKS device
 
On 26.11.2011 18:40, Matija Nalis wrote:
And do full block-by-block backup of your external USB disk first!
(using dd(1))
And if it happens to abort on error, try http://safecopy.sourceforge.net
(available on package in recent distros) that makes quite good work on
reading disks with read errors. Worked better than any
dd{_recover,rescue}. After doing the 3-stage copy, I was able copy
files from ext4 partition inside LVM that was in qcow2 virtual machine
image that was on ext3 partition on LVM on the failed disk.


t. Markus

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Markus Feldmann 11-28-2011 01:42 PM

damaged encrypted LUKS device
 
Am 26.11.2011 17:40, schrieb Matija Nalis:


try "e2fsck -C0 /dev/dm-0" (assuming /dev/dm-0 is your block device
after decryption).


How can i be sure, that my cryptsetup/LUKS harddisk is still decrypted?

<cryptsetup status /dev/dm-1> gives me:

root@feld-bert:/home/markus# cryptsetup status /dev/dm-1
/dev/mapper//dev/dm-1 is active.
type: LUKS1
cipher: aes-xts-plain
keysize: 256 bits
device: /dev/sdb
offset: 4096 sectors
size: 1953521072 sectors
mode: read/write



_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Bodo Thiesen 11-28-2011 02:58 PM

damaged encrypted LUKS device
 
Hello Markus.

* Markus Feldmann <feldmann_markus@gmx.de> hat geschrieben:
>* Am 26.11.2011 17:40, schrieb Matija Nalis:
>> try "e2fsck -C0 /dev/dm-0" (assuming /dev/dm-0 is your block device
>> after decryption).
> How can i be sure, that my cryptsetup/LUKS harddisk is still decrypted?
> <cryptsetup status /dev/dm-1> gives me:
>> root@feld-bert:/home/markus# cryptsetup status /dev/dm-1
>> /dev/mapper//dev/dm-1 is active.

That line tells you ;)

So, try a e2fsck -n -C0 /dev/dm-1 (the -n causes no changes to be made
to the file system - errors will be reported only). If it's not too much,
but you're unsure what to do, maybe you want to post them here (use
command

LANG=C e2fsck -n /dev/dm-1 > some-file.txt

for that and post the contents of some-file.txt). If it's too much maybe
you want to pastebin them and post the link here. In both cases, remember
to strip path names and similar data unless you don't care to publish them.
(However - why are you encrypting them then in the first place?)

Additionally, I suggest following Markus Peuhkuri's tip to first create a
block by block copy before doing anything else. I suggest copying the
encrypted version (i.e. /dev/sdb) not the decrypted one (i.e. /dev/dm-1).

Regards, Bodo

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Markus Feldmann 11-28-2011 04:09 PM

damaged encrypted LUKS device
 
Here comes my new output from <LANG=C e2fsck -n -C0 /dev/dm-1>

http://pastebin.com/raw.php?i=x0siBmrj

I will buy another 1 TByte harddisk these days and then make a
byte-to-byte backup.


regards Markus

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Bodo Thiesen 11-28-2011 05:26 PM

damaged encrypted LUKS device
 
* Markus Feldmann <feldmann_markus@gmx.de> hat geschrieben:

> Here comes my new output from <LANG=C e2fsck -n -C0 /dev/dm-1>
>
> http://pastebin.com/raw.php?i=x0siBmrj

Ok, the summary of that paste is:
| root@feld-bert:/home/markus# LANG=C e2fsck -n -C0 /dev/dm-1
| e2fsck 1.42-WIP (16-Oct-2011)
| e2fsck: Group descriptors look bad... trying backup blocks...
| Error writing block 1 (Attempt to write block to filesystem
| resulted in short write). Ignore error? no
(more lines of this kind)
| e2fsck: Device or resource busy while trying to open /dev/dm-1
| Filesystem mounted or opened exclusively by another program?

And the bug report is here:
https://sourceforge.net/tracker/?func=detail&aid=3444351&group_id=2406&atid=102406

| 1. e2fsck should not try to write when using -n.
| 2. ignore error is not a question to be answered with "no" when
| using -n but with "yes" instead.
| 3. I do not know what that "Device or resource busy" error is about
| (someone else reported that problem on ext3-users@redhat.com, I'm
| merely relaying that bug report), but it doesn't matter either: -n
| means don't write and reading worked obviously.

> I will buy another 1 TByte harddisk these days and then make a
> byte-to-byte backup.

Do that. But before you start the copy, reboot your system, maybe there is
some processes waiting in disk-io on the problem disk (task state D in
process lists). At least, that's what
| e2fsck: Device or resource busy while trying to open /dev/dm-1
| Filesystem mounted or opened exclusively by another program?
suggest. However, that message may as well be caused by the other bug in
e2fsck.

Maybe it could be useful to init 1, wait for the X server and other
stuff to stop and then log in on the text console and do the copy there,
so that all that normally fancy but for this problem nasty auto mounting
stuff is not active when you connect the disk(s) to your system.

Regards, Bodo

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users


All times are GMT. The time now is 03:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.