Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | Linux and Unix OS |
Time | 2m |
- tune2fs command
- lsfs command
- fstyp command
- df command
Linux command to show file system characteristics
Pass the -l option to list the contents of the filesystem superblock, including the current values of the parameters that can be set via tune2fs command. Type the following command:
# tune2fs -l /path/to/device | more
# tune2fs -l /dev/sda2 | grep
# tune2fs -l /dev/cciss/c1d1p1
# tune2fs -l /dev/mapper/data
Sample outputs:
Fig.01: tune2fs command in action
# tune2fs -l /dev/md0 | grep 'writes'
Sample outputs:
Lifetime writes: 90 GB
Please note that above commands works on on ext2/ext3/ext4 filesystems under Linux only. Hence for xfs, we need to use the following commands.
Linux displaing XFS filesystem geometry information
The xfs_info command shows geometry information about an existing XFS filesystem. The mount-point argument is the pathname of a directory where the filesystem is mounted. For instance if /dev/xdvf mounted as follows on AWS EC2 VM, we run:
$ sudo xfs_info /backup/
Here is what we see:
meta-data=/dev/xvdf isize=512 agcount=4, agsize=26214400 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=0 data = bsize=4096 blocks=104857600, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=51200, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
The block-device or file-image contain a raw XFS filesystem as follows (unmounted XFS file systems):
$ sudo xfs_info /dev/xvdf
HP-UX Unix specific command to see characteristics of file systems
The fstyp command allows the user to determine the file system type of a mounted or unmounted file system. You need to pass special a device special file such as /dev/dsk/c1t6d0 and -v option to see information about the file system’s superblock.
# fstyp -v /dev/vg02/lvol2
# fstyp -v /dev/dsk/c1t6d0 | more
# df -g /dev/vg02/lvol2
The ‘df -g‘ command the entire structure of the file system.
Displaying the characteristics of file systems on Solaris Unix
Type the following command:
# fstyp -v /dev/md/dsk/d200
# fstyp -v /dev/md/dsk/d200 | more
# df -g /dev/md/dsk/d200
AIX unix specific command
The lsfs command displays characteristics of file systems, such as mount points, automatic mounts, permissions, and file system size. The FileSystem parameter reports on a specific file system:
# lsfs -q /dev/hd10admin
# lsfs -q / | more
Summing up
We explained various Linux and Unix command show your servers file system characteristics.
🐧 3 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
a description of what all those characteristics means would be neat :)
And for XFS?
This article’s info about tune2fs