On Sun, Sep 02, 2018 at 04:16:57PM +0000, Ken M wrote:
> OK so now that I have been saved from my stupidity, let's try to prevent more
> stupidity.
> 
> $ df -h
> Filesystem     Size    Used   Avail Capacity  Mounted on
> /dev/sd0a     1005M    245M    710M    26%    /
> /dev/sd0h     62.9G   21.7G   38.1G    36%    /home
> /dev/sd0d      3.9G    302K    3.7G     0%    /tmp
> /dev/sd0f     14.8G   11.6G    2.5G    82%    /usr
> /dev/sd0g     19.7G    1.1G   17.6G     6%    /usr/ports
> /dev/sd0e     11.2G   56.1M   10.6G     1%    /var
> 
> Above is my current disk setup, what I would like to do is shrink /usr/ports 
> to
> grow /usr.  
> 
> So from what I get growfs will work if I have space after /usr. So can I 
> shrink
> /usr/ports and move it back so there is space after /usr or do I need to
> completely drop and recreate /usr/ports?
> 

You can only do this if /usr/ports is directly after /usr.
Use disklabel sd0 to get the positions.

However, if /usr/ports is big enough and it's in the wrong spot, you can
play games with switching them. I do this occasionally.
If you can pull this off, use the n command in disklabel to rename /usr
to something like /usr2 and /usr/ports as /usr/ports2, fiddle things
around and then turn /usr2 into /usr/ports and /usr/ports2 into /usr.

What I don't see is /usr/local and that makes things much harder unless
you can pkg_delete everything and then re-install.
You might find it much easier to ditch /usr/ports, add /usr/local to
disklabel and another for /usr/ports that is much smaller.

But we need to see your disklabel or any advice is hard to give.
Also, by not having a /usr/local partition, your security is worse since
that is the only partition that should use wxallowed in /etc/fstab.

Basically, this is going to be really easy or really challenging.
growfs works well. There is no such command as shrinkfs, but it can be
done if well planned, usually. Or maybe not.

Others may have different advice, but put up your disklabel sd0 here
for sure.
Just be glad you don't need to move /var. I've done it but ugh!

Chris Bennett


Reply via email to