CentOS7修改分区空间

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)

分享到 :

Leave a Reply

Your email address will not be published. Required fields are marked *