< training | 13th day ACL permissions control and disk quotas in >linux, with the build of your own Linux kernel

Source: Internet
Author: User
Tags uuid disk usage

  

[[E-mail protected]~]# preface to the first of yesterday about the failure of shrinkage, open the solution; ACL permissions are also a very important point of knowledge, not difficult, but very practical;
Disk quotas generally do not need to do their own, but to understand the principle.
The rest is to compile their own Linux kernel, according to their own needs, whether it is hardware or other, you can customize, but the success of the compilation I do not guarantee that I have compiled two times before successful.

The 13th day of the classes:

[email protected]~]# today's course outline  1 The reason for the failure of the shrinkage and the solution to the machine 2 . A detailed explanation of ACL permissions in Linux 3. Learn about disk quotas 4. Compiling your own Linux kernel

Detailed Explanation:  

[[Email protected]~]# The reason for the failure of the shrinkage and the solution of No machine

  Yesterday in order to increase the capacity of lvroot, and to reduce the size of lvhome, in the process of reducing, some people may mistakenly operation first reduce the LV, and then reduce the file system, so that the problem arises, the more out of the file system, put there, so the correct method is the dynamic expansion of the order counter. The problem arises and we need to solve it.

Can not open the main reason or the boot automatically mounted home/home, and home/home itself has been damaged, so when the boot will be stuck in the location of home/home, power on the character interface, prompted to enter the password, but not into the graphical interface. Here's how to fix it:

    1. After entering the password, vim/etc/fstab, enter the file comment off the one that mounts/home, if the prompt permission is insufficient, enter not to go to fstab, then we use Mount-o REMOUNT,TW/, re-read and write to mount the root file system. That's all you can do.
    2. There is one more question to note, when viewing fstab, look at the Mount option written by/dev/.... or UUID, if it is UUID, you need to change to/dev/.... Because the file system changes, the UUID changes, so the next time you want to mount it will not be successful.
[[Email protected]~]# An explanation of ACL permissions in Linux

  ACL permissions more granular set UGO permissions, then use ACLs need to meet two points:

    1. ACLs are a feature of the file system, and some file systems are not supported, such as Ntfs,fat32.
    2. Even if support, also need to open ACL, if I open root acl,mount-o remount,acl/, if want to turn on automatically, edit/etc/fstab. (You can use mount to see if ACL permissions are turned on)

How to use ACL permissions, ACL permissions can be specific to a user, a group, to set permissions, the use of ordinary Ugo is difficult to achieve, now there is a need,/home/libin/libin.txt, I want to libin this user alone has RWX permissions to this file.

    1. Set ACL permissions, Setfacl-m U:libin:rwx/home/libin/libin.txt, and set it up. (A + sign will appear)
    2. View ACL permissions, using Getfacl/home/libin/libin.txt.

  

3.setfacl-x U:libin/home/libin/libin.txt, remove the user libin ACL permissions on this file.

4.setfacl-b/home/libin/libin. TXT to remove all ACL permissions on this file. (The + number is gone)

5. Set the default ACL permissions for the directory, meaning that the new file in this directory will inherit the ACL permissions on this directory, setfacl-d-M u:libin:rwx/home/libin, remove this default use parameter-K.

[[Email protected]~]# explain the disk quota knowledge

  What disk quotas are, it is based on setting Inode and block to limit the amount of capacity that the file system can use. (The inode and block do not understand the previous tutorial). We can set quotas manually, assuming I have a filesystem with only one inode, then all you have to do is put one file on my disk and the second one. (feel can spoof)

Disk Quota usage Requirements: (similar to ACL)

    1. File system support
    2. Turn on disk quotas, Mount-o Remount,usequota,grpquota/, also need to edit fstab on boot.

Now I set the disk quota for Libin This user under the/home partition,

1. Use Quotacheck-ugvc/home first to check disk usage space and limitations.

2. Now that I have disk quotas turned on, use Quotaon/home to open.

3. Now we use the root user to set Libin disk quotas for the/home partition, using Edquota-u-f/home Libin, where block and inode are already in use, and we set it for soft and hard Suppose I set the 15,soft to 13 on the back of the inode, which means that Libin can place 15 files in/home, and the warning is almost full by 13.

  

  4. After reaching the limit of soft, it is generally seven days to add files, seven days later even if you did not reach hard, also can not add, now we set the arrival soft after the number of days can also add files, using Edquota-u-f/home-t libin.

5. Turning off disk quotas is simple, quotaoff/home.

6. Here I do an example, for Libin users in the/boot partition, only 6 files can be created, and 4 will be warned. Or an example to make it more understandable.

  

  

7. Remember that these settings soft and hard commands are only root to execute, Edquota is to set Libin user's disk quota in a directory, and Libin users to enter this directory to use quota to view their quotas in this directory.

[[Email protected]~]# compiling your own Linux kernel

Compile the kernel, it sounds pretty high-end, in fact, very simple, we compile the kernel mainly for the following reasons:

    1. Get the kernel source code (can download to kernel.org, but slow, I provide two)
    2. Extracting source code
    3. Compiling the kernel
    4. Installation

  

  I used to unzip the kernel into the/USR/SRC directory, tar/kernel-c/usr/src, into the unpacked folder, cd/usr/src/ Kernel. We are beginners, if there is a graphical interface to help us better, Linux provides, after we enter the directory, directly execute make menuconfig, you can open a graphical interface, all the kernel settings are here.

  

  Thousands of, I can not say, you do not want the module, the space to remove the line, but I advise you do not modify too much for the first time, or how to fail to know, I have opened the NTFS support (default is not supported), removed wireless (wifi), Bluetooth. Modified the kernel to compile the suffix named for its own -625.libin.

Once set up, you can start compiling, execute make all && makes Modules_install && make install, this process is very long, generally in half an hour more than two hours, so slowly wait ....

I have successfully compiled here, and also installed, how to see whether it is the use of their own kernel it?

    1. View ls/boot/grub/grub.conf to see if new kernel options are available
    2. After booting, uname-r view.

  

  Your own kernel, it still looks like an X-pack. What people do not understand can be a private messages to me, and then I give you a detailed answer. I may not be very clear about it, because it is too much.

Summarize:

[[Email protected]~]# It guy from Love family love wife
For Linux expansion and contraction, be sure to do a good job in advance backup. Kernel compilation is not difficult, it is difficult to figure out the dependencies of some modules, so now I do not have the ability to understand these things deeply.
A word hit out, very tired, but for everyone for their own, it is worthwhile, I hope you point a wave of attention! Thank you, everyone!
Blog Park: Love family love wife's it male QQ Group: Public Number: program ape Wild Banana "get the tool that appears in the article"

< training | 13th day ACL permissions control and disk quotas in >linux, with the build of your own Linux kernel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.