Linux system disk management integrated test management 09-

 

[the root @ localhost ~] # the fdisk / dev / SDB
Welcome fdisk (util-linux 2.23.2).

Change will stay in memory until you decide to write the changes to disk.
Please think twice before using the write command.

Device does not contain a recognized partition table
using the disk identifier 0x95055272 create a new DOS disk label.

Command (input m to get help): n-
the Partition type:
P Primary (Primary 0, 0 Extended, Free. 4)
E Extended
the Select (default P):
the Using Response P default
partition number (1-4, default 1):
Starting fan region (2048-41943039, the default is 2048):
the default value 2048
Last sector, sector + or + size {K, M, G} (2048-41943039, default 41943039):
the default value 41943039
partition 1 Linux has been set to the type, size to 20 GiB

Command (input m to get help): W
of The Partition Table Altered has been!

Calling ioctl () to re-read partition table.
Syncing disks.
[the root @ localhost ~] # the fdisk / dev / SDC
Welcome fdisk (util-linux 2.23.2).

Change will stay in memory until you decide to write the changes to disk.
Please think twice before using the write command.

Device does not contain a recognized partition table
using the disk identifier 0x13864f8e create a new DOS disk label.

Command (m input assistance):
Command (m input assistance): n-
the Partition type:
P Primary (Primary 0, 0 Extended, Free. 4)
E Extended
the Select (default P):
the Using Response P default
partition number (1-4 default 1):
starting sector (2048-41943039, the default is 2048):
the default value 2048
Last sector, sector + or + size {K, M, G} (2048-41943039, default 41943039) :
the default value of 41,943,039
partition 1 has been set for Linux type, size to 20 GiB

Command (input m to get help): W
of The Partition Table Altered has been!

Calling ioctl () to re-read partition table.
Syncing disks.
[the root @ localhost ~] # the fdisk / dev / SDD
Welcome fdisk (util-linux 2.23.2).

Change will stay in memory until you decide to write the changes to disk.
Please think twice before using the write command.

Device does not contain a recognized partition table
using the disk identifier 0xefecb279 create a new DOS disk label.

Command (input m to get help): n-
the Partition type:
P Primary (Primary 0, 0 Extended, Free. 4)
E Extended
the Select (default P):
the Using Response P default
partition number (1-4, default 1):
Starting fan region (2048-41943039, the default is 2048):
the default value 2048
Last sector, sector + or + size {K, M, G} (2048-41943039, default 41943039):
the default value 41943039
partition 1 Linux has been set to the type, size to 20 GiB

Command (input m to get help): W
of The Partition Table Altered has been!

Calling ioctl() to re-read partition table.
正在同步磁盘。
[root@localhost ~]# mdadm -Cv /dev/md5 -l5 -n3 /dev/sd[bcd]1
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 512K
mdadm: size set to 20954112K
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md5 started.
[root@localhost ~]# pvcreate /dev/md5
Physical volume "/dev/md5" successfully created.
[root@localhost ~]# vgcreate myvg /dev/md5
Volume group "myvg" successfully created
[root@localhost ~]# lvcreate -L +30G -n mylv myvg
Logical volume "mylv" created.

[the root @ localhost ~] # mkfs.ext4 / dev / myvg / mylv
the mke2fs 1.42.9 (-On Dec-28, 2013)
file system label =
the OS type: the Linux
block size = 4096 (log = 2)
block size = 4096 ( = 2 log)
Stride = blocks 128, 256 blocks Stripe width =
1.96608 million of inodes, blocks 7864320
393216 blocks (5.00%) The Super User Reserved for
a first data block 0 =
the Maximum filesystem = 2,155,872,256 blocks
240 block Groups
32768 blocks per Group, Group fragments per 32768
8192 of inodes per Group
of Superblock Backups Stored ON Blocks:
32768, 98304, 163840, 229376, 294 912, 819200, 884 736, 1605632, 2654208,
4096000

Allocating group tables: completed
is being written inode table: complete
Creating journal (32768 blocks): complete
Writing superblocks and filesystem accounting information: complete

[root@localhost ~]# mount /dev/myvg/mylv /usr/local/apache/htdocs/

[root@localhost ~]# echo "JJ" > /usr/local/apache/htdocs/index.html

[root@localhost ~]# /usr/local/apache/bin/apachectl start

[root@localhost ~]# systemctl stop firewalld

 

[root@localhost ~]# mount -o remount,usrquota,grpquota /usr/local/apache/htdocs/
[root@localhost ~]# mount

/dev/mapper/myvg-mylv on /usr/local/apache/htdocs type ext4 (rw,relatime,quota,usrquota,grpquota,stripe=256,data=ordered)

 [root@localhost ~]# vim /etc/fstab

/dev/myvg/mglv /usr/local/apache/htdocs ext4 defaults,usrquota,grpquota 0 0
[root@localhost ~]# quotacheck -avug

quotacheck: Scanning /dev/mapper/myvg-mylv [/usr/local/apache/htdocs] done

[root@localhost ~]# quotaon -avug
/dev/mapper/myvg-mylv [/usr/local/apache/htdocs]: group quotas turned on
/dev/mapper/myvg-mylv [/usr/local/apache/htdocs]: user quotas turned on

[root@localhost ~]# useradd jiajia

 

[root@localhost ~]# edquota -u jiajia

[root@localhost ~]# chmod -R 777 /usr/
chmod: 更改"/usr/local/apache/htdocs/aquota.user" 的权限: 不允许的操作
chmod: 更改"/usr/local/apache/htdocs/aquota.group" 的权限: 不允许的操作

[root@localhost ~]# su - jiajia
[jiajia@localhost ~]$ dd if=/dev/zero of=/usr/local/apache/htdocs/ceshi bs=1M count=90
dm-2: warning, user block quota exceeded.
记录了90+0 的读入
记录了90+0 的写出
94371840字节(94 MB)已复制,0.716296 秒,132 MB/秒
[jiajia@localhost ~]$ touch /usr/local/apache/htdocs/{1..90}.txt
dm-2: warning, user file quota exceeded.

 

Guess you like

Origin www.cnblogs.com/wangjia120/p/11298099.html