Disk Management Integrated Test

. 1  [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 0x2ce67a99 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): P
partition number (1-4, default 1):
start sector (2048 -41943039, default is 2048):
the default value 2048
Last sector, sector + or + size {K, M, G} (2048-41943039, default 41943039):
the default value 41943039
partition is set to 1 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.
[root @ localhost ~] # 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 0x81884075 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): P
partition number (1-4, default 1):
start sector (2048 -41943039, default is 2048):
the default value 2048
Last sector, sector + or + size {K, M, G} (2048-41943039, default 41943039):
the default value 41943039
partition is set to 1 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.
[root @ localhost ~] # 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 0x87195fa0 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): P
partition number (1-4, default 1):
start sector (2048 -41943039, default is 2048):
the default value 2048
Last sector, sector + or + size {K, M, G} (2048-41943039, default 41943039):
the default value 41943039
partition is set to 1 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.
[root @ localhost ~] # fdisk the -l

Disk /dev/sda:42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte
disk label type: DOS
disk identifier: 0x00099607

设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 83886079 40893440 8e Linux LVM

Disk /dev/sdb:21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte
disk label type: DOS
disk identifier: 0x2ce67a99

设备 Boot Start End Blocks Id System
/dev/sdb1 2048 41943039 20970496 83 Linux

Disk /dev/sdc:21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte
disk label type: DOS
disk identifier: 0x81884075

设备 Boot Start End Blocks Id System
/dev/sdc1 2048 41943039 20970496 83 Linux

Disk /dev/sdd:21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte
disk label type: DOS
disk identifier: 0x87195fa0

设备 Boot Start End Blocks Id System
/dev/sdd1 2048 41943039 20970496 83 Linux

Disk /dev/mapper/centos-root:39.7 GB, 39720058880 bytes, 77578240 sectors
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte


Disk / dev / mapper / centos-swap : 2147 MB, 2147483648 bytes, sectors 4,194,304
Units = sectors of 1 * 512 = 512 bytes
sector size (logical / physical): 512 byte / 512 byte
I / O size (minimum / best): 512 byte / 512 byte

[root@localhost ~]# rpm -q mdadm
mdadm-4.0-5.el7.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 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 myly /dev/md5
Volume group "myly" successfully created
[root@localhost ~]# vgremove myly
Volume group "myly" successfully removed
[root@localhost ~]# vgcreate myvg /dev/md5
Volume group "myvg" successfully created
[root@localhost ~]# lvcreate -L 30G -n myly myvg
Logical volume "myly" created.
[root@localhost ~]# mkfs.ext4 /dev/myvg/myly
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: completed
is being written inode table: complete
Creating journal (32768 blocks): complete
Writing superblocks and filesystem accounting information: complete

[the root @ localhost ~] # Mount / dev / myvg / myly / usr / local / Apache / the htdocs
[the root @ localhost ~] # DF -Th
file system type has been used% capacity with the available mount point
/ dev / mapper / 5.3 g of the root XFS-37G CentOS 32G 15% /
devtmpfs devtmpfs 977M 0 977M 0% / dev
tmpfs tmpfs 993M 0 993M 0% / dev / SHM
tmpfs tmpfs 993M 984m. 1% 9.0 M / RUN
tmpfs tmpfs 993M 0 993M 0% / SYS / FS / a cgroup
/ dev / sda1 XFS 161M 854M 16% of 10-14m / Boot
tmpfs tmpfs 199M 199M. 1% 4.0 K / RUN / User / 42 is
tmpfs tmpfs 199M 199M 2OK. 1% / RUN / User / 0
/ dev / ISO9660 8.1 g of SR0 0 100% 8.1 g of / RUN / Media / the root /. 7 the CentOS the x86_64
/ dev / Mapper / myvg myly ext4 30G-28G 45M. 1% / usr / local / Apache / the htdocs
[the root @ localhost ~] # Vim / etc / fstab


   [root@localhost htdocs]# touch index.html
[root@localhost htdocs]# lynx 192.168.153.8
[root@localhost htdocs]# ls
index.html lost+found
[root@localhost htdocs]# vim index.html
[root@localhost htdocs]# lynx 192.168.153.8

 

 

  [root@localhost ~]# useradd jinlintao
[root@localhost ~]# mount -o remount,usrquota,grpquota /usr/local/apache/htdocs/[root@localhost ~]# mount | tail -1
/dev/mapper/myvg-myly on /usr/local/apache/htdocs type ext4 (rw,relatime,quota,usrquota,grpquota,stripe=256,data=ordered)
[root@localhost ~]# vi /etc/fstab
[root@localhost ~]# quotacheck -avug
quotacheck: Your kernel probably supports journaled quota but you are not using i. Consider switching to journaled quota to avoid running quotacheck after an unclan shutdown.
quotacheck: Scanning /dev/mapper/myvg-myly [/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.grou: 没有那个文件或目录. 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.grou: 没有那个文件或目录. Usage will not be subtracted.
quotacheck: Checked 2 directories and 1 files
quotacheck: Old file not found.
quotacheck: Old file not found.
[root@localhost ~]# quotaon -avug
/dev/mapper/myvg-myly [/usr/local/apache/htdocs]: group quotas turned on
/dev/mapper/myvg-myly [/usr/local/apache/htdocs]: user quotas turned on
[root@localhost ~]# edquota -u jinlintao
[root@localhost ~]# chmod -R 777 /usr/
chmod: 更改"/usr/local/apache/htdocs/aquota.group" 的权限: 不允许的操作
chmod: 更改"/usr/local/apache/htdocs/aquota.user" 的权限: 不允许的操作
Try 'chmod --help' for more information.

[root@localhost ~]# su - jinlintao

密码

[jinlintao@localhost ~]$ dd if=/dev/zero of=/usr/local/apache/htdocs/ceshi bs=1M count=100
dm-2: warning, user block quota exceeded.
记录了100+0 的读入
记录了100+0 的写出
104857600字节(105 MB)已复制,0.528268 秒,198 MB/秒
[jinlintao@localhost ~]$ dd if=/dev/zero of=/usr/local/apache/htdocs/ceshi bs=1M count=500
dm-2: warning, user block quota exceeded.
dm-2: write failed, user block limit reached.
dd: 写入"/usr/local/apache/htdocs/ceshi" 出错: 超出磁盘限额
记录了101+0 的读入
记录了100+0 的写出
104857600字节(105 MB)已复制,0.119654 秒,876 MB/秒
[jinlintao@localhost ~]$

 

Guess you like

Origin www.cnblogs.com/4545945a/p/11298724.html