From: Martin Wilck <mwilck@suse.com>
To: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: [PATCH 08/10] kpartx: use partition UUID for non-DM devices
Date: Mon, 08 May 2017 10:01:34 +0200 [thread overview]
Message-ID: <1494230494.5362.5.camel@suse.com> (raw)
In-Reply-To: <20170505223005.GH11857@agk-dp.fab.redhat.com>
On Fri, 2017-05-05 at 23:30 +0100, Alasdair G Kergon wrote:
> On Sat, May 06, 2017 at 12:05:57AM +0200, Martin Wilck wrote:
> > Introduce a "fake" UUID for these devices to make sure kpartx
> > deletes only devices it had created previously. Otherwise kpartx
> > might e.g. delete LVM LVs that are inside a device it is trying
> > to delete partitions for. It seems to be wiser to make sure the
> > user delete these manually before running "kpartx -d".
> >
> > With the fake UUID in place, we can re-introduce the UUID check
> > for non-DM device that was removed in the earlier patch
> > "kpartx: dm_remove_partmaps: support non-dm devices".
> >
> > This disables also deletion of partition mappings created
> > by earlier versions of kpartx. If kpartx has been updated after
> > partition mappings were created, the "-f" flag can be used
> > to force delting these partitions, too.
>
>
> Indeed - always supply a uuid for every dm device created.
> Add a standard prefix to the beginning of it, ideally "KPARTX-" to be
> consistent with other dm tools ("LVM-", "CRYPT-" etc.) if you're
> able to break compatibility, but "part" is still unique and
> adequate.
> (Stacked devices can end up with a stack of prefixes - only the
> leftmost one
> counts.)
As noted in my reply to Hannes' mail, I'm using the prefix "part%u-",
the same prefix that kpartx currently used for partitions of DM
devices.
The full format e.g. for /dev/mapper/loop0p1 is
"part1-7:0-kpartx-Wh5pYvM7uc60hh74"
and correspondingly, the "fake UUID" used for /dev/loop0 would be
"7:0-kpartx-Wh5pYvM7uc60hh74"
If you don't like the fact that this starts with "7:0", changing this
to e.g. "KPARTX-7.0-$something" is no problem as long as patch isn't
applied.
The last part ("Wh...") is a hard-coded string, just to avoid
accidental conflicts. I was wondering whether it would make sense to
some sort of encoded "host ID" to make this UUID truly "universal". My
personal opinion is that this would be over-engineered, because these
UUID will be visible only only on the host that called "kpartx -a" in
the first place.
Cheers,
Martin
--
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2017-05-08 8:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 22:05 [PATCH 00/10] fixes for kpartx -d Martin Wilck
2017-05-05 22:05 ` [PATCH 01/10] kpartx: test-kpartx: new unit test program Martin Wilck
2017-05-05 22:05 ` [PATCH 02/10] kpartx: avoid ioctl error for loop devices Martin Wilck
2017-05-08 20:46 ` Benjamin Marzinski
2017-05-11 9:33 ` Martin Wilck
2017-05-05 22:05 ` [PATCH 03/10] kpartx: remove is_loop_device Martin Wilck
2017-05-05 22:05 ` [PATCH 04/10] kpartx: dm_remove_partmaps: support non-dm devices Martin Wilck
2017-05-05 22:05 ` [PATCH 05/10] kpartx: dm_devn: return error for non-existent device Martin Wilck
2017-05-05 22:05 ` [PATCH 06/10] kpartx: don't treat multi-linear mappings as partitions Martin Wilck
2017-05-05 22:05 ` [PATCH 07/10] libmultipath: " Martin Wilck
2017-05-05 22:05 ` [PATCH 08/10] kpartx: use partition UUID for non-DM devices Martin Wilck
2017-05-05 22:30 ` Alasdair G Kergon
2017-05-08 8:01 ` Martin Wilck [this message]
2017-05-05 22:05 ` [PATCH 09/10] kpartx: use absolute path for regular files Martin Wilck
2017-05-05 22:05 ` [PATCH 10/10] kpartx: find_loop_by_file: use sysfs Martin Wilck
2017-05-05 22:18 ` [PATCH 00/10] fixes for kpartx -d Alasdair G Kergon
2017-05-05 22:30 ` Martin Wilck
2017-05-05 22:36 ` Martin Wilck
2017-05-08 6:33 ` Hannes Reinecke
2017-05-08 7:47 ` Martin Wilck
2017-05-08 7:54 ` Martin Wilck
2017-05-08 22:21 ` Benjamin Marzinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494230494.5362.5.camel@suse.com \
--to=mwilck@suse.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.