Chapter Three
Chapter Three
To give full permission(read, write and execute) for user kemal to file
a.txt
For further example, you can get the writing syntax of ACLs
Setfacl --help Quiz(3%)
1. Write linux command to give read only permission for user john to
file1.txt using ACLs
…Cont’d
To view ACLs
Managing Disk Quotas
❏ disk quotas are used to limit the amount of disk space that users and groups
can use on a file system.
❏ This is an important feature for system administrators who need to manage
disk space usage and prevent users from filling up the file system.
A. Enabling disk quotas: Disk quotas must be enabled on a file system before they can
be used. This is typically done by editing the file system /etc/fstab file and adding the
usrquota and/or grpquota options to the mount options for the file system. For
example:
This line enables user and group quotas on the /home file system
…Cont’d
B. Setting up quotas: Once disk quotas are enabled, quotas must be set up for individual users or groups.
This is done using the edquota command. The syntax of the command is as follows:
OR
…Cont’d
C. Monitoring quotas: Once quotas are set up, they can be monitored using the quota command. The syntax
of the command is as follows:
OR
This command displays the current disk usage and quota limits for the specified
user or group.
…Cont’d
D. Adjusting quotas: Quotas can be adjusted using the edquota command. The administrator can edit the
quota configuration file for a user or group to increase or decrease their quota limits.
Overall, managing disk quotas is an important task in Linux and other Unix-like
systems that system administrators need to perform to manage disk space usage and
prevent users from filling up the file system. By enabling, setting up, monitoring, and
adjusting quotas, system administrators can effectively manage disk usage and ensure
that disk space is available for critical system processes and applications.
Chapter Three
File System and Management of Data storage
File System
● Partitioning: This involves dividing a hard drive or other storage device into multiple
partitions, each with its own file system.
● Formatting: Once a partition has been created, it needs to be formatted with a file system.
● Mounting: When a file system is mounted, it is made available for use by the operating
system and applications.
● Managing file permissions: File system administrators need to manage permissions for
files and directories, determining who has access to them and what actions they can
perform.
…Cont’d
• Monitoring disk usage: It's important to keep track of how much disk
space is being used and ensure that there is enough free space available for
new files and applications.
• Backing up and restoring data: Backing up important files and data is
crucial for preventing data loss in the event of a system failure or other
disaster. File system administrators need to develop and implement backup
and recovery strategies to ensure data can be restored if necessary.
Partitioning disk with fdisk and parted
● fdisk is a command-line utility for partitioning disks on Linux systems. Here's how you can use it to partition a
disk:
○ Step1 Open terminal
sda has 3
partitions:
sda1,sda2,sda5
sdb has no
partitions
create partitions in disk sdb
to ceate new
partition
…Cont’d
● parted is another command-line utility for partitioning disks on Linux systems. Here's how you can use it to
partition a disk:
1. Open a terminal window and log in as the root user or use the sudo command to run parted with root privileges.
2. Type "parted /dev/sdX" to start parted, where "X" is the letter corresponding to the disk you want to partition. For
example, if you want to partition the first hard disk in the system, you would use "parted /dev/sda".\
3. Type mkpart <partition type> <file type> <starting sector> <ending sector>
4. Once you have created all of the partitions you need, use the "quit" command to exit parted.
…Cont’d
Newly created
partition
..Cont’d
To delete partition
Open Terminal
sudo fdisk /dev/sdx where x is partition name eg. /dev/sda
Enter d to delete partition
Enter partition number eg. if partition is at /dev/sda1 Enter 1
Enter w to write on the disk
quit
mkfs.ext4 /dev/sda1
…Cont’d
● Both fdisk and parted are powerful tools for partitioning disks, and can
be used to create complex partition layouts with multiple partitions of
different types and sizes. It's important to be careful when using these
tools, as errors or mistakes can result in data loss or other problems. Be
sure to backup important data before making any changes to disk
partitions.
Creating a file system
● To create a new file system on a disk partition, you can use the
mkfs command followed by the type of file system you want to
create (e.g., ext4, xfs, btrfs, etc.) and the name of the partition you
want to format.
This command will format the first partition on the first hard disk in
the system with the ext4 file system.
Mounting a file system
● To mount a file system, you first need to create a mount point (i.e.,
a directory where the file system will be accessible). You can use
the mkdir command to create a new directory for this purpose.
Maintaining a file system
To make the swap partition persistent across reboots, add an entry for it in the
/etc/fstab file.
Determining disk usage with du and df
● Disk quotas are a feature of the Linux file system that allows
system administrators to limit the amount of disk space a user or
group can use.
● To configure disk quota,
go to /et/fstab and adding user and group quota
In the fstab file, the number 2 specifies the order in which file systems are checked
for errors at boot time.
Logical volume management and RAID
combined with multiple disk arrays give you the reliability and performance.
RAID 0
Two copies of the data are held on two physical disks, and the data is
always identical.
Twice as many disks are required to store the same data when compared
to RAID 0.