How can I use as much disk space as possible in MySql automatically?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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?
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.