Welcome back friends. In the last video we have learned about our file system, the advanced file system and here we are going to learn more about file system in depth. So let's start. Here we are going to learn about the file system quotas, how we can set up the file system for test, managed software raid devices, configured logical volumes, set up our VM snapshots, the logical words which machine and perform backups and so on. So let us begin with the quota system. Let us understand what a quota system is.
So Linux quota system allows an administrator to establish limits on the amount of disk storage is or disk resources users can consume. Because a resource accounting must occur with every file creation quotas are implemented. Within the kernel, various required quota administration utilities are found within the quota rpm. So the we have to configure the quota system which implements within the kernel which is implemented within the kernel. It is available on the per file system basis. Individual policies for groups and users are there.
It limit by the number of blocks or I nodes. I noticed the table for file directory the system it implements both soft and hard limit. initialization consists of partition amount options, the usr quota and user group quota. The GRP quota group quota initial initialize database with quota check. You can use these commands to create user quota and check quota initial database minimums a setting quotas for the users. It is implemented on start or stop quotas you can start with quota on or stocked with quota of an option.
You can edit photos directly by Ed quota user name. From a shell from Linux shell or terminal you can write, set Kota, provide a user name, and set the file size permission, the size you want to give. And then you can define prototypical users, for which at Kota, you can edit and copy the same thing or multiple users. You can report quota status with three options. A user inspection could be followed by a quota Come on quota. Our views could be done with RDP quota.
And miscellaneous utilities could be monitored with one quota So here comes another concept after quota like we can use a quota which is a very useful or DBA database administrator. And now, we are going to explore about raid the concept of raid. When either partitions are a whole disk, which can be used to create a software devices, the ratings use the term disk is used here to denote either a whole disk or a partition, one or more disk, though, it's possible to create an array composed entirely of partitions on a single device. raid is actually multiple disks grouped together into areas to provide better performance redundancy. Generally work so empty a DM is an option that provides the administrator the aggregation reference interface to software raid. There are different RAID levels based on different classes the raid zero raid one raid two raid three read for raid five and so on.
So raid zero which is called is stripping mode raid one is called mirroring mode and raid five which is a unit of three or more days with zero or more hardest part of it is m you can understand breed in a depth wiring that once an error is created its device inside a div. For example it is used the same way as SDN or SDS Which may have been used in the examples is fair this add extra redundancies and raid devices are named as MD zero Md 123 and so on. Software RAID configuration is used to create and define great devices using MDA dm Come on. You can use that thing. You can format each raid device with a file system by reading the command mkv two Fs make a two Fs command with a minus J. Option enter provide the MD zero directly in the text.
You can taste rate device MD ADM command would allow you to check the status of your rate devices whether they are configured properly or not. Anything else are you at the software rate in recovery option is very useful. It simulates disk failures, it helps you simulate when real disk failure occurs, you have left with no option. If you have not learned by simulating the failures, you can simulate disk failures and check how we can recover it from it. recovering from a software raid disk failure replaces the failed hardware drive and powers on reconstruct partitions on the replacement right and the command a syslog, MD stat, MD ADM could be used to test and recover this pillar. Then there comes another topic that is called LVM or logical volume manager.
It creates LVM creates. lb LVM is actually a layer of abstraction that allows Easy manipulation of volumes including resizing of the file system. Basically, it creates a higher level layer of abstraction. That then traditional Linux this and partitions, it allows for greater flexibility in allocating storage. a logical volumes can be resized and moved between physical devices easily. The physical devices can be added and removed with relative ease.
LVM managed volumes can also have sensible names like a database or a home rather than somewhat cryptic SP or st revised nodes. It allows reorganization of file system across multiple physical devices. It does not actually exist, but it is a logical unit. You can configure it as per your use. That if these devices are designated as physical volumes, one or more physical volumes are used to create a volume group. The volume groups are defined with physical extents of a file size fixed size.
Logical volumes are created on physical volumes and are composed of physical extents. The physical volumes are real hardware storage, the cylinders or cones, that combination and the logical volumes are simply the directory file system and whatever you see, the file system will be created on logical volumes. This is a simple hierarchy of logical volumes. The logical volumes consisting of volume group the volume group consisting of physical volumes and physical volumes is Linux partitions. We have commands for upgrading the LVM you can resize the layer of abstraction is there at the PV create some language partitions your physical volume that means you create from a creation of volume group and Lv create for creation of logical volumes. You can create logical volume by using the command PV create to create a physical volume you can assign physical volumes to volume group.
Then you need to create a logical volumes from volume group. This is a syntax. remember from the previous background, we have to first create Linux partitions. Then we have to create physical volumes. When physical volumes are being created, we can we have to create volume groups. And after these three have been created, we have to create logical volume at last.
So the process of creation would be from first we have to execute PV create command and VG create them Lv create This is the process. After we have executed the Lv create command we have to execute the mT mT two Fs file system, it will create a logical one. We have to pass arguments based on our location desired location. The Lv create argument takes the size of the logical volumes suppose we are given a 256 Mb written by 276 capital M. You can also resize logical volumes After you have created where you can grow volumes. The lb extend can roll logical volumes, it is used to increase the size of the logical volumes. Resize to Fs can grow ESP three file systems online.
With the extend command adds a new physical volume to an existing volume group. You can similarly shrink of volumes reduce the size of the file system or logical volumes. estimate we must be reduce first. Before reducing the size of logical volumes you have to reduce the size of file system. It requires a file system check and cannot be performed online. The Lv reduce can be used to can then be used to reduce the volume after we have configured these things.
The volume groups can be reduced with PV move command and execution of VG reduce. After that, we're on the same directory. Then there comes our logical volume manager snapshots. snapshots, which are especially logical volumes that are an exact copy of an existing local volume at a time they start short is being created. snapshots are perfect for backup. snapshots are actually your current state, the configuration of every thing on your system.
It takes a symbol To a snapshot whatever that thing, it is a really a backup of live data. It is important that when taking a backup that the data sets in caution do not change. While the backup is in progress, it can lead to inconsistency and data loss. You have to take back when the statute is taken, it's a static copy of the data from the live data set. It is whichever level this can be used to make up backup. So the difference between the light backup and snapshot so we have to create a snapshot when we want to perform recovery operations.
A temporary copy of an existing data set is needed. a snapshot only comes from a space where they are different from the original logical volumes. They do not create it and then data on the unit data You can use LVM snapshots to create logical volumes from logical volumes you can create a snapshot of logical volume by Lv create command and execute a minus s argument or a snapshot. You can mount a snapshot on a directory, create an empty dir write an MK dir command and pass the minus p argument and mount a snapshot. By writing the mount command afterwards, you can remove a snapshot by unmounting and executing the Lv remove command. Then there comes another useful utility that has for archiving tools.
Tar. Suppose we have thousands of files contained in a directory and the size is actually very large. Suppose we have one GB size. I mean, we want to transfer those files in a single app. A single file within radio size we have to compress or archive those files. A tool that is used for archiving this file is tar, we have to create a tarball of those thousand files.
A tar can backup to a file or tape device. It suppose jeezum on gn Museum, and we do compressions. It can preserve file permissions, ownership and timestamps. It supports extended attributes. It uses RMT to write to an emotive device you can also add a username password for archiving. For those to access the file.
I coming tools, there are tools for that like dump and restore. to backup and restore file system, which does not work with other file systems now should only be used on unmounted file systems. File System that are read only. You can do full or incremental backups, which dump and restore command executed in a sequence. Then there comes another archiving tool that is called arcing. It efficiently creates copies of files to or from remote systems.
It is used for remote system that all power was used on the same device. It is used on remote systems. It uses secure SSH connection for transportation. The command for executing this thing is our sync Asterix dot configuration name of a file that configuration provide the location for the file and so, it is faster than SCP. It copies differences in like files. So this was about advance in depth about file system.
We have learned various things Give it a look prior to shooting certain commands, major tar files around remote archiving and other things. We will learn more in the coming videos so keep learning and keep moving ahead