Bug 442937 - libblkid sees lvm2pv as swap
libblkid sees lvm2pv as swap
Product: Fedora
Classification: Fedora
Component: e2fsprogs (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
Depends On:
Blocks: F9Blocker
  Show dependency treegraph
Reported: 2008-04-17 14:00 EDT by Jeremy Katz
Modified: 2008-04-18 15:21 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-18 13:55:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
fix (1.27 KB, patch)
2008-04-17 14:00 EDT, Jeremy Katz
no flags Details | Diff

  None (edit)
Description Jeremy Katz 2008-04-17 14:00:32 EDT
libblkid ends up seeing an lvm2pv as a swap partition instead because swap is
earlier in the table.  lvm2pv should probably be the first thing probed instead
of the last as it's a container.  See attached patch
Comment 1 Jeremy Katz 2008-04-17 14:00:32 EDT
Created attachment 302779 [details]
Comment 2 Eric Sandeen 2008-04-17 18:00:15 EDT
Bleah, what a mess.

Neither mkswap nor pvcreate does a great job of zeroing other signatures around
the new signature.  For some incantations, pvcreate-then-mkswap has an initial
4k on the disk which is *identical* to mkswap-then-pvcreate.  :(

Sent a patch upstream (and to Jeremy) to check that the swap v1 header has a
valid version and page count... "pvcreate" by itself will zero those.  (pvcreate
-u <blah> will not, unfortunately, so there's still a small hole).

But, it fixes Jeremy's case:

# blkid -c /dev/null /root/md0-for-esandeen 
/root/md0-for-esandeen: UUID="kyOPnO-Biwa-PssU-PsXx-kJDW-36Ry-iZvqk5" TYPE="lvm2pv"
Comment 4 Jeremy Katz 2008-04-18 13:55:20 EDT
Patch committed and built and I tested it with my reproducer, so going to close

Note You need to log in before you can comment on or make changes to this bug.