Before using the fdisk or parted utilities to create or modify a partition, it’s Important to check currently available free space along with mounted filesystems. That process is made easy with the df and mount commands. The following example illustrates how the df command displays the total, used, and available free space on all currently mounted filesystems.
[root@server1 ~]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/vda2 8063408 2158968 5494840 29% /
tmpfs 384576 0 384576 0% /dev/shm
/dev/vda1 495844 32140 438104 7% /boot
/dev/vda5 1007896 17716 938980 2% /home
/dev/sr0 2381288 2381288 0 100% /media
The second command, mount, lists the way each filesystem is formatted. In this case, examine the partition represented by device /dev/vda5 mounted with the ext4 file type on the /home directory. It separates the directories of regular users in a dedicated partition.
[root@server1 root]# mount
/dev/vda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/vda1 on /boot type ext4 (rw)
/dev/vda5 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /tmp type none (rw,bind)
/var/tmp on /var/tmp type none (rw,bind)
/home on /home type none (rw,bind)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sr0 on /media type iso9660 (ro)
[root@server1 ~]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/vda2 8063408 2158968 5494840 29% /
tmpfs 384576 0 384576 0% /dev/shm
/dev/vda1 495844 32140 438104 7% /boot
/dev/vda5 1007896 17716 938980 2% /home
/dev/sr0 2381288 2381288 0 100% /media
The second command, mount, lists the way each filesystem is formatted. In this case, examine the partition represented by device /dev/vda5 mounted with the ext4 file type on the /home directory. It separates the directories of regular users in a dedicated partition.
[root@server1 root]# mount
/dev/vda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/vda1 on /boot type ext4 (rw)
/dev/vda5 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /tmp type none (rw,bind)
/var/tmp on /var/tmp type none (rw,bind)
/home on /home type none (rw,bind)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sr0 on /media type iso9660 (ro)