6.8 Evaluate and compare the basic file system features and options (findmnt, remount)

I'm Vijay Kumar Singh, a Linux, DevOps, Cloud enthusiast learner and contributor in shell scripting, Python, networking, Kubernetes, Terraform, Ansible, Jenkins, and cloud (Azure, GCP, AWS) and basics of IT world. 💻✨ Constantly exploring innovative IT technologies, sharing insights, and learning from the incredible Hashnode community. 🌟 On a mission to build robust solutions and make a positive impact in the tech world. 🚀 Let's connect and grow together!
#PowerToCloud
Introduction:
The findmnt command is a useful tool for listing all mounted file systems on a Linux system and provides information about their targets, sources, file system types, and mount options. Below, I'll summarize the basic features and options of findmnt, as well as demonstrate how to use the remount command to change mount options on a mounted file system.
Basic Features and Options of findmnt:
TARGET: Shows the target mount point.
SOURCE: Shows the source device or location.
FSTYPE: Shows the type of file system.
OPTIONS: Shows the mount options for each file system.
Examples of findmnt Usage:
List all mounted file systems:
findmntList mounted file systems of specific types (e.g., xfs):
findmnt -t xfsChange mount options of a mounted file system (e.g., remount as read-only):
sudo mount -o remount,ro /dev/vdb2 /mntView mounted file systems after changing mount options:
findmnt -t xfsApply mount options persistently using
/etc/fstab:sudo vim /etc/fstab # Add or update the entry for /dev/vdb2 to include desired mount options /dev/vdb2 /mnt xfs ro,noexec,nosuid 0 0Reboot the system to apply changes made in
/etc/fstab:sudo systemctl rebootVerify changes to mount options after reboot:
findmnt -t xfs
Using remount to Change Mount Options:
The remount option is used with the mount command to change mount options on a mounted file system without unmounting it first. This is useful for applying changes to mount options while the file system is in use.
sudo mount -o remount,rw,noexec,nosuid /dev/vdb2 /mnt
This command remounts the /dev/vdb2 file system at the /mnt mount point with the specified mount options (rw, noexec, nosuid). It allows for dynamic changes to mount options without requiring the file system to be unmounted and remounted.






