* [dm-crypt] wrong partition type with blkid command ? @ 2010-09-06 12:33 Aaron Lewis 2010-09-06 12:48 ` Arno Wagner 2010-09-06 12:57 ` Milan Broz 0 siblings, 2 replies; 5+ messages in thread From: Aaron Lewis @ 2010-09-06 12:33 UTC (permalink / raw) To: dm-crypt [-- Attachment #1: Type: Text/Plain, Size: 611 bytes --] Hi, blkid told me the type of an encrypted partition is "ext4" , while cryptsetup works fine. * blkid /dev/sda8 /dev/sda8: LABEL="ROOT" UUID="92d7eb3f-617d-4d63-8d1c-86b99ddeb5e4" TYPE="ext4" ( TYPE should be crypto_LUKS ) I've went through util-linux's source code , all magic code are defined here: shlibs/blkid/src/superblocks/luks.c I should not modify partition directly , should be some tools could help , anyone know ? Many thanks ! -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4R0NL3WI5 on freenode [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] wrong partition type with blkid command ? 2010-09-06 12:33 [dm-crypt] wrong partition type with blkid command ? Aaron Lewis @ 2010-09-06 12:48 ` Arno Wagner 2010-09-06 12:57 ` Aaron Lewis 2010-09-06 12:57 ` Milan Broz 1 sibling, 1 reply; 5+ messages in thread From: Arno Wagner @ 2010-09-06 12:48 UTC (permalink / raw) To: dm-crypt If you create a raw dm-crypt partition with cryptsetup, there is no valiadation at all, i.e. you can do this on a non-encrypted partition and not get an error message. Ir is extremely unlikely for encrypted data to just match the magic number, so something else is likely wrong here. Arno On Mon, Sep 06, 2010 at 08:33:58PM +0800, Aaron Lewis wrote: > Hi, > blkid told me the type of an encrypted partition is "ext4" , while > cryptsetup works fine. > > * blkid /dev/sda8 > /dev/sda8: LABEL="ROOT" UUID="92d7eb3f-617d-4d63-8d1c-86b99ddeb5e4" > TYPE="ext4" > > ( TYPE should be crypto_LUKS ) > > I've went through util-linux's source code , all magic code are defined here: > shlibs/blkid/src/superblocks/luks.c > > I should not modify partition directly , should be some tools could help , > anyone know ? > > Many thanks ! > > -- > Best Regards, > Aaron Lewis - PGP: 0x4A6D32A0 > FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 > irc: A4R0NL3WI5 on freenode > _______________________________________________ > 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] 5+ messages in thread
* Re: [dm-crypt] wrong partition type with blkid command ? 2010-09-06 12:48 ` Arno Wagner @ 2010-09-06 12:57 ` Aaron Lewis 0 siblings, 0 replies; 5+ messages in thread From: Aaron Lewis @ 2010-09-06 12:57 UTC (permalink / raw) To: dm-crypt; +Cc: Arno Wagner [-- Attachment #1: Type: Text/Plain, Size: 1826 bytes --] Hi, Arno Wagner > If you create a raw dm-crypt partition with cryptsetup, there > is no valiadation at all, i.e. you can do this on a non-encrypted > partition and not get an error message. > > Ir is extremely unlikely for encrypted data to just match the > magic number, so something else is likely wrong here. Hmm , checked util source code: const struct blkid_idinfo luks_idinfo = { .name = "crypto_LUKS", .usage = BLKID_USAGE_CRYPTO, .probefunc = probe_luks, .magics = { { .magic = "LUKS\xba\xbe", .len = 6 }, { NULL } } }; And also did a header dump in hex , magic code is correct anyway. I'm just very curious , two luks partitions , one correct , the other is not. OK , thanks for the quick reply ;-) What do you think this problem could be ? I really don't know how to detect partition type without magic number .. > > Arno > > On Mon, Sep 06, 2010 at 08:33:58PM +0800, Aaron Lewis wrote: > > Hi, > > > > blkid told me the type of an encrypted partition is "ext4" , while > > > > cryptsetup works fine. > > > > * blkid /dev/sda8 > > /dev/sda8: LABEL="ROOT" UUID="92d7eb3f-617d-4d63-8d1c-86b99ddeb5e4" > > TYPE="ext4" > > > > ( TYPE should be crypto_LUKS ) > > > > I've went through util-linux's source code , all magic code are defined > > here: shlibs/blkid/src/superblocks/luks.c > > > > I should not modify partition directly , should be some tools could help > > , anyone know ? > > > > Many thanks ! > > > > > > > > > > _______________________________________________ > > dm-crypt mailing list > > dm-crypt@saout.de > > http://www.saout.de/mailman/listinfo/dm-crypt -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4R0NL3WI5 on freenode [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] wrong partition type with blkid command ? 2010-09-06 12:33 [dm-crypt] wrong partition type with blkid command ? Aaron Lewis 2010-09-06 12:48 ` Arno Wagner @ 2010-09-06 12:57 ` Milan Broz 2010-09-06 13:08 ` [dm-crypt] [SOLVE] " Aaron Lewis 1 sibling, 1 reply; 5+ messages in thread From: Milan Broz @ 2010-09-06 12:57 UTC (permalink / raw) To: Aaron Lewis; +Cc: dm-crypt On 09/06/2010 02:33 PM, Aaron Lewis wrote: > blkid told me the type of an encrypted partition is "ext4" , while > cryptsetup works fine. > > * blkid /dev/sda8 > /dev/sda8: LABEL="ROOT" UUID="92d7eb3f-617d-4d63-8d1c-86b99ddeb5e4" > TYPE="ext4" > > ( TYPE should be crypto_LUKS ) > > I've went through util-linux's source code , all magic code are defined here: > shlibs/blkid/src/superblocks/luks.c IF it is LUKS and not plain crypto - "blkid -u crypto -p /dev/sda8" prints LUKS? If so, that's probably old bug - both signarures are present (cryptsetup did not wipe part of signature) read http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#3._Common_Problems "blkid" sees a LUKS UUID and an ext2/swap UUID on the same device. What is wrong?" Milan ^ permalink raw reply [flat|nested] 5+ messages in thread
* [dm-crypt] [SOLVE] Re: wrong partition type with blkid command ? 2010-09-06 12:57 ` Milan Broz @ 2010-09-06 13:08 ` Aaron Lewis 0 siblings, 0 replies; 5+ messages in thread From: Aaron Lewis @ 2010-09-06 13:08 UTC (permalink / raw) To: Milan Broz; +Cc: dm-crypt [-- Attachment #1: Type: Text/Plain, Size: 782 bytes --] Hi, Milan > > IF it is LUKS and not plain crypto - "blkid -u crypto -p /dev/sda8" prints > LUKS? Indeed. > If so, that's probably old bug - both signarures are present (cryptsetup > did not wipe part of signature) Yep , it's part of my problem , i didn't wipe my partition totally. > > read > http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#3._Commo > n_Problems "blkid" sees a LUKS UUID and an ext2/swap UUID on the same > device. What is wrong?" Nice , ok , no need to read anymore source code ;-P Backup and restore it fixed my problem. Thanks for all your help ! > > > Milan -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4R0NL3WI5 on freenode [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-09-06 13:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-09-06 12:33 [dm-crypt] wrong partition type with blkid command ? Aaron Lewis 2010-09-06 12:48 ` Arno Wagner 2010-09-06 12:57 ` Aaron Lewis 2010-09-06 12:57 ` Milan Broz 2010-09-06 13:08 ` [dm-crypt] [SOLVE] " Aaron Lewis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox