0

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?

2 Answers 2

1

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: http://gparted.sourceforge.net/

Best of luck.

4
  • 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, 2013 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, 2013 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, 2013 at 16:42
  • 1
    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: unibia.com/unibianet/freebsd/…
    – Backtogeek
    Nov 9, 2013 at 17:07
0

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.

2
  • Yeah, growfs is a problem here: # growfs /dev/ada0p2 growfs: /dev/ada0p2: Operation not permitted.
    – Lucas
    Nov 9, 2013 at 14:04
  • Silly question, but are you running it as root? And are you running it from single-user mode? Nov 9, 2013 at 22:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .