Hello ! The problem is this. I want upgrade version FreeBSD 12.3 not enough space in /var. Took a bite off /usr
gpart -i 4 -s 26G -a 4K ada0.
How add in /var free-space 4G ?
rm -rf /var/*
# mkdir -p /var2
# mv /var/log /var2
# ls /var2/log # check ok
# ls /var/log # check empty
# ln -s /var2/log /var/log
# ls /var/log # check ok
Normally you don't want /usr or /var on different filesystems. Booting can have problems.
Maybe you need to copy over /var to another place then remake the partition, remake the filesystem and copy /var back over to the new (bigger) location.It would be useful to have posted your gpart show in text, e.g. in a 'code' block, plus either 'df' output or your /etc/fstab, to connect your partitions to filesystems - so I'll guess a bit.
There are two obvious ways to deal with this; either should be done in single-user mode to avoid any updates to /var.
Either way, first backup your existing /var, safest with dump(8) to e.g. /usr/vardump. The first method relies on this; for the second it's good insurance.
1) per handbook section 18.3: IFF the 4G new free space is adjacent to your present /var (the 2.9G?) then you could
a)rm -rf /var/*
b) grow present /var into the free space with gpart(8), then
c) restore(8) /var contents from the vardump.
2) the old tried and tested way of using symlink/s to add space to /var from elsewhere on the disk.
Make 4G free space a new partition with gpart, call it e.g. '/var2'.
# mkdir -p /var2
and add it to /etc/fstab if gpart did not.
With the subdir of /var that needs more space, e.g. /var/log:
Code:# mv /var/log /var2 # ls /var2/log # check ok # ls /var/log # check empty # ln -s /var2/log /var/log # ls /var/log # check ok
Repeat if needed for other dirs, maybe /var/db ?
# reboot
If all's well you can remove the vardump, or back it up ...
/home & /tmp can be on separate filesystems. /usr can't as far as i know.What problems, specifically?
Some people have been using separate filesystems for those and sometimes /tmp and/or /home for 20+ years.
Sure, it's best that you know what you're doing. It's easy to underestimate just how huge most software has grown in just a few years; I know I've done that with 12.3-RELEASE.
Maybe you need to copy over /var to another place then remake the partition, remake the filesystem and copy /var back over to the new (bigger) location.
I was been using /usr on a separated partition with a UFS. It was a recomended setup./home & /tmp can be on separate filesystems. /usr can't as far as i know.
/home & /tmp can be on separate filesystems. /usr can't as far as i know.
Sometimes it can be advantage to put specific subdirectories of /var on separate filesystems