On the job six machine account management 2019731

2, three of the hard disk partition
[root @ localhost ~] # fdisk / dev / sdf
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 0xcf3610b6 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.
[root @ localhost ~] # fdisk / dev / sde
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 0xfae43c11 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.
[root @ localhost ~] # fdisk / dev / sdg
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 0x0e0afac9 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.


3. Create a RAID 5

[root@localhost ~]# mdadm -C /dev/md55 -l 5 -n 3 /dev/sd[efg]
mdadm: /dev/sde appears to be part of a raid array:
level=raid0 devices=0 ctime=Thu Jan 1 08:00:00 1970
mdadm: partition table exists on /dev/sde but will be lost or
meaningless after creating array
mdadm: /dev/sdf appears to be part of a raid array:
level=raid0 devices=0 ctime=Thu Jan 1 08:00:00 1970
mdadm: partition table exists on /dev/sdf but will be lost or
meaningless after creating array
mdadm: /dev/sdg appears to be part of a raid array:
level=raid0 devices=0 ctime=Thu Jan 1 08:00:00 1970
mdadm: partition table exists on /dev/sdg but will be lost or
meaningless after creating array
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md55 started.
[root@localhost ~]# mdadm -D /dev/md55
/dev/md55:
Version : 1.2
Creation Time : Sat Aug 3 13:45:55 2019
Raid Level : raid5
Array Size : 41910272 (39.97 GiB 42.92 GB)
Used Dev Size : 20955136 (19.98 GiB 21.46 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent

Update Time : Sat Aug 3 13:46:02 2019
State : clean, degraded, recovering
Active Devices : 2
Working Devices : 3
Failed Devices : 0
Spare Devices : 1

Layout : left-symmetric
Chunk Size : 512K

Rebuild Status : 10% complete

Name : localhost.localdomain:55 (local to host localhost.localdomain)
UUID : 862f8db5:c4a3594c:0a7b4ffa:a5fadc0a
Events : 2

Number Major Minor RaidDevice State
0 8 64 0 active sync /dev/sde
1 8 80 1 active sync /dev/sdf
3 8 96 2 spare rebuilding /dev/sdg


4, create a physical volume

[root@localhost ~]# pvcreate /dev/md55
Physical volume "/dev/md55" successfully created
[root@localhost ~]# pvscan
PV /dev/sdb1 VG myvg lvm2 [20.00 GiB / 0 free]
PV /dev/sdb2 VG myvg lvm2 [20.00 GiB / 4.99 GiB free]
PV /dev/sda2 VG centos lvm2 [39.51 GiB / 44.00 MiB free]
PV /dev/sdb3 lvm2 [20.00 GiB]
PV /dev/md55 lvm2 [39.97 GiB]
Total: 5 [139.47 GiB] / in use: 3 [79.50 GiB] / in no VG: 2 [59.97 GiB]

5, create a volume group

[root@localhost ~]# vgcreate vg /dev/md55
Volume group "vg" successfully created
[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "myvg" using metadata type lvm2
Found volume group "vg" using metadata type lvm2
Found volume group "centos" using metadata type lvm2

6, create a logical volume

[root@localhost ~]# lvcreate -L +30G -n lv vg
Logical volume "lv" created.
[root@localhost ~]# lvscan
ACTIVE '/dev/myvg/mylv' [35.00 GiB] inherit
ACTIVE '/dev/vg/lv' [30.00 GiB] inherit
ACTIVE '/dev/centos/swap' [2.00 GiB] inherit
ACTIVE '/dev/centos/root' [37.46 GiB] inherit

7, formatting logical volumes

[root@localhost ~]# mkfs.xfs /dev/vg/lv
log stripe unit (524288 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/vg/lv isize=256 agcount=16, agsize=491392 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=7862272, imaxpct=25
= sunit=128 swidth=256 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=3840, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

8 of the, an_zhuang apache,
[to set a root @ localhost ~] # yuanmash: bash
#! / Bin /: bash

yum -y install gcc gcc-c++

tar xf httpd-2.2.17.tar.gz -C /usr/src
cd /usr/src/httpd*
./configure --prefix=/usr/local/apache
make
make install
cd /usr/local/apache/conf/
set "s/#ServerName w/ServerName w" /httpd.conf
/usr/local/apache/bin/apachectl start

yum -y install lynx
lynx 127.0.0.1

9, mounting
[the root @ localhost ~] # -0 Mount the usrquota, grpquota / dev / VG / LV / usr / local / Apache / the htdocs
[the root @ localhost ~] # DF -ht
file system type Size Used Used Available % mount point
/ dev / Mapper / XFS CentOS the root 38G-34G 3.6G 10% /
devtmpfs devtmpfs 985M 0 985M 0% / dev
tmpfs tmpfs 994M 80K 994M. 1% / dev / SHM
tmpfs tmpfs 994M 985M. 1% 8.9m / RUN
tmpfs tmpfs 994M 0 994M 0% / SYS / FS / a cgroup
/ dev / MD5 XFS 20G 33M 20G. 1% / DATAl
/ dev / MD0 XFS 20G 33M 20G. 1% / DATA2
/ dev / sda1 XFS 497m 107M 391M 22 is% / Boot
/ dev / mapper / vg-lv xfs 30G 33M 30G 1% / usr / local / apache / htdocs

10、磁盘配额
[root@localhost ~]# quotacheck -auvg
quotacheck: Skipping /dev/mapper/myvg-mylv [/data]
quotacheck: Skipping /dev/mapper/vg-lv [/usr/local/apache/htdocs]
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.
[root@localhost ~]# quotaon -avug

11、创建index.html
[root@localhost ~]# cd /usr/local/apache/htdocs
[root@localhost htdocs]# vim index.html
<html><body><h1>胡富豪</h1></body></html>

 


12, create a user and configure LVM disk quotas
[root @ localhost ~] # useradd--d / usr / local / the Apache / htdocs / HFH HFH
[root @ localhost ~] # edquota -u HFH
Disk HFH a quotas for the User (uid 1001 ):
the Filesystem of inodes Hard Soft Hard Soft Blocks
/ dev / Mapper / myvg-mylv 0 0 0 0 0 0
/ dev / Mapper / VG-12 is LV. 7 81920 102400 80 100

Guess you like

Origin www.cnblogs.com/hfh1/p/11295363.html