磁盘

[root@localhost ~]# mdadm -Cv /dev/md5 -l5 -n3 /dev/sdb[123]

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 ~]# pvscan

  PV /dev/sda2   VG centos          lvm2 [<39.00 GiB / 4.00 MiB free]

  Total: 1 [<39.00 GiB] / in use: 1 [<39.00 GiB] / in no VG: 0 [0   ]

[root@localhost ~]# pvcreate /dev/md5

  Physical volume "/dev/md5" successfully created.

[root@localhost ~]# pvscan

  PV /dev/sda2   VG centos          lvm2 [<39.00 GiB / 4.00 MiB free]

  PV /dev/md5                       lvm2 [<39.97 GiB]

  Total: 2 [78.96 GiB] / in use: 1 [<39.00 GiB] / in no VG: 1 [<39.97 GiB]

[root@localhost ~]# vgcreate myvg /dev/md5

  Volume group "myvg" successfully created

[root@localhost ~]# lvscan

  ACTIVE            '/dev/centos/swap' [2.50 GiB] inherit

  ACTIVE            '/dev/centos/root' [36.49 GiB] inherit

[root@localhost ~]# lvcreate -L 30G -n mylv myvg

  Logical volume "mylv" created.

[root@localhost ~]# mkfs.ext4 /dev/myvg/mylv

mke2fs 1.42.9 (28-Dec-2013)

文件系统标签=

OS type: Linux

块大小=4096 (log=2)

分块大小=4096 (log=2)

Stride=128 blocks, Stripe width=256 blocks

1966080 inodes, 7864320 blocks

393216 blocks (5.00%) reserved for the super user

第一个数据块=0

Maximum filesystem blocks=2155872256

240 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000

 

Allocating group tables: 完成                            

正在写入inode表: 完成                            

Creating journal (32768 blocks): 完成

Writing superblocks and filesystem accounting information: 完成   

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

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

[root@localhost ~]# mount |grep /usr/local/apache/htdocs

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

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

/dev/myvg/mylv     /usr/local/apache/htdocs     ext4    defaults,usrquota,grpquota       0 0

[root@localhost htdocs]# vi index.thml

[root@localhost htdocs]# cd

[root@localhost ~]# lynx 127.0.0.1

 

 

[root@localhost ~]# quotacheck -avug

quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.

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

quotacheck: Cannot stat old user quota file /usr/local/apache/htdocs/aquota.user: 没有那个文件或目录. Usage will not be subtracted.

quotacheck: Cannot stat old group quota file /usr/local/apache/htdocs/aquota.group: 没有那个文件或目录. Usage will not be subtracted.

quotacheck: Cannot stat old user quota file /usr/local/apache/htdocs/aquota.user: 没有那个文件或目录. Usage will not be subtracted.

quotacheck: Cannot stat old group quota file /usr/local/apache/htdocs/aquota.group: 没有那个文件或目录. Usage will not be subtracted.

quotacheck: Checked 3 directories and 1 files

quotacheck: Old file not found.

quotacheck: Old file not found.

[root@localhost ~]# ll /usr/local/apache/htdocs/a*

-rw-------. 1 root root 6144 8月   3 17:11 /usr/local/apache/htdocs/aquota.group

-rw-------. 1 root root 6144 8月   3 17:11 /usr/local/apache/htdocs/aquota.user

[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 ~]# edquota -u yangqi

  /dev/mapper/myvg-mylv             0        8000      10000      0        80        100

posted @ 2019-08-05 21:21  天真的富婆  阅读(120)  评论(0编辑  收藏  举报