Util-Linux package development
 help / color / mirror / Atom feed
* when would blkid success but not filesystem type?
       [not found] <20150520145904.3e4645dd@patagonia>
@ 2015-05-21  8:24 ` Paul Wise
  2015-05-21 11:07   ` Karel Zak
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Wise @ 2015-05-21  8:24 UTC (permalink / raw)
  To: 784709, util-linux

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

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?
This is util-linux 2.25.2-6 with Linux 3.16/3.2 and an extended partition.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: when would blkid success but not filesystem type?
  2015-05-21  8:24 ` when would blkid success but not filesystem type? Paul Wise
@ 2015-05-21 11:07   ` Karel Zak
  2015-05-26  4:21     ` Paul Wise
  0 siblings, 1 reply; 6+ messages in thread
From: Karel Zak @ 2015-05-21 11:07 UTC (permalink / raw)
  To: 784709, util-linux

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: when would blkid success but not filesystem type?
  2015-05-21 11:07   ` Karel Zak
@ 2015-05-26  4:21     ` Paul Wise
  2015-05-26  4:43       ` Paul Wise
                         ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paul Wise @ 2015-05-26  4:21 UTC (permalink / raw)
  To: 784709, util-linux

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

On Thu, 21 May 2015 13:07:35 +0200 Karel Zak wrote:

> The option '-s' does not affect return code ...  we have information
> about all (including empty) partitions!

Ok, I see. Sounds like the proposed patch is appropriate then.

https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=0001-Fix-by-forcing-fs-type-to-not-detected-if-not-named.patch;att=1;bug=784709

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

That has the same issue:

$ sudo lsblk --noheading --output FSTYPE /dev/sda2 ; echo $?

0

I think for our purposes we would need --nodeps too.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: when would blkid success but not filesystem type?
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Paul Wise @ 2015-05-26  4:43 UTC (permalink / raw)
  To: 784709, util-linux

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

On Tue, 2015-05-26 at 12:21 +0800, Paul Wise wrote:
> On Thu, 21 May 2015 13:07:35 +0200 Karel Zak wrote:
> 
> > The option '-s' does not affect return code ...  we have information
> > about all (including empty) partitions!
> 
> Ok, I see. Sounds like the proposed patch is appropriate then.
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=0001-Fix-by-forcing-fs-type-to-not-detected-if-not-named.patch;att=1;bug=784709

Actually the code in question already contains a code path for when
blkid returns success but an empty string. Needs more investigation.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Bug#784709: Info received (when would blkid success but not filesystem type?)
  2015-05-26  4:21     ` Paul Wise
  2015-05-26  4:43       ` Paul Wise
@ 2015-05-26  4:51       ` Debian Bug Tracking System
  2015-05-26  9:40       ` when would blkid success but not filesystem type? Karel Zak
  2 siblings, 0 replies; 6+ messages in thread
From: Debian Bug Tracking System @ 2015-05-26  4:51 UTC (permalink / raw)
  To: 784709, util-linux

Thank you for the additional information you have supplied regarding
this Bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Debian Install System Team <debian-boot@lists.debian.org>

If you wish to submit further information on this problem, please
send it to 784709@bugs.debian.org.

Please do not send mail to owner@bugs.debian.org unless you wish
to report a problem with the Bug-tracking system.

-- 
784709: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=784709
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: when would blkid success but not filesystem type?
  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       ` Karel Zak
  2 siblings, 0 replies; 6+ messages in thread
From: Karel Zak @ 2015-05-26  9:40 UTC (permalink / raw)
  To: 784709, util-linux

On Tue, May 26, 2015 at 12:21:36PM +0800, Paul Wise wrote:
> On Thu, 21 May 2015 13:07:35 +0200 Karel Zak wrote:
> 
> > The option '-s' does not affect return code ...  we have information
> > about all (including empty) partitions!
> 
> Ok, I see. Sounds like the proposed patch is appropriate then.
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=0001-Fix-by-forcing-fs-type-to-not-detected-if-not-named.patch;att=1;bug=784709
> 
> >  Note that my recommendation is to use lsblk, for example:
> 
> That has the same issue:
> 
> $ sudo lsblk --noheading --output FSTYPE /dev/sda2 ; echo $?
> 
> 0

 Why do you want rely on return code? It is not error when 
 FS type is undefined/unknown. All you need is to check result.

  FSTYPE=$(lsblk --nodeps --noheading --output FSTYPE /dev/sda2)
  [ -n "$FSTYPE" ] && echo $FSTYPE

> I think for our purposes we would need --nodeps too.

 Yes.

    Karel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-26 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox