Network and System Administration Three
Network and System Administration Three
Network and System Administration Three
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 8.1G 11G 44% /
/dev/sdb1 100G 50G 50G 50% /mnt/data
In the above example, the df command shows the size, used space, available space, and
utilization percentage of mounted file systems.
du: It estimates file and directory space usage. For example:
$ du -sh /var/log
2.5G /var/log
In the above example, the du command displays the total size of the /var/log directory.
3.1.5 Configuring Disk Quotas:
Disk quotas allow system administrators to limit the amount of disk space a user or a group can
use on a file system. This helps in preventing users from consuming excessive disk space.
The disk quota configuration involves the following steps:
1. Enable quota support on the file system by adding the appropriate options to
the /etc/fstab fileand remounting the file system.
2. Initialize the quota database using the quotacheck command.
3. Set the quota limits for users or groups using the edquota command.
4. Enable the quotas using the quotaon command.
Here's an example of configuring disk quotas for a user on the /home file system:
1. Edit the /etc/fstab file and add the usrquota option to the /home file system entry:
/dev/sdb1 /home ext4 defaults,usrquota 0 0
2. Remount the /home file system to enable the quota support:
basic
$ sudo mount -o remount /home
3. Initialize the quota database:
$ sudo quotacheck -cug /home
4. Set the quota limits for a user:
$ sudo edquota username
This opens a text editor where you can specify the soft and hard limits for disk space usage for
the user.
5. Enable the quotas: