EXSi里调大硬盘大小后在linux里怎么生效
下面是步骤,强烈建议之前备份数据
-
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
-
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
-
Reboot the virtual machine
shutdown -r now
-
Once it's back up, resize the LVM physical volume
pvresize /dev/sda2
-
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 runninglvdisplay
.)lvresize -l +100%FREE /dev/VolGroup00/LogVol00
-
Finally, lets resize the filesystem
resize2fs -p /dev/VolGroup00/LogVol00
-
Verify the filesystem is larger
df -h