Manual Backup Linux Rescue System/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
 
(Der Versionsvergleich bezieht 10 dazwischenliegende Versionen mit ein.)
Zeile 2: Zeile 2:
[[Kategorie:Rescue system]]
[[Kategorie:Rescue system]]
[[Kategorie:vServers]]
[[Kategorie:vServers]]
-
 
+
[[Kategorie:Servers]]
 +
'''''Creating a backup with the Linux rescue system'''''
'''''Creating a backup with the Linux rescue system'''''
__TOC__
__TOC__
Zeile 10: Zeile 11:
== General==
== General==
-
If you have an EUserv server or virtual server plan, you have the opportunities to start this on the EUserv customer service center in the rescue mode.
+
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.
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.
Zeile 54: Zeile 55:
=== Mounting the partition ===
=== Mounting the partition ===
-
First create a directory under /media in which you can mount the respective hdd partition:
+
First create a directory under /mnt in which you can mount the respective hdd partition:
-
   mkdir /media/backup
+
   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:
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:
Zeile 73: Zeile 74:
Mount the data partition according to the used scheme:
Mount the data partition according to the used scheme:
-
   mount /dev/sda3 /media/backup
+
   mount /dev/sda3 /mnt/backup
Zeile 89: Zeile 90:
Mount the data partition according to the used scheme:
Mount the data partition according to the used scheme:
-
   mount /dev/sda4 /media/backup
+
   mount /dev/sda4 /mnt/backup
==== Partitioning scheme 3 ====
==== Partitioning scheme 3 ====
Zeile 104: Zeile 105:
Mount the data partition according to the used scheme:
Mount the data partition according to the used scheme:
-
   mount /dev/md3 /media/backup  
+
   mount /dev/md3 /mnt/backup  
Zeile 111: Zeile 112:
To perform a backup of your user and config data, please go as follows:
To perform a backup of your user and config data, please go as follows:
-
* Create a backup under the previously created directory /media/backup of your user and config files. Enter the following command in the console window of Putty:
+
* 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 /media/backup
+
   cd /mnt/backup
-
   tar cvf backup.tar /media/backup/etc /media/backup/home /media/backup/var   
+
   tar cvf backup.tar /mnt/backup/etc /mnt/backup/home /mnt/backup/var   
Zeile 129: Zeile 130:
   
   
-
=== Storing a backup on a FTP server ===  
+
=== Storing and restoring a backup on a FTP server ===  
-
Now you can transfer this backup e.g., on a FTP server (we recommend our BackupHD/online hard drive [[BackupHD/Onlinefestplatte]]). To do this, by using the MidnightCommander (MC) with the following command:
+
==== Storing a backup to BackupHD ====
 +
 
 +
To transfer a backup to our [[BackupHD/Onlinefestplatte/en | BackupHD]] please proceed as follows:
 +
 
 +
Open the Midnight Commander (MC) with the following command:
  mc
  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) from using the arrow keys:
+
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:
<br>
<br>
<br>
<br>
Zeile 151: Zeile 156:
<br>
<br>
<br>
<br>
-
Now you are asked to enter your FTP server name and the user data. Give this as follows:
+
Now you are asked to enter your FTP server name and the user data. Enter them as follows:
<br>
<br>
<br>
<br>
Zeile 159: Zeile 164:
<br>
<br>
<br>
<br>
-
The required data can be found in the customer service center: [[BackupHD/Onlinefestplatte]]
+
The required data can be found in the customer panel: [[BackupHD/Onlinefestplatte/en | BackupHD]]
Now you can copy the backup file from your server to the FTP server. Choose the above '''File''' --> '''Copy''' from:
Now you can copy the backup file from your server to the FTP server. Choose the above '''File''' --> '''Copy''' from:
<br>
<br>
Zeile 168: Zeile 173:
<br>
<br>
<br>
<br>
-
Now the directory structure of the FTP spaces is appeared on which the backup file should be copied. Confirm this with OK:  
+
Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:  
<br>
<br>
<br>
<br>
Zeile 176: Zeile 181:
<br>
<br>
<br>
<br>
-
To ensure that your backup file is transferred to the FTP server.
+
The file has been copied:
<br>
<br>
<br>
<br>
Zeile 192: Zeile 197:
<br>
<br>
<br>
<br>
-
You can download this by yourself. After a re-install in your server was necessary, you can transfer the data again to your server and unzip. You have made ​​your user and configuration files again.
+
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:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-oeffnen_neu_1.png]]
 +
