1.\" $NetBSD: fstyp.8,v 1.6 2020/01/01 20:11:44 wiz Exp $ 2.\" 3.\" Copyright (c) 2017 The NetBSD Foundation, Inc. 4.\" Copyright (c) 2016 The DragonFly Project 5.\" Copyright (c) 2014 The FreeBSD Foundation 6.\" All rights reserved. 7.\" 8.\" This code is derived from software contributed to The NetBSD Foundation 9.\" by Tomohiro Kusumi. 10.\" 11.\" This software was developed by Edward Tomasz Napierala under sponsorship 12.\" from the FreeBSD Foundation. 13.\" 14.\" Redistribution and use in source and binary forms, with or without 15.\" modification, are permitted provided that the following conditions 16.\" are met: 17.\" 1. Redistributions of source code must retain the above copyright 18.\" notice, this list of conditions and the following disclaimer. 19.\" 2. Redistributions in binary form must reproduce the above copyright 20.\" notice, this list of conditions and the following disclaimer in the 21.\" documentation and/or other materials provided with the distribution. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" $FreeBSD$ 36.\" 37.Dd January 1, 2020 38.Dt FSTYP 8 39.Os 40.Sh NAME 41.Nm fstyp 42.Nd determine file system type 43.Sh SYNOPSIS 44.Nm 45.Op Fl lsu 46.Ar special 47.Sh DESCRIPTION 48The 49.Nm 50utility is used to determine the file system type on a given device. 51It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, UFS, HAMMER, and HAMMER2 file systems. 52When the 53.Fl u 54flag is specified, 55.Nm 56also recognizes certain additional metadata formats that cannot be 57handled using 58.Xr mount 8 , 59such as ZFS pools. 60.Pp 61The file system name is printed to the standard output 62as, respectively: 63.Bl -item -offset indent -compact 64.It 65cd9660 66.It 67exfat 68.It 69ext2fs 70.It 71msdosfs 72.It 73ntfs 74.It 75ufs 76.It 77hammer 78.It 79hammer2 80.It 81zfs 82.El 83.Pp 84Note that a HAMMER file system consisting of more than one volume 85requires a path in blkdevs format. 86.Pp 87Because 88.Nm 89is built specifically to detect file system types, it differs from 90.Xr file 1 91in several ways. 92The output is machine-parsable, file system labels are supported, 93and it does not try to recognize any file format other than file systems. 94.Pp 95These options are available: 96.Bl -tag -width ".Fl l" 97.It Fl l 98In addition to file system type, print file system label if available. 99.It Fl s 100Ignore file type. 101By default, 102.Nm 103only works on regular files and disk-like device nodes. 104Trying to read other file types might have unexpected consequences or hang 105indefinitely. 106.It Fl u 107Include file systems and devices that cannot be mounted directly by 108.Xr mount 8 . 109.El 110.Sh EXIT STATUS 111The 112.Nm 113utility exits 0 on success, and >0 if an error occurs or the file system 114type is not recognized. 115.Sh SEE ALSO 116.Xr file 1 , 117.Xr autofs 5 , 118.Xr mount 8 , 119.Xr zpool 8 120.Sh HISTORY 121The 122.Nm 123command appeared in 124.Fx 10.2 . 125The 126.Nm 127command appeared in 128.Dx 4.5 . 129The 130.Nm 131command appeared in 132.Nx 9.0 . 133.Sh AUTHORS 134.An -nosplit 135The 136.Nm 137utility was developed by 138.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org 139under sponsorship from the 140.Fx 141Foundation. 142ZFS and GELI support was added by 143.An Allan Jude Aq Mt allanjude@FreeBSD.org . 144.Pp 145The 146.Nm 147utility was ported to 148.Dx 149and 150.Nx 151by 152.An Tomohiro Kusumi Aq Mt tkusumi@netbsd.org . 153.Sh BUGS 154geli and hammer are currently unsupported on 155.Nx . 156