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

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

  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
posted @ 2015-05-12 16:34  蛮婆的老公  阅读(241)  评论(0编辑  收藏  举报