blkid man page needs to document BLKID_DEBUG values to help diagnose device type conflicts

Bug #452503 reported by Brian Murray
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Binary package hint: util-linux

My swap partition is no longer being mounted in karmic as blkid does not recognize it and exits with error code 2. It used to be LUKS partition, but I long ago mkswapped over it.

This can be recreated using the following procedure:

Works
1) dd if=/dev/zero of=/tmp/works bs=1M count=1
2) mkswap /tmp/works
3) file /tmp/works (appears as swap)
4) blkid /tmp/works (TYPE="swap")

Not work
1) dd if=/dev/zero of=/tmp/busted bs=1M count=1
2) dd if=<(printf "LUKS\xba\xbe") of=/tmp/busted conv=nocreat,notrunc
3) mkswap /tmp/busted
4) file /tmp/busted (appears as swap)
5) blkid /tmp/busted (nothing)
6) echo $? (return code 2)

Additionally using blkid from Jaunty, package version 2.14.2-1ubuntu4, shows the TYPE as swap.

ProblemType: Bug
Architecture: amd64
Date: Thu Oct 15 13:09:16 2009
DistroRelease: Ubuntu 9.10
Package: util-linux 2.16-1ubuntu4
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
ProcVersionSignature: Ubuntu 2.6.31-14.46-generic
SourcePackage: util-linux
Uname: Linux 2.6.31-14-generic x86_64

Revision history for this message
Brian Murray (brian-murray) wrote :
Kees Cook (kees)
description: updated
description: updated
tags: added: regression-potential
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

As you've proved here, you've deliberately put two types of metadata into your partition.

We've never supported that. Remember that in jaunty we used vol_id, which should equally not recognise your swap partition.

Changed in util-linux (Ubuntu):
status: New → Won't Fix
Revision history for this message
Kees Cook (kees) wrote :

Why did it work correctly in Jaunty? Why doesn't blkid claim it's LUKS? Anyone migrating partitions around will end up with junk in them.

Changed in util-linux (Ubuntu):
status: Won't Fix → Confirmed
Kees Cook (kees)
summary: - blkid fails to recognize swap partition / file
+ mkswap fails to fully wipe swap partition / file (resulting in blkid not
+ seeing it)
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: mkswap fails to fully wipe swap partition / file (resulting in blkid not seeing it)

mkswap has code to do this:

http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commit;h=ff3bed806863d1c2075d0efda70b39ea6af9ecba

Which version of mkswap did you use to create the swap partition?

Changed in util-linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Kees Cook (kees) wrote :

Karmic: util-linux 2.16-1ubuntu4

Changed in util-linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kees Cook (kees) wrote :

mkswap: /tmp/busted: warning: don't erase bootbits sectors
        on whole disk. Use -f to force.

I wasn't reading output -- I saw the UUID go by and ignored the rest. Okay, next, how about blkid growing a way to report why it refused to identify a partition.

Changed in util-linux (Ubuntu):
status: Confirmed → Invalid
importance: Undecided → Wishlist
status: Invalid → Confirmed
summary: - mkswap fails to fully wipe swap partition / file (resulting in blkid not
- seeing it)
+ blkid needs --verbose to report device type conflicts
tags: removed: regression-potential
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote : Re: blkid needs --verbose to report device type conflicts

you can get detailed debug output from blkid by doing:

    $ sudo su -
    # BLKID_DEBUG=0xffff blkid

As far as I know every mkfs.* should erase the whole superblock so that these bogus signatures are not left floating around and if they don't it's a bug in the mkfs utility. There's absolutely no way blkid can tell which signature is the correct one.

Kees Cook (kees)
summary: - blkid needs --verbose to report device type conflicts
+ blkid man page needs to document BLKID_DEBUG values to help diagnose
+ device type conflicts
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

You should never need to document debugging stuff anywhere other than upstream (where this is all documented in a ML post)

Newer blkid is more verbose about error reporting (and can be made to explain it's issue), so marking this Invalid

Changed in util-linux (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.