磁盘挂载
partprobe
[root@cs-18 ~]
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
[root@cs-18 ~]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 199G 0 part
├─cl-root 253:0 0 70G 0 lvm /
├─cl-swap 253:1 0 2G 0 lvm
└─cl-home 253:2 0 127G 0 lvm /home
sdb 8:16 0 20G 0 disk
sdc 8:32 0 10G 0 disk /app
sr0 11:0 1 9.3G 0 rom
[root@cs-18 ~]
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition number (1-128, default 1):
First sector (34-41943006, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943006, default 41943006): +2G
Created a new partition 1 of type 'Linux filesystem' and of size 2 GiB.
Partition
Do you want to remove the signature? [Y]es/[N]o: Y
The signature will be removed by a write command.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 55384697-F876-47F3-B772-8DB6B3016E97
Device Start End Sectors Size Type
/dev/sdb1 2048 4196351 4194304 2G Linux filesystem
Filesystem/RAID signature on partition 1 will be wiped.
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): L
1 EFI System C12A7328-F81F-11D2-BA4B-00A0C93EC93B
2 MBR partition scheme 024DEE41-33E7-11D3-9D69-0008C781F39F
3 Intel Fast Flash D3BFE2DE-3DAF-11DF-BA40-E3A556D89593
4 BIOS boot 21686148-6449-6E6F-744E-656564454649
5 Sony boot partition F4019732-066E-4E12-8273-346C5641494F
6 Lenovo boot partition BFBFAFE7-A34F-448A-9A5B-6213EB736C22
7 PowerPC PReP boot 9E1A2D38-C612-4316-AA26-8B49521E5A8B
Partition type (type L to list all types): 31
Changed type of partition 'Linux filesystem' to 'Linux LVM'.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 55384697-F876-47F3-B772-8DB6B3016E97
Device Start End Sectors Size Type
/dev/sdb1 2048 4196351 4194304 2G Linux LVM
Filesystem/RAID signature on partition 1 will be wiped
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 55384697-F876-47F3-B772-8DB6B3016E97
Device Start End Sectors Size Type
/dev/sdb1 2048 4196351 4194304 2G Linux LVM
/dev/sdb2 4196352 12584959 8388608 4G Linux LVM
Filesystem/RAID signature on partition 1 will be wiped.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@cs-18 ~]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 199G 0 part
├─cl-root 253:0 0 70G 0 lvm /
├─cl-swap 253:1 0 2G 0 lvm
└─cl-home 253:2 0 127G 0 lvm /home
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 2G 0 part
└─sdb2 8:18 0 4G 0 part
sdc 8:32 0 10G 0 disk
sr0 11:0 1 9.3G 0 rom
[root@cs-18 ~]
PV VG Fmt Attr PSize PFree
/dev/sda2 cl lvm2 a-- <199.00g 0
[root@cs-18 ~]
WARNING: xfs signature detected on /dev/sdc at offset 0. Wipe it? [y/n]: y
Wiping xfs signature on /dev/sdc.
Physical volume "/dev/sdb1" successfully created.
Physical volume "/dev/sdc" successfully created.
[root@cs-18 ~]
PV VG Fmt Attr PSize PFree
/dev/sda2 cl lvm2 a-- <199.00g 0
/dev/sdb1 lvm2 --- 2.00g 2.00g
/dev/sdc lvm2 --- 10.00g 10.00g
[root@cs-18 ~]
Volume group "vg00" successfully created
[root@cs-18 ~]
PV VG Fmt Attr PSize PFree
/dev/sda2 cl lvm2 a-- <199.00g 0
/dev/sdb1 vg00 lvm2 a-- <2.00g <2.00g
/dev/sdc vg00 lvm2 a-- <10.00g <10.00g 可以看到加到vg00的卷组中
[root@cs-18 ~]
VG
cl 1 3 0 wz--n- <199.00g 0
vg00 2 0 0 wz--n- 11.99g 11.99g
[root@cs-18 ~]
Logical volume "gaussdb" created.
[root@cs-18 ~]
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home cl -wi-ao---- 126.96g
root cl -wi-ao---- 70.00g
swap cl -wi-a----- 2.03g
gaussdb vg00 -wi-a----- 2.00g
root@cs-18 ~]
lrwxrwxrwx 1 root root 7 Jun 23 07:33 /dev/vg00/gaussdb -> ../dm-3
[root@cs-18 ~]
meta-data=/dev/vg00/gaussdb isize=512 agcount=4, agsize=131072 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=524288, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
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@cs-18 ~]
[root@cs-18 ~]
/dev/vg00/gaussdb /app xfs defaults 0 0
[root@cs-18 ~]
[root@cs-18 ~]
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 877M 0 877M 0% /dev
tmpfs tmpfs 896M 0 896M 0% /dev/shm
tmpfs tmpfs 896M 8.7M 887M 1% /run
tmpfs tmpfs 896M 0 896M 0% /sys/fs/cgroup
/dev/mapper/cl-root xfs 70G 2.0G 68G 3% /
/dev/sda1 xfs 1014M 195M 820M 20% /boot
tmpfs tmpfs 180M 0 180M 0% /run/user/0
/dev/mapper/cl-home xfs 127G 939M 126G 1% /home
/dev/mapper/vg00-gaussdb xfs 2.0G 47M 2.0G 3% /app
pv物理卷--vg卷组--lv逻辑卷
[root@cs-18 ~]
Can't parse size argument.
Invalid argument for --size: +50%free
Error during parsing of command line.
[root@cs-18 ~]
Size of logical volume vg00/gaussdb changed from 2.00 GiB (512 extents) to <7.00 GiB (1791 extents).
Logical volume vg00/gaussdb successfully resized.
root@cs-18 ~]
/dev/mapper/vg00-gaussdb xfs 2.0G 47M 2.0G 3% /app
[root@cs-18 ~]
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home cl -wi-ao---- 126.96g
root cl -wi-ao---- 70.00g
swap cl -wi-a----- 2.03g
gaussdb vg00 -wi-ao---- <7.00g
[root@cs-18 ~]
meta-data=/dev/mapper/vg00-gaussdb isize=512 agcount=4, agsize=131072 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=524288, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
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
data blocks changed from 524288 to 1833984
[root@cs-18 ~]
/dev/mapper/vg00-gaussdb xfs 7.0G 83M 7.0G 2% /app
[root@cs-18 ~]