But there is no GUI tool available for virtual box right now. Instead you can use command to do this.
- Backup the existing vm disk file (*.vdi)
- Create empty VM disk by selecting Settings Menu of VM –> Storage –> Add Hard Disk –> Create new disk. and give bigger size you want to extend
- Use VBoxManage to clone hard disk
- Open command line
- Go to directoty: C:\Program Files\Oracle\VirtualBox
- Type command: vboxmanage "old.vdi" "new.vdi"
- From VM settings remove old disk and attach new disk.
- For Windows: using Disk Management to extend; for Linux: doing steps
- Identify the device name, which is by default /dev/sda, and confirm the new size by running the command:
# fdisk -l - Create a new primary partition:
- Run the command:
# fdisk /dev/sda - List all partitions by pressing p. By default there are 2 partitions: /dev/sda1 and /dev/sda2
- Press n to create new primary partition
- Press p for primary
- Based on the existing partitions, choose next partition number: 3
- Press Enter twice.
- Save all changes by pressing w
- Restart VM
- Check all changes:
# fdisk -l - Convert new partition to a physical volume:
# pvcreate /dev/sda3 - Determine which volume group to extend:
# vgdisplay - Extend the physical volume:
# vgextend VolGroup00 /dev/sda3 - Specify how many physical extends:
# vgdisplay VolGroup00 | grep "Free" - Extend logical volume:
# lvextend -L+#G /dev/VolGroup00/LogVol00
(#: number of free space we want to extend) - Expand the ext3 filesystem online
# resize2fs /dev/VolGroup00/LogVol00 - Verify new space
# df -h
Không có nhận xét nào:
Đăng nhận xét