🪶山间笔记hillside notes

Lvm根分区扩容

1 分钟阅读 · 408 字10 次浏览编辑

一、确定/分区类型

可以看到根分区为lvm类型

[root@localhost ~]# lsblk 
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   30G  0 disk 
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   29G  0 part 
  ├─centos-root 253:0    0   26G  0 lvm  /
  └─centos-swap 253:1    0    3G  0 lvm  [SWAP]

二、查看新磁盘

NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   30G  0 disk 
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   29G  0 part 
  ├─centos-root 253:0    0   26G  0 lvm  /
  └─centos-swap 253:1    0    3G  0 lvm  [SWAP]
sdb      	  8:16   0   10G  0 disk 

三、创建pv

pvcreate /dev/sdb

四、确定根分区vg组

[root@localhost ~]# vgdisplay 
  --- Volume group ---
  VG Name               centos
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <29.00 GiB
  PE Size               4.00 MiB
  Total PE              7423
  Alloc PE / Size       7423 / <29.00 GiB
  Free  PE / Size       0 / 0   
  VG UUID               9v9LR6-IphT-JJOG-iSOT-AxuP-N8LR-7YzRrp

五、将新加的磁盘添加到根分区的vg组中

vgextend centos /dev/sdb

六、查看根分区逻辑组名称

[root@localhost ~]# lvdisplay 
  --- Logical volume ---
  LV Path                /dev/centos/root
  LV Name                root
  VG Name                centos
  LV UUID                cQ8oB9-TMEp-UlsQ-GWlt-5iTh-KVkb-L5PsXV
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-12-29 06:20:55 +0000
  LV Status              available
  # open                 1
  LV Size                <26.00 GiB
  Current LE             6655
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/centos/swap
  LV Name                swap
  VG Name                centos
  LV UUID                WPW1Ma-8qv4-B0Zp-RJKV-20sY-s74z-TVOJ5N
  LV Write Access        read/write
  LV Creation host, time localhost, 2021-12-29 06:20:55 +0000
  LV Status              available
  # open                 2
  LV Size                3.00 GiB
  Current LE             768
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1

七、扩展逻辑组

lvextend -l +100%FREE /dev/centos/root

八、扩容

xfs_growfs /dev/mapper/centos-root

九、查看

df -hT

相关笔记

1 分钟阅读391 字

Centos 7网卡绑定eth格式

在 CentOS 7 中,默认的网卡命名规则采用了 一致且可预测的网络接口命名(Consistent Network Device Naming) ,这是由 systemd 和 udev 引入的特性,旨在取代传统的 ethX(如 eth0、

继续阅读
2 分钟阅读698 字

LNMP

Yum安装LNMP环境 一、安装Nginx 配置Nginx官方repo源 安装Nginx 启动nginx,启动后访问IP:80端口即可 二、安装MySQL 2.1 配置MySQL repo源 默认开启的为8.0版本,可关闭8.0,开启别的

继续阅读
2 分钟阅读741 字

initrd.img添加网卡驱动

^背景:PXE批量安装Centos时主板网卡为R8125,PXE使用得centos得mini版本得initrd中无此网卡驱动,导致PXE引导不起来,需要网卡驱动添加到initrd.img中 : initrd.img是Linux启动过程中使用

继续阅读