2016-3-29 Study Notes

Source: Internet
Author: User

The composition of the Linux file: file name (dentry), metadata (inode), data
Dentry (Catalog Item)

Dumpe2fs
Inode Count
Inode size
Block size
Uuid
State

Mkfs.ext4
-I.
-L
-B

Fsck

Superblock Error, fsck rescue


Mount
-O remount (re-mount)
-T iso9660/vfat/ntfs-3g
Default:
rw
Exec:
Suid
Nouse: Only the root user can mount
Auto:mount-a automatically mount when executed
Async: Async

Mount-a re-read the/etc/fstab file again


Mkswap New Swap partition

Swapon activating new Swap partition-S
Swapoff disables the new swap partition, but the original allocated swap partition is not deactivated

/etc/fstab
Device name (three representations) mount point file System type Mount property whether dump backup is fsck detection
UUID (recommended)
Label
/dev/sda

Blkid viewing the UUID and/DEV/SD correspondence
[Email protected] lianxi]# BLKID/DEV/SDB1
/dev/sdb1:uuid= "ee43dd76-690f-410a-a76b-29dfdd1b763c" type= "Ext4"

Stat View File Inode information

TUNE2FS modifying parameters of an existing ext2 or ext3 file system
-C n Force Mount N times to perform fsck detection
-j adding ext3 logs
-O Add or remove feature of file system (log system)


Disk quotas:
Need to install quota package
Requires Linux kernel support
Limitations of space
Hard limit fixed dead, over on error
Soft limit flexible fixed, more than can also continue to store, but cannot exceed the hard limit
Limit on number of files

partitions that support disk quotas need to add Usrquota, Grpquota mount parameters
Method One: Edit the/etc/fstab file and add Usrquota, Grpquota properties to the Mount property
Method Two: Re-mount the partition, add Usrquota, Grpquota properties: Mount-o Remount,usrquota,grpquota Destination partition destination mount point

Quotacheck: Detecting disk quotas and creating quota files
-AUGV (Recommended parameter) u (user) G (Group) v (verbose) A (all)

Enable, turn off quota functionality for the file system
Quotaon
Quotaoff

Edit quota settings for user and group accounts
Edquota
-U user Name
-G Group Name
-T Default User Grace time is 7 days
-GT Default group Grace time 7 days
-p Copy a user's quota limit to another new user

Repquota viewing quota limits for a partition

Verify that disk quotas are set successfully
Verification of the number of touch files
Validation of DD specified capacity

Setquota: Setting quotas directly
Setquota [-U|-G] Block (soft) block (hard) inode (soft) inode (hard) file system


Turn off SELinux
Getenforce
Setenforce 0

[Email protected] lianxi]# Mount-o usrquota,grpquota/dev/sdb1 SDB
Detection Quota Support
[Email protected] sdb]# QUOTACHECK-AUVG
Quotacheck:checked 2 directories and 1 files
Quotacheck:cannot Create new quotafile/root/lianxi/sdb/aquota.user.new: Insufficient permissions
Quotacheck:cannot Initialize IO on new quotafile: Insufficient permissions
Quotacheck:cannot Create new quotafile/root/lianxi/sdb/aquota.group.new: Insufficient permissions
Quotacheck:cannot Initialize IO on new quotafile: Insufficient permissions
The reason why the above permissions are insufficient: The SELinux protection mechanism, the workaround is as follows:
[Email protected] sdb]# Getenforce
Enforcing
[Email protected] sdb]# Setenforce
Usage:setenforce [Enforcing | Permissive | 1 | 0]
[Email protected] sdb]# Setenforce 0
[Email protected] sdb]# Getenforce
Permissive
Detection Quota Support
[Email protected] sdb]# QUOTACHECK-AUVG
Start Quota support
[Email protected] sdb]# QUOTAON-AUGV
/DEV/SDB1 [/ROOT/LIANXI/SDB]: group quotas turned on
/DEV/SDB1 [/root/lianxi/sdb]: User quotas turned on
Create test users and groups
[Email protected] sdb]# Groupadd Xiaoban
[Email protected] sdb]# useradd-g Xiaoban ZLJ
[Email protected] sdb]# useradd-g Xiaoban zll
[Email protected] sdb]# useradd-g Xiaoban ZJJ
Edit a user's quota situation
[Email protected] sdb]# edquota-u ZLJ
[Email protected] sdb]# edquota-p ZLJ zll
[Email protected] sdb]# edquota-p ZLJ ZJJ
Check quota status



LVM Logical Volume Manager, Logical Volume management
Block bottom, online expansion
/boot partition, cannot apply LVM mechanism

PV (physical volume)

VG (Volume Group)

LV (Logical volume)

pv--"vg--" LV

Create a command
Pvcreate Device Name
Vgcreate Volume group Name Physical volume name 1 physical volume name 2
Lvcreate-l size-N Logical Volume name volume group name

viewing, displaying commands
Pvscan\pvdisplay
Vgscan\vgdisplay
Lvscan\lvdisplay

Online expansion:
Lvextened-l +2g/dev/lvm/lvol0
Resize2fs/dev/lvm/lvol0 Update Expansion
First LV Post file system

Offline Scaling:
Fsck-f/dev/lvm/lvol0
Resize2fs/dev/lvm/lvol0 5G Shrink to 5G
Lvresize/dev/lvm/lvol0-l 5G
First file system post LV




RAID0: Stripe storage is the fastest, but not reliable, fault-tolerant
RAID1: Mirrored with only two disks, good fault tolerance
RAID5: stripe + distribution Check at least three blocks, compatible with RAID0 and RAID1
RAID10: Mirror + stripe first mirror, rear stripe, minimum 4 disks required
RAID01: Stripe + mirror First stripe, rear mirror, minimum 4 disks required

Mdadm command to create, modify, and monitor RAID arrays
-C Create
-L Specify 0,1,5
-n Specifies the number of disks
-X number of backup disks
-D View RAID information

This article is from the "Sunny Rain" blog, please be sure to keep this source http://8776055.blog.51cto.com/8766055/1758202

2016-3-29 Learning Notes

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.