From: Marc Ballarin <Ballarin.Marc@gmx.de>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] UUID question
Date: Tue, 18 Dec 2012 09:12:01 +0100 [thread overview]
Message-ID: <50D02551.9050009@gmx.de> (raw)
In-Reply-To: <20121218003612.GA14871@tansi.org>
Am 18.12.2012 01:36, schrieb Arno Wagner:
> On Mon, Dec 17, 2012 at 04:10:50PM -0800, David Li wrote:
>> Hi, I wonder if the dm-crypt partition UUID (shown in blkid -p <dev>) can
>> be used to uniquely associate it with the set of keys the partition will
>> need. Are there any cases that the UUID would change during the partition's
>> lifetime?
>
> The UUID is actually a filesystem attribute, not a partition
> attribute...
This depends on the partition format in use. For example GPT, and maybe
others, provide an additional UUID for partititons (actually GPT even
supports Labels):
$ sudo blkid -p /dev/sda1
/dev/sda1: LABEL="data_usb" UUID="9b70c4bf-6b40-4be3-9cb7-030db682ad35"
VERSION="1.0" TYPE="ext4" USAGE="filesystem" PART_ENTRY_SCHEME="gpt"
PART_ENTRY_UUID="3d18a590-d329-4a82-be02-c3588098d625"
PART_ENTRY_TYPE="0fc63daf-8483-4772-8e79-3d69d8477de4"
PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048"
PART_ENTRY_SIZE="3907027087" PART_ENTRY_DISK="8:0"
Whereas dos/mbr does not:
$sudo blkid -p /dev/sda1
/dev/sda1: UUID="b786a3a4-26e7-4765-aed1-9bc472522c06" VERSION="1.0"
TYPE="ext4" USAGE="filesystem" PART_ENTRY_SCHEME="dos"
PART_ENTRY_TYPE="0x83" PART_ENTRY_FLAGS="0x80" PART_ENTRY_NUMBER="1"
PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="63997952" PART_ENTRY_DISK="8:0"
While the GPT UUID should never change, it might happen if some bogus
resizing tool is used.
So, if a LUKS-UUID is available I would always prefer it and only fall
back to partition UUIDs when not using LUKS.
Regards,
Marc
next prev parent reply other threads:[~2012-12-18 8:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 0:10 [dm-crypt] UUID question David Li
2012-12-18 0:36 ` Arno Wagner
2012-12-18 8:12 ` Marc Ballarin [this message]
2012-12-18 8:57 ` Arno Wagner
2012-12-18 16:46 ` David Li
2012-12-19 23:30 ` Sven Eschenberg
2012-12-18 8:21 ` Milan Broz
2012-12-18 8:55 ` Arno Wagner
[not found] <mailman.1.1356001202.8121.dm-crypt@saout.de>
2012-12-20 11:16 ` Yaron Sheffer
2012-12-21 1:24 ` Sven Eschenberg
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=50D02551.9050009@gmx.de \
--to=ballarin.marc@gmx.de \
--cc=dm-crypt@saout.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox