Command actionĪs I already have /dev/sda1 and /dev/sda2 as shown in previous images, I have gone with using ‘3’ for this new partition which will be created as /dev/sda3 Partition number (1-4): 3 ‘p’ is then selected as we are making a primary partition. Switch off the mode (command 'c') and change display units to WARNING: DOS-compatible mode is deprecated. ‘n’ was selected for adding a new partition. Note that you can press ‘m’ to get a full listing of the fdisk commands. We are now using fdisk to create a new partition, the inputs I have entered in are shown below in bold. Note that we do not have 4 primary partitions already in place, making this method possible. sudo echo "-" > /sys/class/scsi_host/host0/scan Partition the new disk spaceĪs outlined in my previous images the disk in my example that I am working with is /dev/sda, so we use fdisk to create a new primary partition to make use of the new expanded disk space. Also, you’ll have to run with root permissions. Note you may need to change host0 depending on your setup. You will most likely see that the disk space is still showing as the same original size, at this point you can either reboot the server and it will detect the changes on boot or you can rescan your devices to avoid rebooting by running the below command. Once the physical disk has been increased at the hardware level, we need to get into the operating system and create a new partition that makes use of this space to proceed.īefore we can do this we need to check that the new unallocated disk space is detected by the server, you can use fdisk -l to list the primary disk. (This was taken from an excellent article at. Next, boot your virtual machine into Linux, and enter the following commands. The number after –resize is the new size in MB. Resize the Drive in VirtualBox c:\Program Files\Oracle\VirtualBox>vboxmanage modifymedium "C:\Users\chaos\VirtualBox VMs\Medstro_Dev\debian_server.vdi" -resize 30000 Here are the steps as I’ve culled from the Internet and tested myself. After resizing the drive, you have to do a lot of extra steps to actually add the new space to your logical volume. There are plenty of resources available showing you how to simply resize a VirtualBox hard drive, but the process is extremely complicated if you’re running Linux with Logical Volume Manager.