Re: [dm-crypt] [Request] cryptsetup option to fix leftovers from old filesystems

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

 



Thomas Bächler wrote:
> We have encountered a problem with blkid that is caused by cryptsetup 
> not cleaning superblocks of old filesystems on luksFormat. The problem 
> has been fixed in 1.0.7, however old LUKS volumes still suffer from this 
> problem. Please read this thread for details:
> 
> http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2563
> 
> What I would request is an option to "clean" the unused area in the LUKS 
> header up to the start of the payload, such that for example an old ext2 
> magic is removed. All that without destroying the used areas in the LUKS 
> header, of course.
> 
> I'm not very familiar with the LUKS code or on-disk format, so I would 
> be greatful if anyone who is would implement such a feature. Thanks for 
> your replies.

Hi Thomas,

I don't think we need implement any clean function, new version already
wipes that area.

Because visible LUKS header is written in first 2 sectors and keyslot
area always begins on 4k offset, you can use this command to wipe unused area
with possible old signature (at least this works for swap/luks signature mismatch):

dd if=/dev/zero of=<device> bs=512 seek=2 count=6

But please create backup before trying this... ;-)

(btw mkswap should clean LUKS signature too - try mkswap over old LUKS
and then blkid:-)

Milan
--
mbroz@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux