[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Adding a new HDD - how do I move /var/lib/mysql ?

-----Original Message-----
From: Justin Hartman [mailto:jjhartman@gmail.com]
Sent: 10 January 2007 19:32
To: debian-user@lists.debian.org
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.
Justin Hartman
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
Fdisk /dev/hdx
Add to fstab
As /dev/hdx /mnt/hdx Format it
Mkfs /dev/hdx
Mount /dev/hdx
Stop mysql
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:

   cd /var/lib
   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 LINK_NAME. In the 2nd form, create a link to TARGET in the current directory. In the 3rd and 4th forms, create links to each TARGET in DIRECTORY. Create hard links by default, symbolic links with --symbolic. When creating
      hard links, each TARGET must exist.

Marc Shapiro

Reply to: