Subscribe to the RSS Feed


Grow FreeBSD UFS filesystem on VmWare HDDs

In this artice I’m going to show you how to expand your UFS filesystem under FreeBSD that runs in a Vmware Virtual Machine.

FreeBSD uses slices instead of traditional PC partitions. To sum it up shortly, it means that your whole disk contains only a single traditional partition with the partition type ‘freebsd(165)’. Inside this partition you will have slices. In a typical FreeBSD installation you have seperate slices for /, /usr, /var, /tmp and swap. In most cases the last slice on the partition is the /usr, and hopefully this is the one we have to extend, because in this case the only thing needed is to add some space to the end of the drive and extend the last slice. Sounds easy? Don’t think so!

The main steps are:

  1. Increase the actual (virtual) hdd size
  2. Extend the partition to cover the whole disk
  3. Extend the size of the last slice to cover the whole partition
  4. Extend the actual UFS filesystem on the newly modified slice

All the details:
First, forget livecds like gparted-live, knoppix, other partition hacking tools because they will not work.

Posted 2009/11/30 07:31 by jos


  1. Jun 14, 09:46 AM

    BMac Says:

    I followed your instructions exactly. Did the calculations you recommended and intentionally made it larger to see if fdisk would correct the value (to verify my calculations) and it was correct. I edited the disk label as instructed and it matches the values from fdisk -s (I verified that the fdisk -s size values matched the raw size in bsdlabel on two other FreeBSD machines and they did) however.. growfs STILL will not grow….

    # growfs /dev/da0s1f
    GEOM_LABEL: Label ufsid/4b60blahblah
    growfs: we are not growing (3204711->3204711)
    GEOM_LABEL: Label for provider da0s1f is ufsid 4b60blahblah


    any advice?

  2. Sep 16, 06:30 AM

    Anesti Bubulya Says:

    I had to boot into single user mode to run fdisk -u to change the geometry of the partition. I actually moved the files onto a backup slice. Then I had to boot using a boot CD/Floppy to make changes to the slice in question. I deleted the slice I was trying to grow, then created the slice again and moved all the files back. Cumbersome, but it worked.

  3. Sep 17, 11:11 AM

    Alexey Says:

    Could you please expand the step
    1.First the line where it says do not edit…
    2.To get the new size…

    What was before and what was after (bsdlabel screenshots). Thank you

Leave a Comment

Add your comment. Preview then Submit.


Textile Help