Re: Adding a new HDD - how do I move /var/lib/mysql ?
From: Justin Hartman [mailto:firstname.lastname@example.org]
Sent: 10 January 2007 19:32
Subject: Adding a new HDD - how do I move /var/lib/mysql ?
I currently have a server with an 80GB hdd which is running out of
space very quickly. I want to now add a 250GB hdd in addition to the
80GB one and move my mysql data to this new 250GB drive.
I am running mysql-5.0.30 on Etch which was installed via apt-get so
there has been no modifications made to mysql whatsoever. How do I now
move my mysql server to store files on the new hard drive instead of
the old one without having to mess around too much?
Any help appreciated.
PGP Key ID: 102CC123
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
James Stevenson wrote:
Install new hard driver.
Create a partition
Add to fstab
As /dev/hdx /mnt/hdx
Mv /var/lib/mysql /mnt/hdx
Link it over
Ln -s /var/lib/mysql /mnt/hdx/mysql
Shouldn't the last line be replaced with:
ln -s /mnt/hdx/mysql /var/lib/mysql
Although I would actually do:
ln -s /mnt/hdx/mysql
According to man ln the target is always first unless using the -t option.
ln - make links between files
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)
In the 1st form, create a link to TARGET with the name
the 2nd form, create a link to TARGET in the current directory.
3rd and 4th forms, create links to each TARGET in DIRECTORY.
hard links by default, symbolic links with --symbolic. When
hard links, each TARGET must exist.