LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2014, 04:14 AM   #1
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Rep: Reputation: Disabled
Unhappy Out of space? - My server is breaking


Ok. First of all I would like to mention that I have just registered on this site and I will like to apologize if I may have used the wrong section or so, but I feel like this is the place where I could get the most help as fast as possible.

Now I would like to give out some information about my server and what is going on with it.

- My dedicated server is hosted at OVH in Quebec if I'm correct
- On my server I run a minecraft server, Teamspeak3 server and a website running SMF (SimpleMachines Forum) + I got to setup a Mysql server which I use both for the website and for the Minecraft server
- Now this is my first time that I was setting up and working in the Linux enviroment, even though I don't have much knowledge in scripting and proggraming either way and I just did most of the work following tutorials so everything could work.

But looks like always something has to go wrong :/

Now this is my situation when I login with putty:
http://i.imgur.com/YYkxdSD.png

And here is my website which has been down for some time now, cause I really do not know how to fix it.
http://mc.brutalcraft.org

However the Minecraft server is still working.

I know I probably sound like a joke and your best advice for me from most of you would probably be to just give up cause I don't know what the f* I'm doing, but there's actually a great community I have created in this "more than a year" lasting Minecraft server and I would really like to keep it going and running.

Once again apologizes if I'm asking for too much help here, but I'm lost and stuck at the point where I really need somebody else more experienced with me to help me solve this issues. I do not know if this is the best website to post about this kind of issues, but I definetly feel like it's worth trying, cause hey, can't get much worse.

If you have any questions or if you would like me to execute some commands for you and tell you the results go ahead.

You can also add me on skype: gajsak636

Thanks for reading, in case you made it this far
 
