Manual Backup Linux Rescue System/en

Aus EUserv Wiki

Wechseln zu: Navigation, Suche

Creating a backup with the Linux rescue system

Inhaltsverzeichnis

Creating a backup with the Linux rescue system

General

If you have an EUserv server or virtual server plan, you have the opportunities to start this on the EUserv customer panel in the rescue mode.

With the function Rescue System you can connect to your server, for example if an operating system installation is not successful or if the server is not accessible from the usual way. After it is started in the rescue mode, you can perform a backup of your user and configuration settings. This is a great necessity if your hard drive is malfunction, the system and the software are no longer works and critical data must be protected.


Preparing and activating the rescue system

First, your server or virtual server must boot up in the rescue system. How to do this, you'll find here.


Connect with the rescue system

After your server or virtual server is booted in the rescue system, you can connect using SSH program (for example, Putty). Simply start Putty and enter the IP address of your server.

Datei:putty_1_neu.png



It is important that a Port is set at 22 and Connection type: SSH is selected.
Now click on the button Open and the SSH connection to your server is set up.

It appears in a console window in which you are asked to enter your user name and password. Here you enter your root and the default password of your server. To find this information, you'll see here.

Datei:putty_2.png



If you have successfully connected with your server in the rescue mode, the following window appears:

Datei:putty_3.png



Creating and storing a backup on a FTP server

Mounting the partition

First create a directory under /mnt in which you can mount the respective hdd partition:

 mkdir /mnt/backup

First you have to mount the hard disk drive partitions of your installed system in the directory tree, because you are in the rescue system. In the following you can find a overview of the partition schemes of our standard installations:


Partitioning scheme 1

Standard partitioning for GRUB Legacy systems (CentOS, Gentoo, OwnCloud):

/dev/sda1 --> /boot              (GRUB files, kernel und initrd)
/dev/sda2 --> swap
/dev/sda3 --> /                  (data partition, contains e.g. etc, var, home)

Mount the data partition according to the used scheme:

 mount /dev/sda3 /mnt/backup


Partitioning scheme 2

Standard partitioning for GRUB2 systems (Debian, Ubuntu, OpenSuse, Fedora, Proxmox):

/dev/sda1 --> BIOS-GRUB-Partition
/dev/sda2 --> /boot              (GRUB files, kernel und initrd)
/dev/sda3 --> swap 
/dev/sda4 --> /                  (data partition, contains e.g. etc, var, home)

Mount the data partition according to the used scheme:

 mount /dev/sda4 /mnt/backup

Partitioning scheme 3

Standard partitioning for GRUB2 systems (see above) with RAID1:

/dev/md0 --> BIOS-GRUB-Partition 
/dev/md1 --> /boot               (GRUB files, kernel and initrd)
/dev/md2 --> swap
/dev/md3 --> /                   (data partition, contains e.g. etc, var, home)

Mount the data partition according to the used scheme:

 mount /dev/md3 /mnt/backup 


Creating a backup of critical data

To perform a backup of your user and config data, please go as follows:

  • Create a backup under the previously created directory /mnt/backup of your user and config files. Enter the following command in the console window of Putty:
 cd /mnt/backup
 tar cvf backup.tar /mnt/backup/etc /mnt/backup/home /mnt/backup/var  


Creating a backup of physical hard disk drive (hard disk drive image)

You have to enter the following command in the console window of Putty to create a 1:1 backup of your physical hard disk drive (replace X with the corresponding partition you want to create a backup):

 dd if=/dev/sdX conv=noerror,sync | gzip > /path/to/backup.gz

You can restore the partition with the following command:

 gzip -dc /path/to/image.gz | dd of=/dev/sdX  


Storing and restoring a backup on a FTP server

Storing a backup to BackupHD

To transfer a backup to our BackupHD please proceed as follows:

Open the Midnight Commander (MC) with the following command:

mc

