# Backup a cluster - beginner questions

**URL:** <https://forums.percona.com/t/backup-a-cluster-beginner-questions/37380>\
**Category:** Percona XtraDB Cluster 8.x\
**Tags:** mysql, percona\
**Created:** [March 27, 2025, 8:36am UTC](https://forums.percona.com/t/backup-a-cluster-beginner-questions/37380 "2025-03-27T08:36:36Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Zody](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Zody](https://forums.percona.com/u/Zody)\
**Post date:** [April 1, 2025, 10:08am UTC](https://forums.percona.com/t/backup-a-cluster-beginner-questions/37380/3 "2025-04-01T10:08:00Z")

</div>

Absolutely - got my script working to create the backup - it uses a SAMBA/CIFS Share as target-dir. It’s mounted this way in the fstab:

```auto
//idonttellyou.your-storagebox.de/idonttellyou /mnt/backup cifs iocharset=utf8,rw,credentials=/etc/backup-credentials.txt,uid=backupuser,gid=backupuser,file_mode=0660,dir_mode=0770,vers=3.1.1 0 0

```

But when trying to prepare the backup the following error occurs:

```auto
2025-04-01T09:57:04.089902-00:00 0 [ERROR] [MY-012574] [InnoDB] Unable to lock ./#innodb_redo/#ib_redo0 error: 13
2025-04-01T09:57:04.089977-00:00 0 [Note] [MY-012575] [InnoDB] Check that you do not already have another mysqld process using the same InnoDB data or log files.
2025-04-01T09:57:04.090020-00:00 0 [Note] [MY-012894] [InnoDB] Unable to open './#innodb_redo/#ib_redo0' (error: 11).
2025-04-01T09:57:04.090066-00:00 0 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Cannot open a file.
2025-04-01T09:57:04.168315-00:00 0 [ERROR] [MY-011825] [Xtrabackup] innodb_init(): Error occured

```

which leads me to this article:

> [@XtraBackup prepare fails on NFS](https://forums.percona.com/t/xtrabackup-prepare-fails-on-nfs/21646/2):
>
> PXB is unable to acquire filelock. This is an NFS problem. You need to read some docs on NFS mount options to fix the locking method. It is recommended to do the prepare locally before copying to your NFS. Same DB (XtraBackup 8.0.32-26 - MySQL 8.0.30 Also, it is recommended that you use the same PXB version which matches your MySQL version.

Which leads to:

> We will have to investigate if there is anything we can do here, for now, please prepare the backup on your local filesystem

Am I just missing a mount option or is the aforementioned case with the double renaming still the case?

Would love to do the prepare within the SAMBA/CIFS Share, cause otherwise we would need to mount another SSD Volume with a large amount of Space just to have a temp dir to create and prepare the backup, cause the local filesystem is very tiny (for example /var/lib/mysql is also just another SSD volume mounted)

//Edit  
Versions are:

```auto
percona-release/unknown,now 1.0-29.generic all [installed,upgradable to: 1.0-30.generic]
percona-telemetry-agent/stable,now 1.0.2-2.bookworm amd64 [installed,upgradable to: 1.0.3-4.bookworm]
percona-xtrabackup-80/unknown,now 8.0.35-32-1.bookworm amd64 [installed]
percona-xtradb-cluster-client/now 1:8.0.37-29-1.bookworm amd64 [installed,local]
percona-xtradb-cluster-common/now 1:8.0.37-29-1.bookworm amd64 [installed,local]
percona-xtradb-cluster-server/now 1:8.0.37-29-1.bookworm amd64 [installed,local]
percona-xtradb-cluster/now 1:8.0.37-29-1.bookworm amd64 [installed,local]

```

To create and prepare the backup, i’m having a backup script running from a remote server which checks which node he will use (checking that it’s in Synced state). Actually we dont have a read only node, thats why the backup and prepare happens on a read/write node.

Here are the commands from my script which run:

backup:

```auto
ssh $SSH_OPTIONS "$SSH_USER@$backup_node" "
    mkdir -p $BACKUP_PATH &&
    xtrabackup --defaults-extra-file=$MYSQL_CREDENTIALS --backup --target-dir=$BACKUP_PATH
" > >(tee -a /tmp/backup_$backup_node.log) 2>&1

```

prepare:

```auto
ssh $SSH_OPTIONS "$SSH_USER@$backup_node" "
    mkdir -p $BACKUP_PATH &&
    xtrabackup --defaults-extra-file=$MYSQL_CREDENTIALS --prepare --target-dir=$BACKUP_PATH
" > >(tee -a /tmp/backup_$backup_node.log) 2>&1

```

the SSH\_USER we are using here is a simple user which we created as follows:

```auto
useradd -d "/home/backupuser" -m -s /bin/bash -p 'IDONTTELLYOU' backupuser
usermod -aG mysql backupuser

```

The mysql `backup_user` we use got created as follows:

```auto
CREATE USER 'backup_user'@'%' IDENTIFIED BY 'IDONTTELLYOU';

GRANT RELOAD, PROCESS, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'backup_user'@'%';

GRANT SELECT ON performance_schema.global_status TO 'backup_user'@'%';
GRANT SELECT ON performance_schema.replication_group_members TO 'backup_user'@'%';
GRANT SELECT ON performance_schema.keyring_component_status TO 'backup_user'@'%';
GRANT SELECT ON performance_schema.log_status TO 'backup_user'@'%';

GRANT BACKUP_ADMIN ON *.* TO 'backup_user'@'%';

FLUSH PRIVILEGES;

```

---

_[View the full topic](https://forums.percona.com/t/backup-a-cluster-beginner-questions/37380)._
