13.01.2012 17:22, Stuart Henderson P?P8QP5Q:
On 2012/01/13 16:55, lilit-aibolit wrote:
13.01.2012 16:11, Stuart Henderson P?P8QP5Q:

    a:             1.0G               63  4.2BSD   2048 16384    1 # /
    b:             1.2G          2097215    swap
    c:            37.3G                0  unused
    d:             2.6G          4683375  4.2BSD   2048 16384    1 # /tmp
    e:             4.0G         10052439  4.2BSD   2048 16384    1 # /var
    f:             2.0G         18541648  4.2BSD   2048 16384    1 # /usr
    g:             1.0G         22735952  4.2BSD   2048 16384    1 # /usr/X11R6
    h:             3.5G         24833104  4.2BSD   2048 16384    1 # /usr/local
    i:             1.9G         32229473  4.2BSD   2048 16384    1 # /usr/src
    j:             1.9G         36247864  4.2BSD   2048 16384    1 # /usr/obj
    k:            18.1G         40266255  4.2BSD   2048 16384    1 # /home

As you have partitions on the disk between /usr and /home,
you can't easily just grow /var.

Here are some options:

- backup, reinstall with better partition sizes, restore.

- swap /var and /home partitions (shut down services, copy files
around between the partitions, swap the fstab entries, reboot).
if you are not totally confident with doing this, make sure your
backups are up-to-date first.

- if you only need a little more space, or if you need to buy some
time until you an plan a proper reinstallation, move your squid
cache_dir to /home.



I got the same recommendation from Vadim Zhukov persg...@gmail.com
with little difference, do it in single mode:

1. Boot in single user mode, enter shell.
2. mount /, /usr, /var and /home.
3. Move /var/* to /home.
4. Move /home/* to /var (except what moved on step 3).
5. Umount /home and /var.
6. Edit fstab and switch /home and /var mount points.
7. Try to mount /home and /var now, checking all is ok.
8. Proceed booting (^D) and have a nice day.

but I operate remotely, and can't shut down all services, such PF or
SSH. So in any way I need to do this locally?

I do not *recommend* doing this without console access, but
sometimes there is no other choice. ;-) Since you don't have
full access you need to take extra care.

Shut down anything that you don't absolutely require. syslogd,
squid, httpd/nginx, whatever.

I would *copy* files from /home to /var, not move them (of course
you'll need to clear some space first - old logs or squid cache
might be a good candidate). I would probably skip steps 5 and
7, just be careful that your fstab lines are correct.

Take care and think about every command before you press the
enter key. Check that everything is in the right place before
you reboot.



Thanks all, who help to do this.
After testing on local PC,
I do it on remote server by following next step:
- shutdown and pkill all process except sshd
- cp -pR /var/* /home
- same for home dir to var
- change letter in fstab
- reboot and remove unnesessary files in var and home
- everything is work correctly and now I have more space in var
for www-project:

Using username "root".
Last login: Thu Feb 23 08:57:29 2012 from 192.168.14.113
OpenBSD 4.7-stable (GENERIC) #3: Mon Sep 27 15:35:17 EEST 2010

# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0a     1005M    211M    744M    22%    /
/dev/wd0k     17.8G    2.0G   14.9G    12%    /var
/dev/wd0d      2.5G    6.0K    2.4G     0%    /tmp
/dev/wd0f      2.0G    927M    985M    48%    /usr
/dev/wd0g     1005M    167M    787M    18%    /usr/X11R6
/dev/wd0h      3.5G    280M    3.0G     8%    /usr/local
/dev/wd0j      1.9G    993M    841M    54%    /usr/obj
/dev/wd0i      1.9G    790M    1.0G    43%    /usr/src
/dev/wd0e      4.0G    411M    3.4G    11%    /home
#

Reply via email to