Now change to the directory where you saved the backup file (the default is the root directory), and select the backup file (backup.tar) by using the arrow keys:

Datei:mc-oeffnen_neu.png



In order now to connect with the FTP server, click on the upper right and select the arrow keys FTP link ... from:

Datei:mc-ftp_neu.png



Now you are asked to enter your FTP server name and the user data. Enter them as follows:

Datei:mc-ftp-machine_neu.png



The required data can be found in the customer panel: BackupHD Now you can copy the backup file from your server to the FTP server. Choose the above File --> Copy from:

Datei:mc-ftp-copy_neu.png



Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:

Datei:mc-ftp-copy-server_neu.png



The file has been copied:

Datei:mc-ftp-copy-server-finish_neu.png



Now you can log on to our Web client to connect with the BackupHD below http://web.storage.euserv.net. After you signed in with your FTP user data, you can now see your backup file.



You can download this by yourself. In case a re-installatiion of your server was necessary, you can transfer the data back to your server again and unzip it.


Restoring a backup to BackupHD

To transfer a backup to your server please proceed as follows:

Open the Midnight Commander (MC) with the following command:

mc

Now change to the directory where you saved the backup file (the default is the root directory), and select the backup file (backup.tar) by using the arrow keys:

Datei:mc-oeffnen_neu_1.png



In order now to connect with the FTP server, click on the upper right and select the arrow keys FTP link ... from:

Datei:mc-ftp_neu_2.png



Now you are asked to enter your FTP server name and the user data. Enter them as follows:

Datei:mc-ftp-machine_neu_3.png



The required data can be found in the customer panel: BackupHD Now you can copy the backup file from your BackupHD to the server. Choose the above File --> Copy from:

Datei:mc-ftp-copy_neu_4.png



Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:

Datei:mc-ftp-copy-server_neu_5.png



The file has been copied:

Datei:mc-ftp-copy-server-finish_neu_6.png




Storing a backup to FTP-Backup

To transfer a backup to our FTP-Backup please proceed as follows:

Open the Midnight Commander (MC) with the following command:

mc

Now change to the directory where you saved the backup file (the default is the root directory), and select the backup file (backup.tar) by using the arrow keys:

Datei:mc-oeffnen_neu.png



In order now to connect with the FTP server, click on the upper right and select the arrow keys FTP link ... from:

Datei:mc-ftp_neu.png



Now you are asked to enter your FTP server name and the user data. Enter them as follows:

Datei:mc-ftp-machine_neu.png



The required data can be found in the customer panel: FTP-Backup Now you can copy the backup file from your server to the FTP server. Choose the above File --> Copy from:

Datei:mc-ftp-copy_neu.png



Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:

Datei:mc-ftp-copy-server_neu.png



The file has been copied:

Datei:mc-ftp-copy-server-finish_neu.png



Restoring a backup to FTP-Backup

To transfer a backup to your server please proceed as follows:

Open the Midnight Commander (MC) with the following command:

mc

Now change to the directory where you saved the backup file (the default is the root directory), and select the backup file (backup.tar) by using the arrow keys:

Datei:mc-oeffnen_neu_1.png



In order now to connect with the FTP server, click on the upper right and select the arrow keys FTP link ... from:

Datei:mc-ftp_neu_2.png



Now you are asked to enter your FTP server name and the user data. Enter them as follows:

Datei:mc-ftp-machine_neu_3.png



The required data can be found in the customer panel: FTP-Backup Now you can copy the backup file from your FTP-Backup to your server. Choose the above File --> Copy from:

Datei:mc-ftp-copy_neu_4.png



Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:

Datei:mc-ftp-copy-server_neu_5.png



The file has been copied:

Datei:mc-ftp-copy-server-finish_neu_6.png



Backup via rsync

Another way to create a backup of your files is by using rsync. Here, the backup file is transferred directly to your BackupHD/online hard drive. To do this, you can refer to the following wiki article:
Sicherung_Dateien_auf_BackupHD_mit_Rsync