Version : 5.2.12r122591
Also note: there are no snapshots on this system, and yes the guest was powered off during the modifymedium command.
Details : Want to increase the capacity of a dynamicly sized VDI disk from 256GB to 1TB.
Run showmediuminfo on the drive to show information. You can see it is 256GB.
Run modifymedium to increase the size to 1TB.vbox@devops01:~$ VBoxManage showmediuminfo 40df678e-7fa6-49d9-84e2-e3cf81ffd72e
UUID: 40df678e-7fa6-49d9-84e2-e3cf81ffd72e
Parent UUID: base
State: locked write
Type: normal (base)
Location: /mnt/scqn001/vbox/vms/scvl003/scvl003-02.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 256000 MBytes
Size on disk: 181761 MBytes
Encryption: disabled
In use by VMs: scvl003 (UUID: 2ce1ff48-ce99-4e6e-8416-53b82e70652f)
As you can see, the command ran fine. Let's do an fdisk to show the new drive capacity, according to Linux (in bold below).vbox@devops01:~$ VBoxManage modifymedium 40df678e-7fa6-49d9-84e2-e3cf81ffd72e --resize 1048576
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
So Linux sees the new drive capacity at 1TB, which is good. And the original partition is still intact, which is also good. Now we run parted to increase the partition to use the newly expanded drive.[2002 root@scvl003 ~]$ fdisk -l
Disk /dev/sda: 64 GiB, 68719476736 bytes, 134217728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2e047c51
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 132216831 132214784 63G 83 Linux
/dev/sda2 132218878 134215679 1996802 975M 5 Extended
/dev/sda5 132218880 134215679 1996800 975M 82 Linux swap / Solaris
Disk /dev/sdb: 1 TiB, 1099511627776 bytes, 2147483648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbdd71e19
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 524287999 524285952 250G 83 Linux
As you can see, the partition has been resizeed to be the new entire drive. Now we run resize2fs to expand the partition.2008 root@scvl003 ~]$ parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdb
Using /dev/sdb
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 1100GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 268GB 268GB primary ext4
(parted) resizepart
Partition number? 1
Warning: Partition /dev/sdb1 is being used. Are you sure you want to continue?
Yes/No? yes
End? [268GB]? 1100GB
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sdb: 1100GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1100GB 1100GB primary ext4
(parted) quit
Information: You may need to update /etc/fstab.
Let's confirm the size by doing a df. As shown below, the drive is now 1TB.[2011 root@scvl003 ~]$ resize2fs /dev/sdb1
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/sdb1 is mounted on /mnt/data01; on-line resizing required
old_desc_blocks = 16, new_desc_blocks = 64
The filesystem on /dev/sdb1 is now 268435200 (4k) blocks long.
Code: Select all
[2012 root@scvl003 ~]$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1002868 0 1002868 0% /dev
tmpfs 204804 6020 198784 3% /run
/dev/sda1 64937780 4369728 57246300 8% /
tmpfs 1024008 0 1024008 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1024008 0 1024008 0% /sys/fs/cgroup
/dev/sdb1 1056762036 186673648 824501788 19% /mnt/data01
Even after using modifymedium to increase the size, showmediuminfo doesn't think it's been resized, even though Linux does. It still shows the original capity of 256GB.
So what's going to happen when I hit the VDI "capacity" of 256GB on a system tht Linux thinks is 1TB?vbox@devops01:~$ VBoxManage showmediuminfo 40df678e-7fa6-49d9-84e2-e3cf81ffd72e
UUID: 40df678e-7fa6-49d9-84e2-e3cf81ffd72e
Parent UUID: base
State: locked write
Type: normal (base)
Location: /mnt/scqn001/vbox/vms/scvl003/scvl003-02.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 256000 MBytes
Size on disk: 181761 MBytes
Encryption: disabled
In use by VMs: scvl003 (UUID: 2ce1ff48-ce99-4e6e-8416-53b82e70652f)
Can anyone else confirm these results? or am I missing something?