Wednesday, July 19, 2023
HomeNetworkingMethods to decide your Linux system’s filesystem varieties

Methods to decide your Linux system’s filesystem varieties


Linux programs use quite a few file system varieties – comparable to Ext, Ext2, Ext3, Ext4, JFS, XFS, ZFS, XFS, ReiserFS and btrfs. Happily, there are a variety of instructions that may have a look at your file programs and report on the kind of every of them. This put up covers seven methods to show this info.

To start, the file system varieties which might be used on Linux programs are described under.

File system varieties

Ext4 is the fourth technology of the ext file system, launched in 2008 and just about the default since 2010. It helps file programs as massive as 16 terabytes. It additionally helps limitless subdirectories the place ext3 solely helps 32,000. But it’s backward suitable with each ext3 and ext2, thus permitting them to be mounted with the identical driver. Ext4 can be very steady, extensively supported and suitable with stable state drives.

JFS is a journaling file system (thus the identify) developed by IBM for AIX Unix. It permits for fast file system restoration after a crash by logging file metadata.

XFS is at present the default file system in Crimson Hat Enterprise Linux. Because of the approach it lays out recordsdata as extents, it’s much less susceptible to fragmentation than ext4.

ZFS is a file system that started life as a part of Solar Microsystems’ Solaris OS. It offers strong information restore options and excessive storage capability and is nice for large-scale information storage.

ReiserFS is a substitute for the ext3 file system, however with higher efficiency and a few superior options.

Btrfs (which stands for “B-tree file system”) is a file system that prioritizes information integrity, fault tolerance and simple administration. It helps superior options like snapshots, built-in RAID, and copy-on-write.

Vfat is a file system sort that comprises the bootloader. It’s generally known as the “boot partition”.

Tmpfs is a file system sort which retains all of its recordsdata in digital reminiscence.

You’re unlikely to see greater than a handful of those on most Linux programs.

Instructions that show file system varieties

There are various methods to find out file system varieties on Linux. This part covers six totally different instructions and one system file. The small print supplied by the instructions usually rely upon choices used and a few require sudo privileges.

Utilizing the lsblk command

The lsblk command offers particulars on specified block gadgets. With no choices, you will note one thing like this:

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 14.9G  0 disk
├─sda1   8:1    0  600M  0 half /boot/efi
├─sda2   8:2    0    1G  0 half /boot
└─sda3   8:3    0 13.3G  0 half /dwelling
                                /
zram0  252:0    0  3.7G  0 disk [SWAP]

As you may see, it offers partition names (e.g., sda1), main and minor gadget numbers (the most important quantity is the bigger, extra generic class), RM (detachable or not), the scale, sort (disk or partition) and the mount level. An RM of 0 signifies the disk or partition just isn’t detachable.

Within the command under, the choices used particularly request that the file system sort (FSTYPE) be included.

$ lsblk -o PATH,FSTYPE,MOUNTPOINT /dev/sda
PATH      FSTYPE MOUNTPOINT
/dev/sda
/dev/sda1 vfat   /boot/efi
/dev/sda2 ext4   /boot
/dev/sda3 btrfs  /dwelling

The lsblk command with the -f choice contains file system model info, the UUIDs and each out there and used house.

$ lsblk -f
NAME   FSTYPE FSVER LABEL                 UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1 vfat   FAT32                       6E4A-5BD5                             581.4M     3% /boot/efi
├─sda2 ext4   1.0                         444b22ab-9206-4f97-b1c3-b8832d294401  609.4M    30% /boot
└─sda3 btrfs        fedora_localhost-live d961ea75-eaa0-425a-b378-fe2bc7e3a9ce    8.5G    32% /dwelling
                                                                                              /
zram0                                                                                         [SWAP]

Utilizing the blkid command

The blkid command requires the usage of sudo privilege and provides info like that proven under together with the partition names, UUIDs, block measurement, file system sort and PARTUUID (uncooked bodily storage partition UUID).

$ sudo blkid
[sudo] password for fedora:
/dev/sda2: UUID="444b22ab-9206-4f97-b1c3-b8832d294401" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="344a7c0d-2aa0-44c1-8d49-2ea763659119"
/dev/sda3: LABEL="fedora_localhost-live" UUID="d961ea75-eaa0-425a-b378-fe2bc7e3a9ce" UUID_SUB="61a2f8bf-8cec-4bbc-b426-cb1aa226d027" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="98d3521c-18b9-45e0-a5b2-b817323f8e89"
/dev/sda1: UUID="6E4A-5BD5" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="371effc8-5c7b-4838-9d9e-ee22d9d7ab55"
/dev/zram0: LABEL="zram0" UUID="1f5a53e0-6657-447b-958d-86e84482d829" TYPE="swap"

