2019.8.5 lab topology title

1[root@localhost ~]# fdisk /dev/sdb     fdisk/dev/sdc)(fdisk/dev/sdd

Welcome to the 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

Use disk identifier 0xcc7d50b6 create a new DOS disk label.

 

Command ( input m to get help ) : n-

Partition type:

   p   primary (0 primary, 0 extended, 4 free)

   e   extended

Select (default p): p

Partition number (1-4 , default 1) :

Starting sector (2048-167772159 defaults to 2048) :

We will use the default value 2048

Last sector , + a sector or size + {K, M, G} (2048-167772159 , default 167 772 159) : + 20G

Partition 1 is set to Linux type, size to 20 GiB

 

Command ( input m to get help ) : n-

Partition type:

   p   primary (1 primary, 0 extended, 3 free)

   e   extended

Select (default p):

Using default response p

Partition number (2-4 , default 2) :

Starting sector (41945088-167772159 defaults to 41945088) :

We will use the default value 41,945,088

Last sector , + a sector or size + {K, M, G} (41945088-167772159 , default 167 772 159) : + 20G

Partition 2 is set to Linux type, size to 20 GiB

 

Command ( input m to get help ) : n-

Partition type:

   p   primary (2 primary, 0 extended, 2 free)

   e   extended

Select (default p):

Using default response p

Partition number (3,4 , default 3) :

Starting sector (83888128-167772159 defaults to 83888128) :

We will use the default value 83,888,128

Last sector , + a sector or size + {K, M, G} (83888128-167772159 , default 167 772 159) : + 20G

Partition 3 is set to Linux type, size to 20 GiB

 

Command ( input m to get help ) : WQ

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@localhost ~]# lsblk

NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

sda               8:0    0   30G  0 disk

├─sda1            8:1    0  500M  0 part /boot

└─sda2            8:2    0 29.5G  0 part

  ├─centos-root 253:0    0 27.5G  0 lvm  /

  └─centos-swap 253:1    0    2G  0 lvm  [SWAP]

sdb               8:16   0   80G  0 disk

├─sdb1            8:17   0   20G  0 part

├─sdb2            8:18   0   20G  0 part

└─sdb3            8:19   0   20G  0 part

sdc               8:32   0   40G  0 disk

├─sdc1            8:33   0   20G  0 part

├─sdc2            8:34   0    5G  0 part

└─sdc3            8:35   0    5G  0 part

sdd               8:48   0   40G  0 disk

├─sdd1            8:49   0   20G  0 part

├─sdd2            8:50   0    5G  0 part

└─sdd3            8:51   0    5G  0 part

sr0              11:0    1    4G  0 rom  /run/media/root/CentOS 7 x86_64

[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 20955136K

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 50 -n mylv myvg

  Rounding up size to full physical extent 52.00 MiB

  Logical volume "mylv" created.

[root@localhost ~]# mkfs -t xfs /dev/myvg/mylv

log stripe unit (524288 bytes) is too large (maximum is 256KiB)

log stripe unit adjusted to 32KiB

meta-data = / dev / myvg / mylv help = 256 agcount = 2, agsize = 6528 blks

         =                       sectsz=512   attr=2, projid32bit=1

         Crc = 0 = 0 = finobt

data     =                       bsize=4096   blocks=13056, imaxpct=25

         =                       sunit=128    swidth=256 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

log      =internal log           bsize=4096   blocks=624, version=2

         =                       sectsz=512   sunit=8 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

2, the installation Apache (step omitted)

3, users need the / dev / myvg / mylv logical way to mount the disk quota support to the next page directory ( / usr / local / the Apache / htdocs )

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

4, create a test file in the web directory index.html , content for the user name, access through a browser test

[root@localhost ~]# ls /usr/local/apache/htdocs/

[root@localhost ~]# cd /usr/local/apache/htdocs/

[root@localhost htdocs]# touch index.html

[root@localhost htdocs]# ls

index.html

[root@localhost htdocs]# vi index.html 

5, create a user account for LVM configure disk quota soft limit user disk capacity of 80M , hard limit 100M ; soft limit the number of files 100 Ge, hard limit of 80 Ge.

[root@localhost ~]# useradd litianyang

[root@localhost ~]# quotacheck -avug

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

quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

[root@localhost ~]# quotaon -avug

[root@localhost ~]# edquota -u litianyang

 

Guess you like

Origin www.cnblogs.com/990624lty-jhc/p/11301413.html