Re: how to identify filesystem type

From: Andries Brouwer
Date: Sat Aug 21 2004 - 03:53:35 EST


On Fri, Aug 20, 2004 at 11:25:21PM -0400, Theodore Ts'o wrote:

> > Consequently, "blkid" is a really bad name. It gives no indication
> > of the guessed nature of its results.
> >
> > (I see that my current version is also broken:
> > # blkid -v
> > blkid 1.0.0 (12-Feb-2003)
> > # blkid
> > ...
> > /dev/sda4: LABEL="ZIP-100" UUID="34D8-1C07" TYPE="msdos"
> > /dev/sda1: UUID="1ac5969c-8fdf-4f69-934a-c6103d93c05d" TYPE="ext2"
> > /dev/sdb4: LABEL="ZIP-100" UUID="34D8-1C07" TYPE="msdos"
> > /dev/sdb1: LABEL="CF_CARD032M" UUID="2001-1207" TYPE="msdos"
> > ...
> > Here no /dev/sda1 and no /dev/sdb4 exist.)
>
> Blkid deliberately doesn't revalidate devices without any command-line
> arguments, because certain devices might timeout or block for a
> long-time. If you use "blkid /dev/sdb4", or use the library
> interfaces, it will revalidate any entries found in the cache file
> before returning them.

Yes:

# blkid
...
/dev/sda4: LABEL="ZIP-100" UUID="34D8-1C07" TYPE="msdos"
/dev/sda1: UUID="1ac5969c-8fdf-4f69-934a-c6103d93c05d" TYPE="ext2"
/dev/sdb4: LABEL="ZIP-100" UUID="34D8-1C07" TYPE="msdos"
...
# blkid /dev/sda1
# blkid /dev/sdb4
# blkid
...
/dev/sda4: LABEL="ZIP-100" UUID="34D8-1C07" TYPE="msdos"
/dev/sda1: UUID="1ac5969c-8fdf-4f69-934a-c6103d93c05d" TYPE="ext2"
/dev/sdb4: LABEL="ZIP-100" UUID="34D8-1C07" TYPE="msdos"
...
#

So, the cache file is not updated.
Moreover, the cache file has never been correct - there is only
one ZIP drive here and it is /dev/sda. The disk inside has only
one nonempty partition, and it is /dev/sda4.
The command # blkid -c /dev/null does not list these two bogus
entries, and a new /etc/blkid.tab is written, but a subsequent
command # blkid again lists the bogus entries.
Doing # rm /etc/blkid.tab* by hand helps.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/