One of our MySQL db servers was filling up the disk space pretty quickly due to normal reasons. Since we use 3Par for storage purposes, we created a larger partition and then linked the db directory to point to the new partition.
ln -s /path/to/new/mysql/data/partition/db_1 /path/to/mysql/data/db_1
The sequence of steps needed were:
- create a new parition
- initialize and clear filesystem with newfs before using for the first time.
- Create appropriate entries in /etc/vfstab
- Create the directory
- mount (mount -a)
- Copy data [tar cf - db_1 | ( cd /path/to/new/mysql/data/guestbook; tar xvf - )]
- invoke "fuser -k /path/to/old/mysql/data" to view the processes using the filesystem you just unmounted
- unmount the old partition
- backup the data that was on old file system.
- create a soft link that points to the new partition.