- Understanding the /proc/mounts, /etc/mtab and /proc/partitions files
- The /proc/mounts file
- The mtab file
- The /proc/partitions file
- Some more articles you might also be interested in …
- How To List All Partitions Of A Disk In Linux?
- List Partitions With fdisk
- List Partitions with /proc/partitions
- List Partitions with parted
- List Partitions with blkid
- List Partitions with lsblk
Understanding the /proc/mounts, /etc/mtab and /proc/partitions files
Linux provides you with many tools for modifying file systems after applying them to storage devices. In this post, we will learn about many OS configurations file which holds the mount point information.
The /proc/mounts file
The /proc/mounts file lists the status of all currently mounted file systems in a format similar to fstab: the system’s name, mount point, file system type, etc. It is actually not a real file, but part of the virtual file system that represents the status of mounted objects as reported by the Linux kernel. Typically, you’d read this “file” using a command like cat in order to get the details you’re looking for.
Note that /proc/mounts lists all file systems, not just those on storage drives and partitions. It may not be the most readable tool to use in case you’re only looking for drive information.
The mtab file
The /etc/mtab file is very similar to the /proc/mounts file in that it reports the status of currently mounted file systems. However, /proc/mounts is typically more accurate and include more up-to-date information about the file systems.
The /proc/partitions file
The /proc/partitions file example:
Some more articles you might also be interested in …
How To List All Partitions Of A Disk In Linux?
Operating systems use storage or disks to save data persistently. Disks are used with partitions to manage them easily. Generally operating system and data partitions are placed separately. Home directory of the Linux is separated because a problem in the home directory like fulling do no effect to the general system. Modern Linux system use a lot of partitions. And here is the question How can I list partitions exists in my Linux system.
List Partitions With fdisk
fdisk is number one tool used by system administrators to manage disk. fdisk provides creating, deleting, listing of partitions. We need to use sudo in order to get root privileges.
- There is a lot of information from system administrator perspective.
- /dec/vda is disk to list partitions
- /dev/vda1 is the partition of the disk
List Partitions with /proc/partitions
We can get more simpler list by using kernel provided information like below
- /proc/partitions provides information about partitions in a simple manner
- vda1 is a partition
List Partitions with parted
Parted is popular application especially creating, deleting partitions and file systems. We can use parted to list partitions too. We will also use -l option in order to list partitions.
Disk information like Model, Sector Size and Partition Table type is also provided.
List Partitions with blkid
blkid is a command which will list block information with the related ID or UUID. This will also print partitions too. We need to provide sudo command too.
List Partitions with lsblk
lsblk is generally used to get mount points of the partitions but also used to list partitions. This command will list partitions and disk in a tree form.
As we can see that fedora-root and fedora-swap are partitions created in the sda . There is also information like partition and disk size, type and mount point.