Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.


FSTYP(8)                    System Manager's Manual                   FSTYP(8)

NAME
     fstyp - determine file system type

SYNOPSIS
     fstyp [-lsu] special

DESCRIPTION
     The fstyp utility is used to determine the file system type on a given
     device.  It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, UFS, HAMMER,
     and HAMMER2 file systems.  When the -u flag is specified, fstyp also
     recognizes certain additional metadata formats that cannot be handled
     using mount(8), such as ZFS pools.

     The file system name is printed to the standard output as, respectively:
           cd9660
           exfat
           ext2fs
           msdosfs
           ntfs
           ufs
           hammer
           hammer2
           zfs

     Note that a HAMMER file system consisting of more than one volume
     requires a path in blkdevs format.

     Because fstyp is built specifically to detect file system types, it
     differs from file(1) in several ways.  The output is machine-parsable,
     file system labels are supported, and it does not try to recognize any
     file format other than file systems.

     These options are available:

     -l     In addition to file system type, print file system label if
            available.

     -s     Ignore file type.  By default, fstyp only works on regular files
            and disk-like device nodes.  Trying to read other file types might
            have unexpected consequences or hang indefinitely.

     -u     Include file systems and devices that cannot be mounted directly
            by mount(8).

EXIT STATUS
     The fstyp utility exits 0 on success, and >0 if an error occurs or the
     file system type is not recognized.

SEE ALSO
     file(1), autofs(5), mount(8), zpool(8)

HISTORY
     The fstyp command appeared in FreeBSD 10.2.  The fstyp command appeared
     in DragonFly 4.5.  The fstyp command appeared in NetBSD 9.0.

AUTHORS
     The fstyp utility was developed by Edward Tomasz Napierala
     <trasz@FreeBSD.org> under sponsorship from the FreeBSD Foundation.  ZFS
     and GELI support was added by Allan Jude <allanjude@FreeBSD.org>.

     The fstyp utility was ported to DragonFly and NetBSD by Tomohiro Kusumi
     <tkusumi@netbsd.org>.

BUGS
     geli and hammer are currently unsupported on NetBSD.

NetBSD 10.99                    January 1, 2020                   NetBSD 10.99