Linux how to determine the file system type

Posted on in Categories last updated September 1, 2006

All files accessible in a Linux system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices and they can be remote or local file system. Linux supports numerous file system types. For example it supports Ext2,. Ext3, NFS, FA16, FAT32, NTFS,Sysfs, Procfs etc. To determine the file system type or to find out what type of file systems currently mounted you need to use command called mount or df. Type df command as follows:
$ df -TOutput:

Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hdb1     ext3    19228276  14737848   3513680  81% /
tmpfs        tmpfs      383960         4    383956   1% /dev/shm

df command report filesystem disk space usage and if you pass -T option it will report filesystem type. As you see second command displays file system type (ext3). Type, mount command as follows at shell prompt:
$ mountOutput:

/dev/hdb1 on / type ext3 (rw,errors=remount-ro)
/dev/hdb2 on /home type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
automount(pid3558) on /data type autofs (rw,fd=4,pgrp=3558,minproto=2,maxproto=4)

As you can see, second last column displays the file system type. For example first line [/dev/hdb1 on / type ext3 (rw,errors=remount-ro)] can be interpreted as follows:

  • /dev/hdb1 : Partition
  • / : File system
  • ext3 : File system type
  • (rw,errors=remount-ro) : Mount options

See also:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

19 comment

  1. > diatoid October 30, 2007
    > You can try a ‘file -s’ on the device node.

    This is best -it shows the info even device not mounted yet. So you can check the file system then mount -t proper type.

  2. [[email protected] ~]# blkid /dev/sda1
    /dev/sda1: UUID=”6fa0c372-2614-43b1-a2ed-52fc53c4ff19″ TYPE=”ext4″
    for more info you can use tune2fs -l /dev/sda1

  3. A fellow I used to know was on his first day as a linux sysadmin. The main hard disk on the primary BBS server was dangerously full, and he was tasked with clearing it out.
    He discovered the “/etc” directory was full to bursting. He reasoned, “who puts important stuff into a folder called “/etc”? So he wiped out the whole thing.

    That was his last day on the job.

Leave a Comment