All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH e2fsprogs] - detect LVM2 PVs in libblkid
Date: Tue, 19 Feb 2008 06:27:31 -0500	[thread overview]
Message-ID: <20080219112731.GV25098@mit.edu> (raw)
In-Reply-To: <47A1074F.8090909@redhat.com>

On Wed, Jan 30, 2008 at 05:25:03PM -0600, Eric Sandeen wrote:
> The anaconda folks are now using blkid instead of hand-rolled
> tests for filesystem type at install time, but they had one
> more request:
> 
> Bugzilla Bug 409321: RFE: information on blkdevs "formatted" as PVs
> https://bugzilla.redhat.com/show_bug.cgi?id=409321
> 
> The attached patch does the right thing for me on my sample
> set of exactly 1 PV...
> 
> Any issues with reporting back something which is not actually
> a filesystem ("lvm2pv") ?
> 
> [root@host]# misc/blkid -c /dev/null /dev/sda2
> /dev/sda2: UUID="guOQGdcOE3IafCm0190XkPZTy5fCEanQ" TYPE="lvm2pv" 
> [root@host]# pvs -o pv_name,pv_uuid
>   PV         PV UUID                               
>   /dev/sda2  guOQGd-cOE3-IafC-m019-0XkP-ZTy5-fCEanQ

The patch works for me, but it would seem the right thing would be
print the UUID without the hyphens, i.e.:

        guOQGdcOE3IafCm0190XkPZTy5fCEanQ

instead of

	guOQGd-cOE3-IafC-m019-0XkP-ZTy5-fCEanQ

After all, pvscan prints it with the hyphens, and blkid returns uuid's
with the hyphens for other filesystems as well.  And removing the
hyphens aren't hard; "tr -d -" will do it.

It's not that hard to convert from one to the other; this will do it:

	for (i=0, b=1, p=uuid, q=label->pv_uuid; i <= 32; i++, b = b << 1) {
		if (b & 0x4444440)
			*p++ = '-';
		*p++ = *q++;
	}

This shouldn't screw up the anaconda folks, since they just need to
know the filesystem type, right?  That's all vol_id seems to return in
any case.

						- Ted

  reply	other threads:[~2008-02-19 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 23:25 [PATCH e2fsprogs] - detect LVM2 PVs in libblkid Eric Sandeen
2008-02-19 11:27 ` Theodore Tso [this message]
2008-02-19 15:02   ` Eric Sandeen
2008-02-19 15:42     ` Theodore Tso

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=20080219112731.GV25098@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@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.