[Bug 1672106] [NEW] Need a way to recognize partionion table inside of LUKS container declaratively and automatically

Nazar Mokrynskyi nazar at mokrynskyi.com
Sun Mar 12 01:42:22 UTC 2017


Public bug reported:

Lets assume I have LUKS container on the raw `/dev/sdx`. It occupies the
whole disk, so I've opened it, created partition table on corresponding
`/dev/mapper/xyz` and created 2 partitions inside.

Here is the trick: before mounting those partitions I need to run
`kpartx -u -p -part /dev/mapper/xyz` so that I can access those
partitions as `/dev/mapper/xyz-part1` and `/dev/mapper/xyz-part2`.

I'd like to make mounting automatic on boot with `/etc/crypttab` and
`/etc/fstab` only, but I need to run `kpartx` after opening LUKS
container and before mounting target partitions inside of it. This is
possible with custom scripts, but requires quite invasive configuration
which I'd like to avoid.

Currently I'm unable to find any way to declaratively specify that this
container have partition table in it.

What I imaging as a perfect solution is new options supported in
`/etc/crypttab` like following:

xyz UUID=... none luks,kpartx,kpartx-delimiter=-part

Which will result in:
* /dev/mapper/xyz
* /dev/mapper/xyz-part1
* /dev/mapper/xyz-part2

** Affects: cryptsetup (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to cryptsetup in Ubuntu.
https://bugs.launchpad.net/bugs/1672106

Title:
  Need a way to recognize partionion table inside of LUKS container
  declaratively and automatically

Status in cryptsetup package in Ubuntu:
  New

Bug description:
  Lets assume I have LUKS container on the raw `/dev/sdx`. It occupies
  the whole disk, so I've opened it, created partition table on
  corresponding `/dev/mapper/xyz` and created 2 partitions inside.

  Here is the trick: before mounting those partitions I need to run
  `kpartx -u -p -part /dev/mapper/xyz` so that I can access those
  partitions as `/dev/mapper/xyz-part1` and `/dev/mapper/xyz-part2`.

  I'd like to make mounting automatic on boot with `/etc/crypttab` and
  `/etc/fstab` only, but I need to run `kpartx` after opening LUKS
  container and before mounting target partitions inside of it. This is
  possible with custom scripts, but requires quite invasive
  configuration which I'd like to avoid.

  Currently I'm unable to find any way to declaratively specify that
  this container have partition table in it.

  What I imaging as a perfect solution is new options supported in
  `/etc/crypttab` like following:

  xyz UUID=... none luks,kpartx,kpartx-delimiter=-part

  Which will result in:
  * /dev/mapper/xyz
  * /dev/mapper/xyz-part1
  * /dev/mapper/xyz-part2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1672106/+subscriptions



More information about the foundations-bugs mailing list