Centos7修改分区空间
一:缩小/home空间
1.1:备份/home内容
cp -r /home/* /homebak
1.2:删除挂载/home
umount /home
1.3:删除/home所在lv
lvremove /dev/mapper/centos-home
1.4:重新创建home的lv
lvcreate -L 6G -n home centos
L表示大小,默认单位为M;n表示卷名;这里的centos是CentOS7安装系统的时候就默认建立好的卷组名
1.5:文件系统格式为xfs
mkfs.xfs /dev/mapper/centos-home
1.6:挂载
mount /dev/mapper/centos-home /home
二:新建卷
2.1:查看卷组剩余空间
vgdisplay
[root@zz-01 /]# vgdisplay --- Volume group --- VG Name centos System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 8 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size <79.00 GiB PE Size 4.00 MiB Total PE 20223 Alloc PE / Size 15328 / <59.88 GiB Free PE / Size 4895 / 19.12 GiB VG UUID Zdq2BR-i6R3-m43i-cezu-7Eb1-f9cR-aIU0MV
2.2:重新创建xxx的lv
lvcreate -L 19G -n xxx centos
L表示大小,默认单位为M;n表示卷名;这里的centos是CentOS7安装系统的时候就默认建立好的卷组名
2.3:文件系统格式为xfs
mkfs.ext4 /dev/mapper/centos-xxx
2.4:挂载
mount /dev/mapper/centos-xxx /xxx
三:TiDB环境部署,2.3开始调整为以下步骤
3.1:创建分区表:(此步骤我没有做)
parted -s -a optimal /dev/nvme0n1 mklabel gpt -- mkpart primary ext4 1 -1
3.2:创建分区并格式化文件系统:
lvcreate -L 19G -n ext4 centos
mkfs.ext4 /dev/mapper/centos-ext4
3.3:查看磁盘分区的UUID
lsblk -f
[root@zz-01 /]# lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT sr0 iso9660 XenServer Tools 2018-08-24-08-03-46-00 xvda ├─xvda1 xfs 37ea57d3-ab8d-4a8f-b89d-c2ccf17bec51 /boot └─xvda2 LVM2_member RNDG3e-7Z6F-xACd-0vro-KM2P-NOc5-CK2M2Z ├─centos-root xfs 080adf4c-d428-471f-82c9-cd48209e1d08 / ├─centos-swap swap 1b52bb06-5ffa-41bc-86a7-d9ddc7252594 [SWAP] ├─centos-home xfs 7e6acd9f-85e7-4296-8d4c-fcec218d7501 /home └─centos-ext4 ext4 a45530a9-8b07-4b9e-b78b-d6480e239dea
3.4:vim /etc/fstab 添加
UUID=a45530a9-8b07-4b9e-b78b-d6480e239dea /ext4 ext4 defaults,nodelalloc,noatime 0 2
3.5:mkdir /ext4
3.6:mount -a
3.7:mount -t ext4
[root@zz-01 /]# mount -t ext4 /dev/mapper/centos-ext4 on /ext4 type ext4 (rw,noatime,nodelalloc,data=ordered)
感谢:
https://www.cnblogs.com/fang888/p/8124379.html