Navigation path:Bare Metal Cloud > Dedicated servers > Select your server
Warning
OVHcloud is providing you with services for which you are responsible, with regard to their configuration and management. It is therefore your responsibility to ensure that they function correctly.
This tutorial is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider or reach out to our community if you face difficulties or doubts concerning the administration, usage or implementation of services on a server.
Instructions
Rebooting your server into rescue mode
Follow the respective guide to put your OVHcloud service into rescue mode:
The following code sections are for the purpose of illustration only, based on the example output above. You will need to adjust the instructions according to your actual configuration by replacing the values in the commands with your disk and volume identifiers.
In this example the primary disk (10 GB) is named "sdb". Our data in / is therefore located on the partition /dev/sdb1. (Whereas "sda" is the rescue mode disk and "sda1" is the primary rescue partition mounted on /.)
We mount the system partition in the folder /mnt and then verify its content:
root@rescue:~# mount /dev/sdb1 /mntroot@rescue:~# ls /mntbin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr varroot@rescue:~#
In order to launch services on the system from rescue mode, you will need to mount these partitions as well:
root@rescue:~# mount -o rbind /dev /mnt/devroot@rescue:~# mount -t proc proc /mnt/procroot@rescue:~# mount -t sysfs sys /mnt/sysroot@rescue:~# mount | grep /mnt/dev/sdb1 on /mnt type ext4 (rw,relatime,data=ordered)udev on /mnt/dev type devtmpfs (rw,nosuid,relatime,size=990236k,nr_inodes=247559,mode=755)devpts on /mnt/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)tmpfs on /mnt/dev/shm type tmpfs (rw,nosuid,nodev)hugetlbfs on /mnt/dev/hugepages type hugetlbfs (rw,relatime)mqueue on /mnt/dev/mqueue type mqueue (rw,relatime)proc on /mnt/proc type proc (rw,relatime)sys on /mnt/sys type sysfs (rw,relatime)
The following code sections are for the purpose of illustration only, based on the example output above. You will need to adjust the instructions according to your actual configuration by replacing the values in the commands with your disk and volume identifiers.
In this example, our data in / is located on the volume /dev/md3.
We mount the system partition in the folder /mnt and then verify its content:
root@rescue:~# mount /dev/md3 /mntroot@rescue:~# ls /mntbin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr varroot@rescue:~#
In order to launch services on the system from rescue mode, you will need to mount these partitions as well:
root@rescue:~# mount -o rbind /dev /mnt/devroot@rescue:~# mount -t proc proc /mnt/procroot@rescue:~# mount -t sysfs sys /mnt/sysroot@rescue:~# mount | grep /mnt/dev/md3 on /mnt type ext4 (rw,relatime,data=ordered)devtmpfs on /mnt/dev type devtmpfs (rw,relatime,size=16412720k,nr_inodes=4103180,mode=755)tmpfs on /mnt/dev/shm type tmpfs (rw,nosuid,nodev)devpts on /mnt/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)hugetlbfs on /mnt/dev/hugepages type hugetlbfs (rw,relatime)mqueue on /mnt/dev/mqueue type mqueue (rw,relatime)proc on /mnt/proc type proc (rw,relatime)sys on /mnt/sys type sysfs (rw,relatime)
Retrieving the databases
With all the necessary partitions mounted, we need to be able to execute commands on the actual system. You can do this by using the chroot command:
root@rescue:~# chroot /mnt/root@rescue:/#
From this point on, all commands that you enter will be applied to your system instead of the temporary rescue mode environment.
We can now start the mysql service:
root@rescue:/# service mysql start[ ok ] Starting MariaDB database server: mysqld ..root@rescue:/#
Use the command mysqldump to save the database as a file:
In this case, the mysql user logging in to the database is root. The option -p allows you to enter the password of root and the recovered database is named scarif.
The database file is then saved into the /home directory under the name dump.sql.