/dev/mapper/VolGroup-lv_root has no more space left?
Solution 1
The easiest and fastest option is to create a directory in /home and move all data of /var to that directory and create soft link of /var to /home/var. The steps will be as follows.
mkdir /home/var
stop all the services. For example
/etc/init.d/mysqld stop
cp -pr /var/* /home/var
rm -rf /var
ln -s /home/var /var
start the services again
.
Note: May you can only move mysql data which is on /var/lib/mysql and create softlink to that.
Solution 2
I would suggest, as the first first, to check the size of /var/log. Possibly archive older logs. They can clog up you root partition without you noticing, and most older logs might not be necessary.
Solution 3
You can :
Add hard disk
Move mysql DB files to other FS (in your case you have just /home FS left )
You can resize your LVM volume to make /home smaller and / bigger (be sure to have backup of course :) )
This option is most straight forward, but LVM strongly recommend to backup your data before resizing
http://www.ibm.com/developerworks/linux/library/l-resizing-partitions-2/index.html
UPDATE (based on comment)
if I add hard disk what must I adjust on my mysql setting to expand the data to the hard disk? If option to mean I have to move mysql over what steps need to be taken for that?
Quite easy:
- Stop mysql
- Open /etc/my.cnf and find datadir= - here are your mysql datafiles
- Copy/Move them over to your new desired location
- Update datadir= with your new path
- Start Mysql
- Take a beer or whatever you want, cause you are done
How tough to expand the /root?
Read the link above which I already posted.Step by step guide is included there with comprehensive explanation.
Normally what the home partition is to store? Any important files?
It contain user files and setting.Eg your desktop etc.
For system healt /home is not important and can be remounted anytime.
Related videos on Youtube
user132638
Updated on September 18, 2022Comments
-
user132638 over 1 year
We have a CentOS machine and the MySQL is not starting due to disk space being full.
Below is the
df -h
results.Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 47G 45G 0 100% / tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/xvda1 485M 33M 428M 7% /boot /dev/mapper/VolGroup-lv_home 44G 180M 42G 1% /home
What can be done in this situation? Add more hard disk?
-
Petter H almost 4 yearsu use lvm so check vgs if there is anyunalloated space. chance is that you dont have to migrate anything. u can attach a second disk, add that on eto the volume group and then grow the filesystem too, or resize the disk in the pool already.
-
-
user132638 over 11 yearsif I add hard disk what must I adjust on my mysql setting to expand the data to the hard disk? If option to mean I have to move mysql over what steps need to be taken for that? How tough to expand the /root? Normally what the home partition is to store? Any important files?
-
user132638 over 11 yearsis it fine to expand the root partition will it have impact on the /boot and /dev/shm partition?
-
user132638 over 11 yearsby adding a brand new hard disk what partition label it will show in the partition list and where to move then ? Thank you.
-
user132638 over 11 years@dear all so what is the right n best option is it best when we do a new installation to give var a separate partition?
-
Toqeer over 11 yearsIt is best practice to give /var and /home separate partition.
-
user132638 over 11 yearsHow big should var I guess should be much bigger then /home right?
-
Toqeer over 11 yearsyes it should be bigger then /home, a default installation of mysql and httpd store all data in /var, also the logs store on /var so its better to keep it big
-
user132638 over 11 yearsIn case we have a 200gb hd what do you recommend for var is 150gb ok ?
-
Toqeer over 11 yearsYes 150GB is fine, if you are not going have special data for /home then keep that also under the / partition