How to find out the filesystem type of devices and partitions on Linux
So, I was working on a system remotely over ssh and I had to find out what filesystem was a particular partition formatted into. The thing looks trivial, but if you have been using some GUI app for this, then it won't come easy if you are working on a console. The trick in such situations is to look into the commands that deal with stuff similar to what you want, i.e disks & partitions in my case. So, I went for df, & parted.
I usually use df with "-h" option, but there is a -T option that lets you view the type of filesystems associated with the partitions and devices.
[shredder12]$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext4 14G 4.0G 9.2G 30% /
none devtmpfs 493M 288K 493M 1% /dev
none tmpfs 501M 1.6M 499M 1% /dev/shm
none tmpfs 501M 256K 500M 1% /var/run
none tmpfs 501M 0 501M 0% /var/lock
/dev/sda4 ext4 29G 18G 11G 63% /media/sda4
/dev/sda5 ext4 95G 53G 38G 59% /home
/dev/sdb1 vfat 3.8G 1.7G 2.1G 46% /media/7BAA-F896
Similarly, parted with "-l" option lists out all the devices
[shredder12]$ sudo parted -l
Model: ATA WDC WD1600BEVT-7 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 8587MB 8587MB primary ext3 boot
4 8587MB 40.0GB 31.4GB primary ext4
2 40.0GB 55.0GB 15.0GB primary ext4
3 55.0GB 160GB 105GB extended
5 55.0GB 158GB 103GB logical ext4
6 158GB 160GB 1999MB logical linux-swap(v1)
Model: HP v165w (scsi)
Disk /dev/sdb: 4010MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 31.7kB 4007MB 4007MB primary fat32 boot, lba



























1 Comment
Post new comment