All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Partitions on top of LUKS encrypted HD not recognized by kernel
@ 2015-03-28 13:05 rainer.herrendoerfer
  2015-03-30 16:42 ` Milan Broz
  0 siblings, 1 reply; 2+ messages in thread
From: rainer.herrendoerfer @ 2015-03-28 13:05 UTC (permalink / raw)
  To: dm-crypt

Hello list,

I'm experimenting with LUKS on a Gentoo-Box. I luksFormat'ted the whole
harddisk /dev/sda and luksOpen'ed as gentoo, so it appeared as
/dev/mapper/gentoo. So far so good. When I use LVM and take it as a
physical volume and set up VGs and LVs they appear in /dev/mapper
automatically.
But when trying to use normal partitions instead of LVM, parted can
mklabel and mkpart but gets a warning that the new partitions are not
known by the kernel and indeed, they don't appear in /dev/mapper.
I need to run 'kpartx -av gentoo' that they appear in /dev/mapper and
then they are normally usable. When trying to luksClose them after
unmounting them they are 'still in use' until I make the kernel to
forget them by 'kpartx -d /dev/mapper/gentoo'.
So is using partitioning on fully encrypted harddisks not supported by
LUKS at all? Or just a bug in the current version used by Gentoo which
is 1.6.5?
Thanks in advance
®ainer

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

* Re: [dm-crypt] Partitions on top of LUKS encrypted HD not recognized by kernel
  2015-03-28 13:05 [dm-crypt] Partitions on top of LUKS encrypted HD not recognized by kernel rainer.herrendoerfer
@ 2015-03-30 16:42 ` Milan Broz
  0 siblings, 0 replies; 2+ messages in thread
From: Milan Broz @ 2015-03-30 16:42 UTC (permalink / raw)
  To: rainer.herrendoerfer, dm-crypt

On 03/28/2015 02:05 PM, rainer.herrendoerfer wrote:
> Hello list,
> 
> I'm experimenting with LUKS on a Gentoo-Box. I luksFormat'ted the whole
> harddisk /dev/sda and luksOpen'ed as gentoo, so it appeared as
> /dev/mapper/gentoo. So far so good. When I use LVM and take it as a
> physical volume and set up VGs and LVs they appear in /dev/mapper
> automatically.
> But when trying to use normal partitions instead of LVM, parted can
> mklabel and mkpart but gets a warning that the new partitions are not
> known by the kernel and indeed, they don't appear in /dev/mapper.
> I need to run 'kpartx -av gentoo' that they appear in /dev/mapper and
> then they are normally usable. When trying to luksClose them after
> unmounting them they are 'still in use' until I make the kernel to
> forget them by 'kpartx -d /dev/mapper/gentoo'.
> So is using partitioning on fully encrypted harddisks not supported by
> LUKS at all? Or just a bug in the current version used by Gentoo which
> is 1.6.5?

Partitions over device mapper are not recognized by the kernel, you have
to use kpartx to make them mapped (kpartx does not use kernel partitioning
but use device-mapper as well).

LUKS has nothing to do with partitioning, usually the problem is solved
by some other layer (udisks) that listens to udev messages
and reacts to device removals.

So no, it is not a bug, it is the same problem like you forgot to unmount
filesystem over LUKS device - it cannot be removed without unmounting
it first. It is just different layer here.

Milan

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

end of thread, other threads:[~2015-03-30 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-28 13:05 [dm-crypt] Partitions on top of LUKS encrypted HD not recognized by kernel rainer.herrendoerfer
2015-03-30 16:42 ` Milan Broz

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.