Philippe Midol-Monnet
2023-Apr-28 13:32 UTC
[Libguestfs] Using nested partition with LUKS+GPT
Hi
I have already fulfill a an issue, but it looks like it's not the
recommended process.
We are using a LUKS partition containing a GPT table and several partions.
With libguestfs we can open the LUKS partition and the
|/dev/mapper/<mapname>| device become available, but nested partition
are not seen by the kernel. |partprobe| need to be run (or may be
kpartx) to make partitions available in |/dev/mapper|.
AFAIK there are no simple solution.
As a workaround we use |guestfs_debug| but it's not a long term solution.
We can see two solutions:
* adding a udev rule that will automatically run partpobe when a new
device appeared in /dev/mapper
* adding a new API in libguestfs |guestfs_partprobe(device)| that can
be call by the user when needed.
What is the best best solution from your point of view?
We can help implementing it.
Regards
Philippe Midol-Monnet
--
*This email and any attachment contains EasyMile?s confidential
information, and must not be modified or circulated without EasyMile?s
prior written consent. It is intended exclusively for their recipient.s. If
you received this message by mistake, please notify us promptly and
immediately delete this email and any of its attachments.*
*As data
controller, EasyMile processes personal data, in compliance with the
European GDPR (EU) 2016/679 of 27 April 2016. To exercise your rights, you
can contact EasyMile at?privacy at easymile.com, and if necessary, you may
contact the local competent supervisory authority.?*
*Cet e-mail et toute
pi?ce jointe contiennent des informations confidentielles d'EasyMile et ne
doivent pas ?tre modifi?s ou diffus?s sans le consentement ?crit pr?alable
d'EasyMile. Ils sont destin?s exclusivement ? leur destinataire.s. Si vous
avez re?u ce message par erreur, veuillez nous en informer rapidement et
supprimer imm?diatement cet e-mail et toutes ses pi?ces jointes.??*
*En
tant que responsable de traitement, EasyMile traite des donn?es
personnelles, conform?ment au RGPD europ?en (UE) 2016/679 du 27 avril 2016.
Pour exercer vos droits, vous pouvez contacter EasyMile ??
privacy at easymile.com <mailto:privacy at easymile.com>, et si
n?cessaire, vous
pouvez contacter l'autorit? de contr?le locale comp?tente.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://listman.redhat.com/archives/libguestfs/attachments/20230428/206ad13b/attachment.htm>
Richard W.M. Jones
2023-Apr-29 06:52 UTC
[Libguestfs] Using nested partition with LUKS+GPT
On Fri, Apr 28, 2023 at 03:32:57PM +0200, Philippe Midol-Monnet wrote:> Hi > > I have already fulfill a an issue, but it looks like it's not the recommended > process. > > > We are using a LUKS partition containing a GPT table and several partions. > > With libguestfs we can open the LUKS partition and the /dev/mapper/<mapname> > device become available, but nested partition are not seen by the kernel. > partprobe need to be run (or may be kpartx) to make partitions available in / > dev/mapper. > > AFAIK there are no simple solution. > As a workaround we use guestfs_debug but it's not a long term solution. > > We can see two solutions: > > ? adding a udev rule that will automatically run partpobe when a new device > appeared in /dev/mapper > ? adding a new API in libguestfs guestfs_partprobe(device) that can be call > by the user when needed. > > What is the best best solution from your point of view? > We can help implementing it.I don't think there's any great answers here. Could you do the partition selection outside libguestfs? If it was a plain (not LUKS) partition then the answer would be yes, easily, with nbdkit-partition-filter: https://libguestfs.org/nbdkit.1.html#Combining-plugins-and-filters nbdkit also supports LUKS, but only LUKS v1, not the more common v2. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW