First question:
When I run df -h
I can see this:
# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad4s1a 9.7G 8.0G 918M 90% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad4s1d 1.8T 6.7G 1.6T 0% /home
procfs 4.0K 4.0K 0B 100% /proc
linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc
devfs 1.0K 1.0K 0B 100% /var/named/dev
Why doesnt it show directories like:
/var
/etc
/usr
? On my earlier dedicated server, I was able to view every partition size available, but here I got only /home
and /
...
Second question:
How I can increase the /var
partition size? Because after 2 hours of working, this partition is became full...
The df command reports disk space usage by file system. Your
/var
/etc
and/usr
are not a separate file systems they are part of the/
file system. You only have 2 file systems/
and/home
.If you can reinstall the system you could change the partitions to create a
/var
file system of a suitable size.If you can't then you could try creating a link
/var
->/home/var
but the specifics of how to do this depend on the access you have tot he system.Because they don't have their own file system on this machine, but are subdirectories of
/
.Because you only have those, presumably.
Youy can't, because you don't have a
/var
partition.If you add another disk, you could move all the stuff under
/var
to this disk and mount it as/var
.Edit: I just saw that
/home/
is nearly empty. So, move all your stuff under/var
to/home/var
and replace/var
by a symlink there. It's possible that you may need to do this in single-user mode or from a rescue system.As mentioned above, you can't increase
/var
as far as it is not a seperate FS. But you can move it from/
to larger FS like/home
. The only suggestion - usedump/restore
to move current content of /var to new location insteadmv
ortar
voodoo. That saves not only ownerships and permissions but also so-called 'flags' like schg/uchg for /var/empty. Also, I want to prevent you from creating hardlink /home/var -> /var as far, as /home and / are on different partitions. Generally all can be done this way:Sure, all above needs single-user mode or, if it's unavailable, you first have to stop all daemons that uses /var - like sendmail or mysql.
The other good practice - move out not the whole /var but only dirs that tends to grow. Such are /var/db/mysql, /var/log and /var/mail. I prefer to create a seperate homes for them - /usr/home/log, /usr/home/mysql and /usr/home/mail and so on. Thus dirs are linked to their usual locations in /var to prevent software configuratons.
I would take a slightly different approach to what's been proposed so far, simply because I don't like symlinking inside
/var
. As before, create a new directory under/home
to hold the data you want to move, and copy the data across.You can use a
nullfs
mount point to mount the real directory (e.g.,/home/var/db/mysql
) to the location the software expects it:In
/etc/fstab
, you'd want this:Note that for this approach to work, you need either
options NULLFS
in your kernel, or you need to have the nullfs kernel module available.As far as the system is concerned, it can access the contents of
/home/var/db/mysql
through/var/db/mysql
exactly as normal. This approach also means that utilities like stat(1) and realpath(1) will report paths as being under/var
, and not under/home/var
.