Old 02-16-2014, 05:31 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
Quote:
Originally Posted by wumpyc View Post
Now this is my situation when I login with putty
What does
Code:
mount; df -mh; du -mhs /var/*
return? (The last one is just a hunch.) *See 'man mount'; 'man df' and 'man du' if you don't know these commands.
 
1 members found this post helpful.
Old 02-16-2014, 05:40 AM   #3
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
What does
Code:
mount; df -mh; du -mhs /var/*
return? (The last one is just a hunch.) *See 'man mount'; 'man df' and 'man du' if you don't know these commands.
Code:
root@ns4008415:~# mount; df -mh; du -mhs /var/*
/dev/root on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=16417528k,nr_inodes=4104382,mode=755)
none on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type tmpfs (rw,relatime,size=4k,mode=755)
none on /sys/fs/fuse/connections type fusectl (rw,relatime)
none on /sys/kernel/security type securityfs (rw,relatime)
none on /run type tmpfs (rw,nosuid,noexec,relatime,size=3283612k,mode=755)
none on /sys/fs/pstore type pstore (rw,relatime)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
none on /run/shm type tmpfs (rw,nosuid,nodev,relatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755)
/dev/md3 on /home type ext4 (rw,relatime,discard,data=ordered)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,name=systemd)
Filesystem      Size  Used Avail Use% Mounted on
rootfs           20G   19G     0 100% /
/dev/root        20G   19G     0 100% /
devtmpfs         16G  4.0K   16G   1% /dev
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            3.2G  468K  3.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             16G  4.0K   16G   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/md3         91G   21G   66G  24% /home
1.7M    /var/backups
181M    /var/cache
4.0K    /var/crash
17G     /var/lib
4.0K    /var/local
0       /var/lock
67M     /var/log
4.0K    /var/mail
4.0K    /var/metrics
4.0K    /var/opt
0       /var/run
32K     /var/spool
20K     /var/tmp
95M     /var/www
 
Old 02-16-2014, 06:46 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
At first glance I'd say you should either attach storage or re-distribute space as your /home partition apparently doesn't require that much free space:
Quote:
Originally Posted by wumpyc View Post
Code:
Filesystem      Size  Used Avail Use% Mounted on
/dev/md3         91G   21G   66G  24% /home

Quote:
Originally Posted by wumpyc View Post
Code:
17G     /var/lib
What does this return?:
Code:
du -mhs /var/lib/*
*Depending on what's in /var/lib we might be able to re-attach a subdirectory in /home to temporarily alleviate disk space problems but that won't address the problem in the structurally and long run.
 
Old 02-16-2014, 06:50 AM   #5
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
At first glance I'd say you should either attach storage or re-distribute space as your /home partition apparently doesn't require that much free space:




What does this return?:
Code:
du -mhs /var/lib/*
*Depending on what's in /var/lib we might be able to re-attach a subdirectory in /home to temporarily alleviate disk space problems but that won't address the problem in the structurally and long run.
Code:
root@ns4008415:~# du -mhs /var/lib/*
12K     /var/lib/AccountsService
28K     /var/lib/apache2
8.0K    /var/lib/apparmor
150M    /var/lib/apt
4.0K    /var/lib/aptitude
3.2M    /var/lib/apt-xapian-index
3.6M    /var/lib/aspell
56K     /var/lib/belocs
8.0K    /var/lib/bind
8.0K    /var/lib/colord
8.0K    /var/lib/dbus
4.0K    /var/lib/dhcp
12K     /var/lib/dictionaries-common
27M     /var/lib/dpkg
96K     /var/lib/gconf
4.0K    /var/lib/initramfs-tools
4.0K    /var/lib/initscripts
4.0K    /var/lib/insserv
4.0K    /var/lib/landscape
4.0K    /var/lib/libuuid
16K     /var/lib/locales
8.0K    /var/lib/logrotate
8.0K    /var/lib/mdadm
4.0K    /var/lib/misc
3.2M    /var/lib/mlocate
17G     /var/lib/mysql
4.0K    /var/lib/ntpdate
4.0K    /var/lib/os-prober
28K     /var/lib/pam
72K     /var/lib/php5
12K     /var/lib/phpmyadmin
8.0K    /var/lib/plymouth
28K     /var/lib/polkit-1
4.0K    /var/lib/python
12K     /var/lib/sgml-base
116K    /var/lib/smartmontools
4.0K    /var/lib/snmp
4.0K    /var/lib/sudo
16K     /var/lib/systemd
4.0K    /var/lib/ubuntu-release-upgrader
152K    /var/lib/ucf
16K     /var/lib/update-manager
16K     /var/lib/update-notifier
4.0K    /var/lib/update-rc.d
8.0K    /var/lib/urandom
8.0K    /var/lib/ureadahead
496K    /var/lib/usbutils
8.0K    /var/lib/vim
12K     /var/lib/xml-core
 
Old 02-16-2014, 07:15 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
*First ensure you have backups off site (like you should with valuable data).
0) Stop the web server and the MySQL service
1) Ensure nothing is accessing the source directory or stop those services first:
Code:
lsof -Pwln -a +D/var/lib/mysql
2) Copy the source database directory to the /home partition:
Code:
\cp --sparse=auto --no-clobber --preserve=all --recursive /var/lib/mysql /home
3) Move the original database directory out of the way:
Code:
mv /var/lib/mysql /var/lib/mysql_old
4) Create a mount point and mount the destination there:
Code:
mkdir /var/lib/mysql && mount --bind /home/mysql /var/lib/mysql
5) Start the web server and the MySQL service and check their log files for any errors
6) If no errors are logged and the web site is working then adjust /etc/fstab to reflect the changes:
Code:
echo '/home/mysql /var/lib/mysql none bind' >> /etc/fstab
7) Finally remove the old directory to regain 17 GB free disk space:
Code:
rm -rf /var/lib/mysql_old
 
Old 02-16-2014, 02:56 PM   #7
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
I ran all of the commands successfully, but when attempting to start mysql I got the following - http://imgur.com/iObY0Sk
 
Old 02-16-2014, 02:58 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
step #5: ...and check their log files for any errors.
 
Old 02-16-2014, 03:06 PM   #9
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
140216 15:39:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140216 15:39:38 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
140216 15:39:38 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140216 15:39:38 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
140216 15:39:38 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140216 15:39:38 InnoDB: The InnoDB memory heap is disabled
140216 15:39:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140216 15:39:38 InnoDB: Compressed tables use zlib 1.2.8
140216 15:39:38 InnoDB: Using Linux native AIO
140216 15:39:38 InnoDB: Initializing buffer pool, size = 128.0M
140216 15:39:38 InnoDB: Completed initialization of buffer pool
140216 15:39:38 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
140216 15:39:38 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140216 15:44:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140216 15:44:54 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
140216 15:44:54 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140216 15:44:54 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
140216 15:44:54 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140216 15:44:54 InnoDB: The InnoDB memory heap is disabled
140216 15:44:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140216 15:44:54 InnoDB: Compressed tables use zlib 1.2.8
140216 15:44:54 InnoDB: Using Linux native AIO
140216 15:44:54 InnoDB: Initializing buffer pool, size = 128.0M
140216 15:44:54 InnoDB: Completed initialization of buffer pool
140216 15:44:54 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
140216 15:44:54 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
 
Old 02-16-2014, 04:04 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
Quote:
Originally Posted by wumpyc View Post
[code]140216 15:39:38 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.[code]
Change access perms.
Code:
umount /var/lib/mysql
chown mysql.mysql /var/lib/mysql
chmod 0750 /var/lib/mysql
mount --bind /home/mysql /var/lib/mysql
Start service.
 
Old 02-16-2014, 05:54 PM   #11
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
This is the new error

Quote:
140216 17:20:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140216 17:20:45 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
140216 17:20:45 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140216 17:20:45 [Note] Plugin 'FEDERATED' is disabled.
140216 17:20:45 InnoDB: The InnoDB memory heap is disabled
140216 17:20:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140216 17:20:45 InnoDB: Compressed tables use zlib 1.2.8
140216 17:20:45 InnoDB: Using Linux native AIO
140216 17:20:45 InnoDB: Initializing buffer pool, size = 128.0M
140216 17:20:45 InnoDB: Completed initialization of buffer pool
140216 17:20:45 InnoDB: highest supported file format is Barracuda.
140216 17:20:45 InnoDB: Waiting for the background threads to start
140216 17:20:46 InnoDB: 5.5.34 started; log sequence number 24779282639
140216 17:20:46 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140216 17:20:46 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140216 17:20:46 [Note] Server socket created on IP: '0.0.0.0'.
140216 17:20:46 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
140216 17:20:46 [ERROR] Do you already have another mysqld server running on port: 3306 ?
140216 17:20:46 [ERROR] Aborting

140216 17:20:46 InnoDB: Starting shutdown...
140216 17:20:47 InnoDB: Shutdown completed; log sequence number 24779282639
140216 17:20:47 [Note] /usr/sbin/mysqld: Shutdown complete

140216 17:20:47 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
 
Old 02-16-2014, 06:08 PM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
Please don't use [QUOTE]text[/QUOTE] but [CODE]text[/CODE] tags for log lines.

Quote:
Originally Posted by wumpyc View Post
Code:
140216 17:20:46 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
 140216 17:20:46 [ERROR] Do you already have another mysqld server running on port: 3306 ?
It literally tells you what to check for. So stop the service then
Code:
pgrep mysqld && { pkill -15 -f mysqld; sleep 5s; pkill -9 -f mysqld; }
and start it again and check the logs.
 
Old 02-16-2014, 06:33 PM   #13
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Mysql is working fine now, thank you so much for that. My memory has gone to this - http://imgur.com/HRfOrTu
 
Old 02-17-2014, 12:09 AM   #14
wumpyc
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
7) Finally remove the old directory to regain 17 GB free disk space:
Code:
rm -rf /var/lib/mysql_old
I should execute
Code:
rm -rf /var/lib/mysql
not
Code:
rm -rf /var/lib/mysql_old
, right?
 
Old 02-17-2014, 01:13 AM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
Quote:
Originally Posted by wumpyc View Post
I should execute
Code:
rm -rf /var/lib/mysql
not
Code:
rm -rf /var/lib/mysql_old
, right?
No, execute
Code:
rm -rf /var/lib/mysql_old
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Non-breaking space Steve W Linux - Newbie 3 05-07-2013 09:18 PM
Traffic through server is breaking up gubakdora Red Hat 1 11-28-2011 07:22 PM
Traffic through server is breaking up gubakdora Linux - Networking 0 11-23-2011 07:02 AM
Can linux be set to show the non-breaking space as a blank instead of as a ? porphyry5 General 9 07-12-2011 01:12 PM
breaking the hardware mirrored disk space pudhiyavan Linux - Hardware 2 08-24-2005 08:39 PM


All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration