LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-11-2014, 05:59 AM   #1
unlike
LQ Newbie
 
Registered: Feb 2014
Posts: 4

Rep: Reputation: Disabled
How can I use as much disk space as possible in MySql automatically?


Hi.
I have a service that create a MySql database everyday. And the every database will be filled with about 40G data after created.
These databases are located in /data/mysql_data now. There is no doubt that /dev/sda4 will be full after decades of days. But as you can see below, I still has a lot spaces in /dev/sdb and /dev/sdc.
My question is: what's the best way to make MySql to use /dev/sdb (and then /dev/sdc) automatically after /dev/sda4 is full?

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 9.9G 4.9G 4.5G 53% /
/dev/sda3 20G 812M 18G 5% /usr/local
/dev/sda4 885G 220G 621G 27% /data
tmpfs 3.9G 68K 3.9G 1% /dev/shm
/dev/sdb 3.6T 783G 2.8T 22% /data1
/dev/sdc 3.6T 924G 2.7T 26% /data2

Thx a lot!

Last edited by unlike; 02-11-2014 at 06:02 AM.
 
Old 02-11-2014, 06:10 AM   #2
unlike
LQ Newbie
 
Registered: Feb 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
A solution might be: making some soft links in /data/mysql_data when realizing there is not enough spaces in /data/, and located data files in another disk. But I think this might be not the best way. And the disadvantages are:
1. I cann't drop databases as before.
2. such shell script is kind of complicated, and I am not sure it will work in every context.
 
Old 02-11-2014, 11:41 AM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Simplest way would be to use a volume group that combines all of the drives together.
 
1 members found this post helpful.
Old 02-11-2014, 07:44 PM   #4
unlike
LQ Newbie
 
Registered: Feb 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
Simplest way would be to use a volume group that combines all of the drives together.
Thanks, szboardstretcher!
I havn't used or even known "volume group" yet. And I have searched and learned some of it.
http://www.centos.org/docs/5/html/Cl...ger/index.html

I wonder whether the original data(or the other service that running on this machine but having no idea that a volumn group has been created) would be affected after I created a volume group?
 
Old 02-12-2014, 12:15 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You'd have to backup the DB and start over.
The LV/VG/PVs sit under the FS, so you also have mkfs.ext4 then put the DB etc back.

IOW: pv+pv+pv... = VG then carve into one (or more) LVs, then mkfs ontop of each LV, then install App SW.

HTH

PS I note that Section 5.1 of that link says '5.1. Creating an LVM Logical Volume on Three Disks', so follow that step by step AFTER taking 2(!) backups and checking them.
 
1 members found this post helpful.
Old 02-12-2014, 06:16 AM   #6
unlike
LQ Newbie
 
Registered: Feb 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
You'd have to backup the DB and start over.
The LV/VG/PVs sit under the FS, so you also have mkfs.ext4 then put the DB etc back.

IOW: pv+pv+pv... = VG then carve into one (or more) LVs, then mkfs ontop of each LV, then install App SW.

HTH

PS I note that Section 5.1 of that link says '5.1. Creating an LVM Logical Volume on Three Disks', so follow that step by step AFTER taking 2(!) backups and checking them.
I see. So the answer is that creating a volume group will destroy the data, which I don't want to. I cannot reformat the disk.
But thank you all the same!
 
  


Reply



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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 12:57 PM
hard disk partitioning/I am out of space /how to increase linux space? RMLinux Red Hat 8 09-05-2008 12:33 PM
Cedega "Disk space required for the installation exceeds available disk space" Solved Spewdemon LinuxQuestions.org Member Success Stories 1 10-18-2007 06:19 PM
<help> mysql deathloop || out of disk space jessebo Slackware 5 05-11-2006 02:38 PM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 03:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:06 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
Open Source Consulting | Domain Registration