extend filesystem

So I have run out of room on my FreeBSD 11.x VM. Here is my partition layout:
Code:
df -hT
Filesystem           Type       Size    Used   Avail Capacity  Mounted on
/dev/da0p2           ufs        4.8G    323M    4.1G     7%    /
devfs                devfs      1.0K    1.0K      0B   100%    /dev
/dev/da0p4           ufs         15G     13G    212M    98%    /usr
/dev/da0p5           ufs         15G    6.3G    7.0G    47%    /var
/dev/da0p6           ufs        4.8G     32M    4.4G     1%    /opt
/dev/da0p7           ufs        4.8G     32M    4.4G     1%    /tmp
/dev/da0p8           ufs        4.8G    1.4G    3.0G    32%    /home
/dev/da0p9           ufs         39G     42M     36G     0%    /jails
procfs               procfs     4.0K    4.0K      0B   100%    /proc
fdescfs              fdescfs    1.0K    1.0K      0B   100%    /dev/fd

Is there an easy way to resize partition 4 which is my /usr partition?

I want to use the some of the 26GB to resize partition 4, is it true that I HAVE to delete the partitions prior to it?

I have tried to use a few direction on some people's blogs. But its not working the way they did it.

Here is my gpart output:
Code:
gpart show 
    =>       40  251658160  da0  GPT  (120G)
         40       1024    1  freebsd-boot  (512K)
       1064   10485760    2  freebsd-ufs  (5.0G)
   10486824   31457280    4  freebsd-ufs  (15G)
   41944104   31457280    5  freebsd-ufs  (15G)
   73401384   10485760    6  freebsd-ufs  (5.0G)
   83887144   10485760    7  freebsd-ufs  (5.0G)
   94372904   10485760    8  freebsd-ufs  (5.0G)
  104858664   83886080    9  freebsd-ufs  (40G)
  188744744   54524928       - free -  (26G)
  243269672    8388527    3  freebsd-swap  (4.0G)
  251658199          1       - free -  (512B)
 
If I understand corectly, what you would basically want is to move all partitions to the end of that 26GB space and resize partition #4. There's no straightforward way to move partitions around once they're created. The only program I've ever seen that was able to do it was Parted/GParted, and from my experience it takes longer to move partitions than it does to simply recreate the partition layout and restore a backup.

If you've got the space on your host machine, you could just attach a new virtual disk and partition that, then use dump(8) and restore(8) to copy the system to the new disk.
 
Its not like Linux.
You'll have the exact same "problem" on Linux too. The other partitions are simply in the way. So you can never extend the /usr/ partition. Note that things like LVM work in an entirely different way and then it would be possible to "extend" the /usr/ partition. But if you used the traditional ext2/3/4 partitions you will have the exact same issue.
 
Back
Top