</center>
 +
<br>
 +
<br>
 +
In order now to connect with the FTP server, click on the upper '''right''' and select the arrow keys '''FTP link ...''' from:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp_neu_2.png]]
 +
</center>
 +
<br>
 +
<br>
 +
Now you are asked to enter your FTP server name and the user data. Enter them as follows:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-machine_neu_3.png]]
 +
</center>
 +
<br>
 +
<br>
 +
The required data can be found in the customer panel: [[BackupHD/Onlinefestplatte/en | BackupHD]]
 +
Now you can copy the backup file from your BackupHD to the server. Choose the above '''File''' --> '''Copy''' from:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy_neu_4.png]]
 +
</center>
 +
<br>
 +
<br>
 +
Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy-server_neu_5.png]]
 +
</center>
 +
<br>
 +
<br>
 +
The file has been copied:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy-server-finish_neu_6.png]]
 +
</center>
 +
<br>
 +
<br>
 +
 
 +
 
 +
==== Storing a backup to FTP-Backup ====
 +
 
 +
To transfer a backup to our [[Kundencenter_Server_FTP_Backup/en | 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:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-oeffnen_neu.png]]
 +
</center>
 +
<br>
 +
<br>
 +
In order now to connect with the FTP server, click on the upper '''right''' and select the arrow keys '''FTP link ...''' from:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp_neu.png]]
 +
</center>
 +
<br>
 +
<br>
 +
Now you are asked to enter your FTP server name and the user data. Enter them as follows:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-machine_neu.png]]
 +
</center>
 +
<br>
 +
<br>
 +
The required data can be found in the customer panel: [[Kundencenter_Server_FTP_Backup/en | FTP-Backup]]
 +
Now you can copy the backup file from your server to the FTP server. Choose the above '''File''' --> '''Copy''' from:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy_neu.png]]
 +
</center>
 +
<br>
 +
<br>
 +
Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy-server_neu.png]]
 +
</center>
 +
<br>
 +
<br>
 +
The file has been copied:<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy-server-finish_neu.png]]
 +
</center>
 +
<br>
 +
<br>
 +
 
 +
==== 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:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-oeffnen_neu_1.png]]
 +
</center>
 +
<br>
 +
<br>
 +
In order now to connect with the FTP server, click on the upper '''right''' and select the arrow keys '''FTP link ...''' from:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp_neu_2.png]]
 +
</center>
 +
<br>
 +
<br>
 +
Now you are asked to enter your FTP server name and the user data. Enter them as follows:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-machine_neu_3.png]]
 +
</center>
 +
<br>
 +
<br>
 +
The required data can be found in the customer panel: [[Kundencenter_Server_FTP_Backup/en | FTP-Backup]]
 +
Now you can copy the backup file from your FTP-Backup to your server. Choose the above '''File''' --> '''Copy''' from:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy_neu_4.png]]
 +
</center>
 +
<br>
 +
<br>
 +
Now the directory structure of the FTP space is displayed where the backup file is supposed be copied. Confirm this with OK:
 +
<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy-server_neu_5.png]]
 +
</center>
 +
<br>
 +
<br>
 +
The file has been copied:<br>
 +
<br>
 +
<center>
 +
[[Datei:mc-ftp-copy-server-finish_neu_6.png]]
 +
</center>
 +
<br>
 +
<br>
== Backup via rsync ==
== Backup via rsync ==

Aktuelle Version vom 10:06, 26. Nov. 2015

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