ESXI4.1linux virtual machine resize

Source: Internet
Author: User
To resize an ESXI4.1linux VM, first adjust the disk size to 60Gwww.2cto.com. note: If the VM cannot adjust the size of the snapshot, you must delete the snapshot before you can confirm the adjustment, restart vm OS [root @ download1 ~] Shutdown-rnow...
ESXI4.1 adjust the disk size for linux virtual machines first, adjust the disk size to 60 GB www.2cto.com. note: If you cannot adjust the disk size for a snapshot of a virtual machine, you must delete the snapshot before adjusting the disk size.

Click OK to restart the vm OS [root @ download1 ~] Shutdown-r now [root @ download1 ~] Fdisk-l Disk/dev/sda: 64.4 GB, 64424509440 bytes255 heads, 63 sectors/track, 7832 cylindersUnits = cylinders of 16065*512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 2610 20860402 + 8e Linux LVM [root @ download1 ~] # Df-hl file system capacity in use available % mount point/dev/mapper/VolGroup00-LogVol00 19G 12G 6.4G 64%/dev/sda1 99 M 20 M 75 M 21%/boottmpfs 2.0G 0 2.0G 0%/dev/shm [root @ download1 ~] # Fdisk/dev/sda The number of cylinders for this disk is set to 7832. there is nothing wrong with that, but this is larger than 1024, and cocould in certain setups cause problems with: 1) software that runs at boot time (e.g ., old versions of LILO) 2) booting and partitioning software from other OSs (e.g ., dos fdisk, OS/2 FDISK) Command (m for help): nCommand action e extended p primary partition (1-4) p Partition number (1-4): 3 First cylinder (2611-7832, default 2611 ): press enter Using default value 2611 Last cylinder or + size or + sizeM or + sizeK (2611-7832, default 7832) by default. press enter Using default value 7832 Command (m for help ): tPartition number (1-4): 3Hex code (type L to list codes): 8 eChanged system type of partition 3 to 8e (Linux LVM) Command (m for help ): p Disk/dev/sda: 64.4 GB, 64424509440 bytes255 he Ads, 63 sectors/track, 7832 cylindersUnits = cylinders of 16065*512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 2610 20860402 + 8e Linux LVM/ dev/sda3 2611 7832 41945715 8e Linux LVM Command (m for help): w save and quit The partition table has been altered! Calling ioctl () to re-read partition table. WARNING: Re-reading the partition table failed with error 16: the device or resource is busy. the kernel still uses the old table. the new table will be used at the next reboot. syncing disks. restart vm OS [root @ download1 ~] # Shutdown-r now [root @ download1 ~] Fdisk-lDisk/dev/sda: 64.4 GB, 64424509440 bytes255 heads, 63 sectors/track, 7832 cylindersUnits = cylinders of 16065*512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 2610 20860402 + 8e Linux LVM/ dev/sda3 2611 7832 41945715 8e Linux LVM [root @ download1 ~] # Df-hl file system capacity in use available % mount point/dev/mapper/VolGroup00-LogVol00 19G 12G 6.4G 64%/dev/sda1 99 M 20 M 75 M 21%/boottmpfs 2.0G 0 2.0G 0%/dev/shm [root @ download1 ~] # Df-T/dev/sda1 file system type 1 K-block used available % mount point/dev/sda1 ext3 101086 19487 76380 21%/boot Formatting/dev/sda3 [root @ download1 ~] # Mkfs. ext3/dev/sda3 mke2fs 1.39 (29-May-2006) Filesystem label = OS type: LinuxBlock size = 4096 (log = 2) Fragment size = 4096 (log = 2) 5248992 inodes, 10486428 blocks524321 blocks (5.00%) reserved for the super userFirst data block = 0 Maximum filesystem blocks = 4294967296321 block groups32768 blocks per group, 32768 fragments per group16352 inodes per groupSuperblock backups stored on blocks: 32768,983 04, 16 3840,229 376, 294912,819 200, 884736,160 5632, 2654208,409 6000, 7962624 Writing inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 28 mounts or180 days, whichever comes first. use tune2fs-c or-I to override. create PV [root @ download1 ~] # Pvcreate/dev/sda3 Physical volume "/dev/sda3" successfully created view PV Status [root @ download1 ~] # Pvdisplay/dev/hdc: open failed: no media found --- Physical volume --- PV Name/dev/sda2 VG Name VolGroup00 PV Size 19.89 GB/not usable 19.49 MB Allocatable yes (but full) PE Size (KByte) 32768 Total PE 636 Free PE 0 Allocated PE 636 pv uuid KjvMTJ-8laN-yuwe-N0oA-jtsF-Z0oc-CnzOUX "/dev/sda3" is a new physical volume of "40.00 GB" --- NEW Physical volume --- PV Name/dev/sda3 VG Name PV Size 40.00 GB Al Locatable no pe Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 pv uuid J9yLqC-vpK8-jiwd-5STl-kbRT-BGMg-UB6uPk [root @ download1 ~] # Vgdisplay/dev/hdc: open failed: media --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable max lv 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 19.88 gb pe Size 32.00 MB Total PE 636 Alloc PE/Size 636/19 .88 GB Free PE/Size 0/0 vg uuid V6H9Dr-e1mb-7E3v-uEgv-UyYX-da9Q-fD8VVp just created PV add the corresponding VG [ro Ot @ download1 ~] # Vgextend VolGroup00/dev/sda3/dev/hdc: open failed: Media Volume group "VolGroup00" successfully extended [root @ download1 ~] cannot be found # Vgdisplay/dev/hdc: open failed: media --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 4 VG Access read/write VG Status resizable max lv 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 59.88 gb pe Size 32.00 MB Total PE 1916 Alloc PE/Size 636/19 .88 GB Free PE/Size 1280/40 .00 gb vg uuid V6H9Dr-e1mb-7E3v-uEgv-UyYX-da9Q-fD8VVp view LV Status [root @ download1 ~] # Lvdisplay/dev/hdc: open failed: media --- Logical volume --- LV Name/dev/VolGroup00/LogVol00 VG Name VolGroup00 lv uuid sSmNj2-Gw4B-hYE2-9nUw-ybJV-6Yxa-DU4VJt LV Write Access read/write LV Status available # open 1 LV Size 19.12 GB Current LE 612 segments 1 Allocation inherit Read ahead sectors auto-currently set to 256 Block device 253: 0 --- Logical volume --- LV Name/dev/VolGroup00/LogVol0 1 VG Name VolGroup00 lv uuid LIrXiG-3IiO-LhjI-o3yN-vI5T-Yamm-FxD31j LV Write Access read/write LV Status available # open 1 LV Size 768.00 MB Current LE 24 Segments 1 Allocation inherit Read ahead sectors auto-currently set to 256 Block device 253: 1 ================================================ ========================= [root @ download1 ~] # Lvextend-l + 2559/dev/VolGroup00/Do not press enter LogVol00 LogVol01 note! If you do not know which one to select, use the following command to obtain [root @ download1 ~]. # Df-hl file system capacity in use available % mount point/dev/mapper/VolGroup00-LogVol00 19G 12G 6.4G 64%/dev/sda1 99 M 20 M 75 M 21%/boottmpfs 2.0G 0 2.0G 0%/dev/shm ============================== ============================================= increase the capacity for/dev/VolGroup00/LogVol00 [root @ download1 ~] # Lvextend-l + 2559/dev/VolGroup00/LogVol00/dev/hdc: open failed: Media Extending logical volume LogVol00 to 99.09 GB Insufficient free space: 2559 extents needed, but only 1280 available [root @ download1 ~] # Lvextend-l + 1280/dev/VolGroup00/LogVol00/dev/hdc: open failed: unable to find the media Extending logical volume LogVol00 to 59.12 GB Logical volume LogVol00 successfully resized use resize2fs to adjust the file system size [root @ download1 ~] # Resize2fs/dev/mapper/VolGroup00-LogVol00resize2fs 1.39 (29-May-2006) Filesystem at/dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required‑ming an on-line resize of/dev/mapper/VolGroup00-LogVol00 to 15499264 (4 k) blocks. the filesystem on/dev/mapper/VolGroup00-LogVol00 is now 15499264 blocks long. [root @ download1 ~] # Df-hl
File system capacity used available % mount point/dev/mapper/VolGroup00-LogVol00 58G 12G 44G 21%/dev/sda1 99 M 20 M 75 M 21%/boottmpfs 2.0G 0 2.0G 0%/dev/shm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.