In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "the application and actual operation of Linux disk quota". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the application and actual operation of Linux disk quota".
Application and implementation of disk quota (Quota) disk quota (Quota)
Quota can fairly allocate the disk capacity on the system to users; the resources allocated can be disk capacity (block) or the number of files that can be created (inode)
The limitations of Quota can include important items such as soft/hard/grace time:
Hard: indicates that the user's usage will never exceed this limit. Take the above setting as an example, the disk capacity that the user can use will never exceed 500MBytes. If it exceeds this value, the system will lock the user's disk usage rights.
Soft: indicates that when the user is below the soft limit (400MBytes in this case), the disk can be used normally, but if it exceeds the soft and is lower than the hard limit (between 400~500MBytes), each time the user logs in to the system, the system will actively issue a warning message that the disk is about to be full, and a grace time will be given. However, if the user reduces the capacity below the soft limit again during the grace time countdown period, the grace time will stop.
Countdown grace time (grace time): Quota is limited for the entire filesystem, and the XFS file system can limit directories!
The use of Quota must be supported by both core and file system. The parameters of the file system must contain usrquota, grpquota, prjquota:
Uquota/usrquota/quota: settings for user accounts
Gquota/grpquota: settings for groups
Pquota/prjquota: set for a single directory, but not with grpquota!
The instructions implemented by Quota's xfs_quota are report, print, limit, timer.... Wait for instructions
Software disk Array (Software RAID)
Disk array (RAID) can be divided into hardware and software. Linux operating system can support software disk array, which can be achieved through mdadm suite.
Disk array creation is based on capacity, performance, data reliability, etc.
The common levels created by disk arrays are raid0, raid1, raid1+0, raid5 and raid6.
RAID-0 (equivalent Mode, stripe): best performance
RAID-1 (Mapping Mode, mirror): full backup
RAID 1, 0, and raid 0, 1.
The performance of RAID-0 is good but the data is not secure, and the data of RAID-1 is secure but not good, so can you integrate the two to set up RAID? My pleasure! That's RAID 1-0 or RAID 0-1. The so-called RAID 1 zero is: (1) first let the two disks form RAID 1, and there are two sets of such settings; (2) the two groups of RAID 1 are formed into a set of RAID 0. This is RAID 1: 0! On the other hand, RAID 01st means to form RAID-0 first and then RAID- 1.
RAID 5: balanced consideration of performance and data backup
RAID-5 requires at least three or more disks to form this type of disk array. The data writing of this disk array is a bit similar to RAID-0, but during each cycle of writing (striping), an appositive check data (Parity) is added to each disk, which records the backup data of other disks for rescue in the event of disk corruption.
Advantages of disk array
When it comes to foaming, what's the point? In fact, if your system needs disk arrays, the point is:
Data security and reliability: it does not refer to the security of network information, but whether the data can be safely rescued or used when the hardware (refers to disk) is damaged.
Read and write performance: for example, RAID 0 can enhance read and write performance, so that your system Imax O part can be improved.
Capacity: multiple disks can be combined, so a single file system can have considerable capacity.
The device file name of the hardware disk array is the same as SCSI, while software RAID is / dev/md [0-9]
Create RAID with mdadm
[root@study] # mdadm-- detail / dev/md0 [root@study ~] # mdadm-- create / dev/md [0-9]-- auto=yes-- level= [015]-- chunk=NK\ >-- raid-devices=N-- spare-devices=N / dev/sdx / dev/hdx... Options and parameters:-- create: the option to create RAID;-- auto=yes: decide to create the next software disk array device, namely / dev/md0, / dev/md1...--chunk=Nk: determine the chunk size of this device, which can also be regarded as stripe size, usually 64K or 512K. -- raid-devices=N: devices that use several disks (partition) as disk arrays-- spare-devices=N: use several disks as spare devices-- level= [015]: set the level of this set of disk arrays. There's a lot of support, but it's recommended that you just use 0,1,5-- detail: details of the disk array device that follows.
The status of the software disk array can be known through the / proc/mdstat file.
Logical scroll administrator (Logical Volume Manager)
Physical Volume, PV, solid Scroll
Volume Group, VG, scroll group
Physical Extent, PE, entity scope block
Logical Volume, LV, logical scroll
After planning through PV, VG, and LV, you can use mkfs to format your LV into a usable file system! And the capacity of this file system can be expanded or reduced in the future, and the data inside will not be affected!
LVM emphasizes "flexibility to change the capacity of the file system"; LVM-related components are: PV/VG/PE/LV and other components, can be formatted as LV the new LVM has the LVM thin volume function, can dynamically adjust disk utilization! LVM has snapshot function, snapshot can record the data content of LV, and share unchanged data with the original LV, backup and restore become very simple; XFS can flexibly resize the file system through xfs_growfs instruction
At this point, I believe you have a deeper understanding of "the application and actual operation of Linux disk quota". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.