EXSi里调大硬盘大小后在linux里怎么生效

本文提供了一套详细的步骤来帮助读者扩大虚拟机中的磁盘分区及文件系统大小。包括重启内核确认磁盘被识别、使用fdisk调整分区大小、调整LVM物理卷与逻辑卷、最后使用resize2fs命令更新文件系统的大小。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

下面是步骤,强烈建议之前备份数据

  1. It looks like you've already rebooted but just in case, ensure the kernel recognizes the larger disk

    echo 1 > /sys/class/scsi_disk/0:0:0:0/device/rescan
    
  2. Resize the second partition with fdisk

    fdisk /dev/sda
    p     # print current
    d     # delete
    - 2
    n     # create
    - p   # primary partition
    2     # partition number
    - default first/last cylinders
    t     # change partition id
    - 2
    - 8e (hex code)
    p     # print the current again to verify it's expanded
    w     # write changes
    
  3. Reboot the virtual machine

    shutdown -r now
    
  4. Once it's back up, resize the LVM physical volume

    pvresize /dev/sda2
    
  5. Now resize the LVM logical volume (NOTE: I'm unable to decipher what your logical volumes name is based on the screenshots and thus am assuming LogVol00. You can determine this by running lvdisplay.)

    lvresize -l +100%FREE /dev/VolGroup00/LogVol00
    
  6. Finally, lets resize the filesystem

    resize2fs -p /dev/VolGroup00/LogVol00
    
  7. Verify the filesystem is larger

    df -h

转载于:https://www.cnblogs.com/zencore/p/4497767.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值