[kwlug-disc] Adding (setting up) 2nd disk.

Khalid Baheyeldin kb at 2bits.com
Tue Jan 26 17:49:56 EST 2010


What I do normally when a server would benefit from stuff residing on
different spindles (i.e. physical disks), is to point the application to the
location of the new data, if the app does support that, and copy everything
to the new location. If it does not, then symlinks are an option.

Assuming /dev/sda is the first disk, and /dev/sdb is the second:

# Partition the disk
fdisk /dev/sdb
# Create a file system
mkfs -text3 /dev/sdb1
# Mount as a new disk
mount /dev/sdb1 /disk2
# Shutdown MySQL
/etc/init.d/mysql stop
# Copy the data
cp -a /var/lib/mysql /disk2
# Edit my.cnf to point to the new location
vi /etc/mysql/conf.d/local.cnf

A similar procedure can be followed for /home, by editing the /etc/passwd
file and change /home to /home/disk2 or whatever.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20100126/8b728541/attachment.htm>


More information about the kwlug-disc mailing list