Utilizing the df command

The df command with the -T choice will show particulars for file programs within the format proven under.

$ df -T
Filesystem     Sort     1K-blocks    Used Out there Use% Mounted on
devtmpfs       devtmpfs      4096       0      4096   0% /dev
tmpfs          tmpfs      1934144       0   1934144   0% /dev/shm
tmpfs          tmpfs       773660    1596    772064   1% /run
/dev/sda3      btrfs     13974528 4447900   8879700  34% /
tmpfs          tmpfs      1934148      16   1934132   1% /tmp
/dev/sda3      btrfs     13974528 4447900   8879700  34% /dwelling
/dev/sda2      ext4        996780  303944    624024  33% /boot
/dev/sda1      vfat        613160   17780    595380   3% /boot/efi
tmpfs          tmpfs       386828     124    386704   1% /run/consumer/1000

Including the -H choice alters the numbers use to make them extra human-friendly.

$ df -Th
Filesystem     Sort      Dimension  Used Avail Use% Mounted on
devtmpfs       devtmpfs  4.0M     0  4.0M   0% /dev
tmpfs          tmpfs     1.9G     0  1.9G   0% /dev/shm
tmpfs          tmpfs     756M  1.6M  754M   1% /run
/dev/sda3      btrfs      14G  4.3G  8.5G  34% /
tmpfs          tmpfs     1.9G   16K  1.9G   1% /tmp
/dev/sda3      btrfs      14G  4.3G  8.5G  34% /dwelling
/dev/sda2      ext4      974M  297M  610M  33% /boot
/dev/sda1      vfat      599M   18M  582M   3% /boot/efi
tmpfs          tmpfs     378M  124K  378M   1% /run/consumer/1000

Utilizing the mount command

The mount command shows file system varieties together with quite a lot of extra info. The command under ensures that solely particulars about disk gadgets are included within the output.

$ mount | grep ^/dev
/dev/sda3 on / sort btrfs (rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/root)
/dev/sda3 on /dwelling sort btrfs (rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/dwelling)
/dev/sda2 on /boot sort ext4 (rw,relatime,seclabel)
/dev/sda1 on /boot/efi sort vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)

Utilizing fsck

The fsck command with the -N choice will show file system varieties with out performing a file system verify because the command usually would.

$ fsck -N /dev/sda1
fsck from util-linux 2.38.1
[/usr/sbin/fsck.vfat (1) -- /boot/efi] fsck.vfat /dev/sda1
$ fsck -N /dev/sda3
fsck from util-linux 2.38.1
[/usr/sbin/fsck.btrfs (1) -- /] fsck.btrfs /dev/sda3

Utilizing the file command

The file command as proven under will show the file system sort together with the gadget label, sector measurement and different particulars.

$ sudo file -sL /dev/sda3
/dev/sda3: BTRFS Filesystem label "fedora_localhost-live", sectorsize 4096, nodesize 16384, leafsize 16384, UUID=d961ea75-eaa0-425a-b378-fe2bc7e3a9ce, 4340412416/14309916672 bytes used, 1 gadgets

Analyzing /and so on/fstab

It’s also possible to retrieve info on file system varieties by wanting on the /and so on/fstab file.

$ cat /and so on/fstab

#
# /and so on/fstab
# Created by anaconda on Sat Jan 28 20:15:39 2023
#
# Accessible filesystems, by reference, are maintained below '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more information.
#
# After modifying this file, run 'systemctl daemon-reload' to replace systemd
# models generated from this file.
#
UUID=d961ea75-eaa0-425a-b378-fe2bc7e3a9ce /                       btrfs   subvol=root,compress=zstd:1 0 0
UUID=444b22ab-9206-4f97-b1c3-b8832d294401 /boot                   ext4    defaults        1 2
UUID=6E4A-5BD5          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=d961ea75-eaa0-425a-b378-fe2bc7e3a9ce /dwelling                   btrfs   subvol=dwelling,compress=zstd:1 0

A neater choice can be to make use of a command like what’s proven under and restrict the output to simply the mount level and file system varieties.

$ cat /and so on/fstab | grep -v ^# | awk ‘{print $2,$3}’
/ btrfs
/boot ext4
/boot/efi vfat
/dwelling btrfs

Wrap-up

There are such a lot of Linux instructions prepared to offer particulars on file system varieties that selecting a favourite or two and setting them up as aliases could be a good suggestion!

Copyright © 2023 IDG Communications, Inc.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments