记一次成功的ESXi下Linux扩容硬盘案例。

本文记录了一次在ESXi 6.7环境下,针对CentOS 6.0系统成功扩容硬盘的案例。通过增加10G空间,详细步骤包括查看现有硬盘状态、新建分区、扩展逻辑卷、使用partprobe更新分区信息、创建物理卷、扩容逻辑卷及使用resize2fs或xfs_growfs调整文件系统大小,最终实现从40G到50G的扩容。
摘要由CSDN通过智能技术生成

Linux:CentOS 6.0

ESXi:6.7

原硬盘空间为40G,在VM上增加10G空间到50G,如下硬盘扩容操作过程。

#扩容前查看硬盘使用空间为39G,已使用100%.

[root@EZ cacti]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_cactiezv10-LogVol00
                       39G   39G     0 100% /
tmpfs                1004M     0 1004M   0% /dev/shm
/dev/sda1             194M   25M  160M  14% /boot

#ESXi中增加硬盘空间后,如下操作。

1,查看当前待扩容硬盘状态。
[root@EZ ~]# fdisk -l   

Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00089c87

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        5222    41737216   8e  Linux LVM

Disk /dev/dm-0: 41.7 GB, 41662021632 bytes
255 heads, 63 sectors/track, 5065 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

2,进行分区操作。

[root@EZ ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): (新建分区)
Command action
   e   extended
   p   primary partition (1-4)
 (主分区)
Partition number (1-4): 3    (选择默认或指定分区号,默认起始位置和结束位置(全盘))
First cylinder (5222-6527, default 5222): 
Using default value 5222
Last cylinder, +cylinders or +size{K,M,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值