Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to move ibdata & ib_logfile on ssd drive. I tried this way, but it don't work:

service mysql stop
cd /var/lib/
cp -ra mysql mysql_backup
cp -a mysql/ibdata1 mysql/ib_logfile* /ssd_drive/mysql

my.cnf looks like this (relevant parts):


After all changes I get following errors:

InnoDB: Unable to lock /ssd_drive/mysql/ibdata1, error: 13
InnoDB: Check that you do not already have another mysqld process

Do I need to remove some lock files, or there is something else that I forgot...

Also I setup mysql apparmor so it can rwk on this directory, and rebooted afterward:

/usr/sbin/mysqld {
 /ssd_drive/mysql/* rwk,

Update: I forgot putting k option, so it can lock files...

share|improve this question
up vote 3 down vote accepted

Few things to check:

  • make sure no mysql porcess is running ps faux|grep mysql
  • check if the /ssd_drive/mysql ownership is correct chown mysql:mysql -R /ssd_drive/mysql

Does everything work fine when you start mysql from the original location?

edit: some googling gave me this: did you adjust also the socket part for the apparmor?

share|improve this answer
Well no mysql process are running during that time, and I used cp -a, that use same privileges as origivan files. I checked, mysql have access to that directory. And all is fine when I start from original directory. – XoR Apr 5 '12 at 9:37
@XoR what file system do you use on ssd? – pQd Apr 5 '12 at 10:25
ext4fs, with 4K blocks – XoR Apr 5 '12 at 10:50
@XoR did you check link i added? – pQd Apr 5 '12 at 12:03
Yes, now I see, I forgot adding k option, for enabling of locks – XoR Apr 5 '12 at 12:53

Note that moving ibdata and ib_logfiles to SSD is the best thing you can do from a performance point of view since these are random I/O files which improve on SSD.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.