Sunday, January 11, 2015

OpenBSD root Partition on 99%

well this post is related to a problem that i have with postfix, where the daemon did not work correctly but i found the solution but the problem with the root partition where not fixed at all, so i have to dig and search asking myself why it i have partition the disk correctly, i saw and saw the partitions and the answer where not revealed.

i even check out the virtual machine in my laptop and could see that the root partition where just using 40 % of the space and not growing up, here is the actual partition layout

Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sd0a       2.0G      1.9G       97M    99%    /
/dev/sd0i      98.4G    14.0G    79.4G    15%    /home
/dev/sd0d       3.9G    24.0K      3.7G      0%    /tmp
/dev/sd0e       2.9G     1.4G       1.4G    49%    /usr
/dev/sd0f        9.8G    777M       8.6G      8%    /usr/local
/dev/sd0h       2.0G     1.1G      762M    60%    /usr/obj
/dev/sd0g       2.0G    863M       1.0G    45%    /usr/src
/dev/sd0k      497G    257G       215G    54%    /var/mail
/dev/sd0j       298G   10.1G       273G     4%    /var/www

so can you see the problem, good for you but i could not, so after some times i saw my mistake there is no /var partition so all on var but var/{mail,www} belog to root partion /, and that include:

account/, amavisd/, arpwatch/,audit/,...named/,mysql/, you got it and yes damm!!!

since it is more difficult to resize and create partitions i decide to move mysql from /var/mysql to /var/www/mysql i know that this maybe not desired but what can i do i am lazy and do not have too much time and of course first i need to set up a similar situation over my virtual test machine to avoid myself headaches :p

so i copied the content in /var/mysql to /var/www/mysql set up permissions and indicate mysql where to start

# mkdir /var/www/mysql
# chown -R _mysql:_mysql /var/www/mysql
# cp -R /var/mysql/* /var/www/mysql (i forget to use -p :p )
# /usr/local/bin/mysqld_safe --datadir=/var/www/mysql --open-files-limit=8192&

and of course it complains and did not start why because i forget the -p parameter on the cp and the files belongs to root 
-rw-r-----  1 root  _mysql      19760 Jan 11 19:08 mysql-bin.000001
-rw-r-----  1 root  _mysql     765307 Jan 11 19:08 mysql-bin.000002

# chwon -R _mysql: /var/www/mysql
# /usr/local/bin/mysqld_safe --datadir=/var/www/mysql --open-files-limit=8192&

no more mysql complains and work ok ill do the resize latter sure ill :0

No comments:

Post a Comment