Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using VirtualBox and have my FreeBSD mounted on a virtual drive, which recently ran out of space (10 GB) so I have increased the Virtual Drive size up to the 15 GB - started my FreeBSD and its still out of space, because it doesnt "refresh" the main partition size:

# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    9.3G    9.3G   -711M   108%    /
devfs          1.0k    1.0k      0B   100%    /dev

How can I set the partition size to the virtual drive size?

share|improve this question

Essentially the reason for this is although you have increased the physical disk size presented to your OS you have not increased the partition size on the disk.

If you are not completely comfortable using command line utilities etc and the warnings they give don't make much sense to you then the most simple method of resolving your problem would be to download a gparted .iso and boot the virtual machine from the .iso this will give you a nice simple interface to increase the partition size on your virtual disk.

Link for gparted:

Best of luck.

share|improve this answer
How at the same time it would be possible in VirutalBox to boot from the ISO and VDI at the same time? (Gparted must have read VDI to correct the problem so I can not unattach the storage). – Lucas Nov 9 '13 at 15:06
You dont need to, you simply change the bot order and boot from the gparted live CD, the live CD will pick up the VDI and allow you to resize it. – Backtogeek Nov 9 '13 at 16:18
I have changed the boot order and started live CD of gparted, everything has started successfully but it couldnt recognize the file systems of my partitions from the VDI file, I couldnt click on the "resize/move" option, because mostly likely it couldnt recognize their file system. I dont even know if it supports BSD's file system. – Lucas Nov 9 '13 at 16:42
Ah.. So sorry I remember now that gparted does not support BSD file systems, I did a quick google for an equivalent without much joy although this guide on doing via cli seems fairly straight forward:… – Backtogeek Nov 9 '13 at 17:07

There are a few steps. First you need to boot into a "FreeBSD Live CD" so you can manipulate the disk data. Then you need to define the new parameters of your disk via gpart, such as using gpart resize -i <the index from where you want to expand>, then you use growfs to resize the filesystem to the new partition size.

share|improve this answer
Yeah, growfs is a problem here: # growfs /dev/ada0p2 growfs: /dev/ada0p2: Operation not permitted. – Lucas Nov 9 '13 at 14:04
Silly question, but are you running it as root? And are you running it from single-user mode? – VogonPoetLaureate Nov 9 '13 at 22:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.