os lvm分区挂载 ``` 创建pv fdisk -l Disk /dev/sdc: 107.4 GB, 107374182400 bytes, 209715200 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 Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 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 Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 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 Disk label type: dos Disk identifier: 0x0005c166 Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 4196351 1048576 82 Linux swap / Solaris /dev/sda3 4196352 62914559 29359104 83 Linux [root@mysql1 ~]# pvcreate /dev/sdb /dev/sdc Physical volume "/dev/sdb" successfully created. Physical volume "/dev/sdc" successfully created. [root@mysql1 ~]# pvs PV VG Fmt Attr PSize PFree /dev/sdb lvm2 --- 100.00g 100.00g /dev/sdc lvm2 --- 100.00g 100.00g 创建vg vgcreate mysqlvg /dev/sdb vgcreate bakvg /dev/sdc vgs VG #PV #LV #SN Attr VSize VFree bakvg 1 0 0 wz--n- <100.00g <100.00g mysqlvg 1 0 0 wz--n- <100.00g <100.00g 创建lv lvcreate -n mysqllv -L 30G mysqlvg lvcreate -n datalv -L 30G mysqlvg lvcreate -n loglv -L 30G mysqlvg lvcreate -n baklv -L 30G bakvg lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert baklv bakvg -wi-a----- 30.00g datalv mysqlvg -wi-a----- 30.00g loglv mysqlvg -wi-a----- 30.00g mysqllv mysqlvg -wi-a----- 30.00g [root@mysql1 ~]# pvs PV VG Fmt Attr PSize PFree /dev/sdb mysqlvg lvm2 a-- <100.00g <10.00g /dev/sdc bakvg lvm2 a-- <100.00g <70.00g [root@mysql1 ~]# vgs VG #PV #LV #SN Attr VSize VFree bakvg 1 1 0 wz--n- <100.00g <70.00g mysqlvg 1 3 0 wz--n- <100.00g <10.00g [root@mysql1 ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert baklv bakvg -wi-a----- 30.00g datalv mysqlvg -wi-a----- 30.00g loglv mysqlvg -wi-a----- 30.00g mysqllv mysqlvg -wi-a----- 30.00g 格式化 mkfs.ext4 /dev/bakvg/baklv mkfs.ext4 /dev/mysqlvg/loglv mkfs.ext4 /dev/mysqlvg/datalv mkfs.ext4 /dev/mysqlvg/mysqllv 挂载 /mysql/app 安装目录 /mysql/data 数据目录 /mysql/log 日志目录 /mysql/backup 备份目录 mkdir -p /mysql/app mkdir -p /mysql/data mkdir -p /mysql/log mkdir -p /mysql/backup mount /dev/mysqlvg/mysqllv /mysql/app mount /dev/mysqlvg/datalv /mysql/data mount /dev/mysqlvg/loglv /mysql/log mount /dev/bakvg/baklv /mysql/backup df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/mysqlvg-mysqllv 30G 45M 28G 1% /mysql/app /dev/mapper/mysqlvg-datalv 30G 45M 28G 1% /mysql/data /dev/mapper/mysqlvg-loglv 30G 45M 28G 1% /mysql/log /dev/mapper/bakvg-baklv 30G 45M 28G 1% /mysql/backup vim /etc/fstab /dev/mysqlvg/mysqllv /mysql/app ext4 defaults 0 0 /dev/mysqlvg/datalv /mysql/data ext4 defaults 0 0 /dev/mysqlvg/loglv /mysql/log ext4 defaults 0 0 /dev/bakvg/baklv /mysql/backup ext4 defaults 0 0 ```
标签:sectors,bytes,dev,sdb,lvm,挂载,512,os,size From: https://www.cnblogs.com/lzjloveit/p/17374037.html