Job 8.1

 

1. The host increases 80G SCSI interface hard disk

 

                           

 

 

 

2. 20G primary partition dividing each of the three

 

[root@localhost ~]# fdisk /dev/sdb

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 0xbfebc522 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): 1

Starting sector (2048-167772159 defaults to 2048):

We will use the default value 2048

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

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

 

Command (input acquisition assistance m): N

Partition type:

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

   e   extended

Select (default p): p

Partition number (2-4, default 2): 2

Starting sector (41945088-167772159 defaults to 41945088):

We will use the default value 41,945,088

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

Zone 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): p

Partition number (3,4, 3 by default): 3

Starting sector (83888128-167772159 defaults to 83888128):

We will use the default value 83,888,128

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

Linux partition 3 is set to the 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.

 

 

 

 

 

3. Converting the three primary partitions of the physical volume (pvcreate), physical volume scanning system

 

[root@localhost ~]# pvcreate /dev/sdb[123]

  Physical volume "/dev/sdb1" successfully created

  Physical volume "/dev/sdb2" successfully created

  Physical volume "/dev/sdb3" successfully created

[root@localhost ~]# pvscan

  PV /dev/sda2   VG centos   lvm2 [39.51 GiB / 44.00 MiB free]

  PV /dev/sdb2               lvm2 [20.00 GiB]

  PV /dev/sdb1               lvm2 [20.00 GiB]

  PV /dev/sdb3               lvm2 [20.00 GiB]

  Total: 4 [99.51 GiB] / in use: 1 [39.51 GiB] / in no VG: 3 [60.00 GiB]

 

 

 

 

 

4. Two physical volumes to create a volume group, the name for myvg, view the volume group size

 

[root@localhost ~]# vgcreate -s 8 vg0 /dev/sdb[12]

  Volume group "vg0" successfully created

 

 

 

 

 

5. Create a logical volume mylv, size 30G

 

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

  Logical volume "mylv" created.

 

 

 

 

 

6. The logical format to xfs file system, and mount it on / data directory, create a file test

 

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

meta-data = / dev / vg0 / mylv help = 256 agcount = 4, agsize = 1310720 blks

         =                       sectsz=512   attr=2, projid32bit=1

         Crc = 0 = 0 = finobt

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

         =                       sunit=0      swidth=0 blks

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

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

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

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

[root@localhost ~]# mkdir /data

[root@localhost ~]# mount /dev/vg0/mylv /data

 

 

 

 

 

7. Logical Volume increased to 35G

 

[root@localhost ~]# lvextend -L +5G /dev/vg0/mylv

  Size of logical volume vg0/mylv changed from 30.00 GiB (2560 extents) to 35.00 GiB (4480 extents).

  Logical volume mylv successfully resized

 

 

 

 

 

8. Edit / etc / fstab file to mount logical volumes, disk quotas and support options

 

 

 

 

 

 

 

9. Create a disk quota, crushlinux user / data directory under the file size of the soft limit is 80M, the hard limit for the 100M,

crushlinux the user / data directory soft limit the number of files to 80, 100 to hard limit.

 

[root@localhost ~]# edquota -u crushlinux

edquota: Bad format:

 

edquota: Cannot read quotas from file.

 

 

 

 

 

 

10. Command using the touch dd tested at / data directory

 

[root@localhost ~]# cd /data

[root@localhost data]# touch dd

[root@localhost data]# ls

dd

 

 

 

 

 

 

11. View usage quotas: a user's perspective [milk @ localhost ~] $ du -sh 100M.

12. View usage quotas: File System angle [root @ localhost milk] # repquota -auvs *** Report for user quotas on device / dev / mapper / myvg-mylv Block grace time: 7days; Inode grace time: 7days Space limits File limits User used soft hard grace used soft hard grace ------------------------------------

Guess you like

Origin www.cnblogs.com/baoqingrui/p/11290679.html