Linux lvm下根分区扩容方法详细记录

项目上之前有一台虚拟机,将mysql直接安装在根分区下了,并且虚拟机在创建时硬盘空间分配得比较小,随着数据库的增大,根分区空间不够,因为库实时性比较强,迁移比较麻烦,需要对根分区进行扩容。1.给这台虚拟机添加一块硬盘,大小为50G2.添加后使用fdisk -l,可以发现系统并没有识别到新添加的硬盘[root@localhost ~]# fdisk -lDisk /dev/sda: 85.8 GB,...
摘要由CSDN通过智能技术生成

项目上之前有一台虚拟机,将mysql直接安装在根分区下了,并且虚拟机在创建时硬盘空间分配得比较小,随着数据库的增大,根分区空间不够,因为库实时性比较强,迁移比较麻烦,需要对根分区进行扩容。

1.给这台虚拟机添加一块硬盘,大小为50G


2.添加后使用fdisk -l,可以发现系统并没有识别到新添加的硬盘

[root@localhost ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14       10443    83778975   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

3.参照网上资料进行处理

[root@localhost ~]# ls /sys/class/scsi_host/

host0

[root@localhost ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@localhost ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       10443    83778975   8e  Linux LVM

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


Disk /dev/sdc doesn't contain a valid partition

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值