Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: 784709@bugs.debian.org, util-linux@vger.kernel.org
Subject: Re: when would blkid success but not filesystem type?
Date: Thu, 21 May 2015 13:07:35 +0200	[thread overview]
Message-ID: <20150521110735.GA4730@ws.net.home> (raw)
In-Reply-To: <1432196678.28686.58.camel@debian.org>

On Thu, May 21, 2015 at 04:24:38PM +0800, Paul Wise wrote:
> In https://bugs.debian.org/784709 Jérôme Kieffer wrote:
> 
> > Here is the answer for the 3.16 kernel:
> > 
> > jerome@patagonia:~$ sudo blkid -o value -s TYPE /dev/sdb4
> > jerome@patagonia:~$ echo $?
> > 0
> ...
> > 
> > The output is the same on 3.2, as you can see on attached images.
> 
> Anyone know when blkid would return success but not the filesystem type?

 The option '-s' does not affect return code, this option controls 
 output filter only. I have improved the description in the man page 
 to make it more obvious.

 blkid returns success always when it's possible to gather any
 information about the device. The important detail is that the recent
 versions provide also PARTUUID=, so we have information about all
 (including empty) partitions!

 For example (very very old version from e2fsprogs):

    # blkid /dev/sdc1; echo $?
    2

 but the current util-linux upstream:

    #blkid /dev/sdc1; echo $?
    /dev/sdc1: PARTUUID="4b6f59ea-01"
    0


 And yes, we have PARTUUID also for MBR partitions, the method used to
 generate the UUID is the same like kernel uses for root= command
 line option.

 Note that my recommendation is to use lsblk, for example:

    # lsblk --noheading --output FSTYPE /dev/sda1
    vfat

 it reads info from udev db (libblkid is only fallback here), and it
 provides better way how to control output.


  Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2015-05-21 11:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150520145904.3e4645dd@patagonia>
2015-05-21  8:24 ` when would blkid success but not filesystem type? Paul Wise
2015-05-21 11:07   ` Karel Zak [this message]
2015-05-26  4:21     ` Paul Wise
2015-05-26  4:43       ` Paul Wise
2015-05-26  4:51       ` Bug#784709: Info received (when would blkid success but not filesystem type?) Debian Bug Tracking System
2015-05-26  9:40       ` when would blkid success but not filesystem type? Karel Zak

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=20150521110735.GA4730@ws.net.home \
    --to=kzak@redhat.com \
    --cc=784709@bugs.debian.org \
    --cc=util-linux@vger.kernel.org \
    /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