PDA

View Full Version : Problem with mysqlhotcopy to NAS



yosmc
May 19th, 2008, 08:36 AM
I'm using ZRM to backup my mySQL databases directly to a NAS that I have mounted as a subdirectory on my Redhat Linux system. The logical backups via mysqldump work just fine, but the raw mode via mysqlhotcopy runs into trouble: the backup fails, and the logs fill up with error messages as the following:

cp: failed to preserve ownership for `/backup/dir/my/database.MYI': Permission denied

As it seems, this constellation doesn't like the fact that copy (cp) is called with the -p tag - since the desitination is factually on a different drive, it is simply not possible to preserve ownership (NAS drive has different users). Does anyone know how I can get rid of the "preserve" tag - is that something I need to configure mysqlhotcopy with, or is this a ZRM feature? Thanks!

zmanda_jacob
May 19th, 2008, 12:00 PM
Which copy plugin are you using? There is not currently a setting which will allow you to remove this flag, but the flag is contained in one of the copy plugin scripts and you could alter it to remove that tag. I don't really recommend this because choosing not to preserve the ownership will cause problems when you try to restore later on and will require you to manually change permissions later. Is there an option in your NAS to allow file ownership to be changed from this particular server? Or alternatively, can you add the "mysql" user to the NAS with the same UID and GID of the database server? This would allow you to keep the permissions and make your restores work properly later as well.

paddy
May 19th, 2008, 12:15 PM
I'm using ZRM to backup my mySQL databases directly to a NAS that I have mounted as a subdirectory on my Redhat Linux system. The logical backups via mysqldump work just fine, but the raw mode via mysqlhotcopy runs into trouble: the backup fails, and the logs fill up with error messages as the following:

cp: failed to preserve ownership for `/backup/dir/my/database.MYI': Permission denied

As it seems, this constellation doesn't like the fact that copy (cp) is called with the -p tag - since the desitination is factually on a different drive, it is simply not possible to preserve ownership (NAS drive has different users). Does anyone know how I can get rid of the "preserve" tag - is that something I need to configure mysqlhotcopy with, or is this a ZRM feature? Thanks!

Are you doing raw backups of the database(s) running on the local machine? If so, mysqlhotcopy is having this problem. There is no easy way to disable this "-p" option. You will have to comment out the line in copy_files function in mysqlhotcopy code.

Paddy

yosmc
May 19th, 2008, 12:25 PM
Are you doing raw backups of the database(s) running on the local machine? If so, mysqlhotcopy is having this problem. There is no easy way to disable this "-p" option. You will have to comment out the line in copy_files function in mysqlhotcopy code.

Paddy


# add option to preserve mod time etc of copied files
# not critical, but nice to have
# $cp.= " -p" if $^O =~ m/^(solaris|linux|freebsd|darwin)$/;
Easy enough. Thanks a ton! :)