Comments on: 7 Ways to Determine the File System Type in Linux (Ext2, Ext3 or Ext4) https://www.tecmint.com/find-linux-filesystem-type/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 12:26:10 +0000 hourly 1 By: Mallika https://www.tecmint.com/find-linux-filesystem-type/comment-page-1/#comment-1372272 Sun, 11 Oct 2020 07:54:43 +0000 http://www.tecmint.com/?p=24859#comment-1372272 Note that,

# mkfs -t ext4 /tmp/image1

will create a ext2 filesystem on image1, if its not big enough (warning “Filesystem too small for a journal” means a filesystem without a journal, a.k.a. ext2, is created)

If you don’t realize this and nevertheless mount it as ext4. The df and mount methods above will mirror back ext4:

$ df -Th /tmp/mnt*
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/loop4     ext4 1003K   24K  908K   3% /tmp/mnt1
/dev/loop5     ext4  987K   33K  812K   4% /tmp/mnt2
$ mount | grep mnt
...
/home/mallikab/image1 on /tmp/mnt1 type ext4 (rw,relatime,seclabel)
/home/mallikab/image2 on /tmp/mnt2 type ext4 (rw,relatime,seclabel,data=ordered)

but fsck and file reveal the true filesystem:

$ fsck -N /tmp/mnt1
fsck from util-linux 2.23.2
[/sbin/fsck.ext2 (1) -- /tmp/mnt1] fsck.ext2 /tmp/mnt1 
$ fsck -N /tmp/mnt2
fsck from util-linux 2.23.2
[/sbin/fsck.ext4 (1) -- /tmp/mnt2] fsck.ext4 /home/mallikab/image2 

$ file -sL /home/mallikab/image2 
/home/mallikab/image2: Linux rev 1.0 ext4 filesystem data, UUID=b4e8e086-54ca-4d9d-9f38-32bbed211e6b (needs journal recovery) (extents) (64bit) (huge files)
$ file -sL /home/mallikab/image1
/home/mallikab/image1: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=09b3a8c9-0b6d-43c5-b195-c45f6c091765 (extents) (64bit) (huge files)

hm, although fsck doesn't indicate ext2 unless the images are mounted, i.e.
$ fsck -N ~/image1
fsck from util-linux 2.23.2
[/sbin/fsck.ext4 (1) -- /home/mallikab/image1] fsck.ext4 /home/mallikab/image1
]]>
By: Aaron Kili https://www.tecmint.com/find-linux-filesystem-type/comment-page-1/#comment-1328837 Tue, 21 Apr 2020 06:10:17 +0000 http://www.tecmint.com/?p=24859#comment-1328837 In reply to Zac.

@Zac

Thanks for the useful feedback.

]]>
By: Zac https://www.tecmint.com/find-linux-filesystem-type/comment-page-1/#comment-1328710 Mon, 20 Apr 2020 12:06:07 +0000 http://www.tecmint.com/?p=24859#comment-1328710 The only working method for me was ‘lsblk -f‘; the other replied “fuseblk“, “HPFS/NTFS/exFAT” or nothing.

]]>
By: Aaron Kili https://www.tecmint.com/find-linux-filesystem-type/comment-page-1/#comment-1318872 Thu, 27 Feb 2020 10:28:20 +0000 http://www.tecmint.com/?p=24859#comment-1318872 In reply to mic.

@mic

We very much appreciate you too. Many thanks for the feedback.

]]>
By: mic https://www.tecmint.com/find-linux-filesystem-type/comment-page-1/#comment-1318748 Wed, 26 Feb 2020 13:55:43 +0000 http://www.tecmint.com/?p=24859#comment-1318748 In reply to mic.

but I appreciate very much this page :)

]]>