Manual Backup Linux Rescue System/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Zeile 10: Zeile 10:
== General==
== General==
-
If you have an EUserv server or virtual server plan, you have the opportunity,  via the customer service center, to start the server 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 service center 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, even if a operating system installation was not successfull or the server is not accessible via the usual way. After the server has been started in the rescue mode, you can make a backup of your user- and configuration settings. This is a great necessity if your hard drive is defective or if the system and the software are no longer working and critical data needs to be protected.
 
== Preparing and activating the rescue system ==
== Preparing and activating the rescue system ==
-
First, you have to boot your server or virtual server in the rescue system. How to do this, you'll find [[Kundencenter_Server_Rescue_System/en|here]].
+
First, your server or virtual server must boot up in the rescue system. How to do this, you'll find [[Kundencenter_Server_Rescue_System|here]].
-
== Connecting with the rescue system ==
 
-
After your server or virtual server is booted in the rescue system, you can connect to your server using a SSH program (for example, '''Putty'''). Simply start '''Putty''' and enter the IP address of your server.
+
== 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.
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:putty_1_neu.png|framed]]
+
[[Datei:putty_1_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
It is important that '''Port''' is set at '''22''' and '''Connection type: SSH''' is selected.<br>
+
It is important that a '''Port''' is set at '''22''' and '''Connection type: SSH''' is selected.<br>
-
Now click on the button '''Open''' and the SSH connection to your server will be set up. <br>
+
Now click on the button '''Open''' and the SSH connection to your server is set up. <br>
-
It appears a console window in which you are asked to enter your username and password. Here you enter your '''root''' and the '''default password''' of your server. Where you can find this information, you'll see [[Kundencenter_Server_Serverdaten/en#Configuration the data from the server|here]].
+
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 [[Kundencenter_Server_Serverdaten#Konfigurations-Daten_des_Servers|here]].
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:putty_2.png|framed]]
+
[[Datei:putty_2.png]]
</center>
</center>
<br>
<br>
Zeile 43: Zeile 45:
<br>
<br>
<center>
<center>
-
[[Datei:putty_3.png|framed]]
+
[[Datei:putty_3.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
== Create backup and backup the FTP server ==
+
== Creating and storing a backup on a FTP server ==
 +
 
 +
=== Mounting the partition ===
 +
 
 +
First create a directory under /media in which you can mount the respective hdd partition:
 +
 
 +
  mkdir /media/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):
 +
 
 +
<pre>
 +
/dev/sda1 --> /boot              (GRUB files, kernel und initrd)
 +
/dev/sda2 --> swap
 +
/dev/sda3 --> /                  (data partition, contains e.g. etc, var, home)
 +
</pre>
 +
 
 +
Mount the data partition according to the used scheme:
 +
 
 +
  mount /dev/sda3 /media/backup
 +
 
 +
 
 +
==== Partitioning scheme 2 ====
 +
 
 +
Standard partitioning for GRUB2 systems (Debian, Ubuntu, OpenSuse, Fedora, Proxmox):
 +
 
 +
<pre>
 +
/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)
 +
</pre>
 +
 
 +
Mount the data partition according to the used scheme:
 +
 
 +
  mount /dev/sda4 /media/backup
 +
 
 +
==== Partitioning scheme 3 ====
 +
 
 +
Standard partitioning for GRUB2 systems (see above) with RAID1:
 +
 
 +
<pre>
 +
/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)
 +
</pre>
 +
 
 +
Mount the data partition according to the used scheme:
 +
 
 +
  mount /dev/md3 /media/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 /media/backup of your user and config files. Enter the following command in the console window of Putty:
 +
 
 +
  cd /media/backup
 +
  tar cvf backup.tar /media/backup/etc /media/backup/home /media/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:
-
In order to perform a backup of your user data and configuration data, you must create a zip file of your user and configuration files. These are located in the directories: '''/home,/etc and/var/www.''' This requires the following command to be entered in the console window of Putty:
+
  gzip -dc /path/to/image.gz | dd of=/dev/sdX 
-
  tar cvf backup.tar /etc /home /var/www
+
   
 +
=== Storing 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/en|Cloud]]). To do this, use the MidnightCommander (MC) with the following command:
+
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:
  mc
  mc
-
Now change to the directory where you saved the backup file (Default is the root directory), and select the backup file (backup.tar) by 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) from using the arrow keys:
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:mc-oeffnen_neu.png|framed]]
+
[[Datei:mc-oeffnen_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
In order now to connect with the FTP server, click on '''right''' and select '''FTP link ...''' with the arrow keys:
+
In order now to connect with the FTP server, click on the upper '''right''' and select the arrow keys '''FTP link ...''' from:
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:mc-ftp_neu.png|framed]]
+
[[Datei:mc-ftp_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
Now you are asked to enter your FTP server name and the user data. Fill in as follows:
+
Now you are asked to enter your FTP server name and the user data. Give this as follows:
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:mc-ftp-machine_neu.png|framed]]
+
[[Datei:mc-ftp-machine_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
The required data can be found in the customer service center: [[BackupHD/Onlinefestplatte/en|Cloud]]
+
The required data can be found in the customer service center: [[BackupHD/Onlinefestplatte]]
-
Now you can copy the backup file from your server to the FTP server. Choose '''File''' --> '''Copy''':
+
Now you can copy the backup file from your server to the FTP server. Choose the above '''File''' --> '''Copy''' from:
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:mc-ftp-copy_neu.png|framed]]
+
[[Datei:mc-ftp-copy_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
Now the directory structure of the FTP spaces appeares on which the backup file should be copied. Confirm this with '''OK''':  
+
Now the directory structure of the FTP spaces is appeared on which the backup file should be copied. Confirm this with OK:  
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:mc-ftp-copy-server_neu.png|framed]]
+
[[Datei:mc-ftp-copy-server_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
The backup file is now transferred to the FTP server.
+
To ensure that your backup file is transferred to the FTP server.
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:mc-ftp-copy-server-finish_neu.png|framed]]
+
[[Datei:mc-ftp-copy-server-finish_neu.png]]
</center>
</center>
<br>
<br>
<br>
<br>
-
Now you can connect with the BackupHD via the EUserv Web client: http://web.storage.euserv.net. After you signed in with your FTP user data, you will see your backup file.
+
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.
<br>
<br>
<br>
<br>
<center>
<center>
-
[[Datei:backuphd.png|572px|thumb|enlarge]]
+
[[Datei:backuphd.png|572px]]
</center>
</center>
<br>
<br>
<br>
<br>
-
You can download this by yourself. If a re-install of your server was necessary, later on you can transfer the data again to your server and unzip. You have restored ​​your user and configuration files.
+
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.
== Backup via rsync ==
== Backup via rsync ==
-
Another way to create a backup of your files is using '''rsync.''' Here, the backup file will be transferred directly to your BackupHD/online hard drive. To do this, you can refer to the following wiki article:
+
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:
-
<br>[[Sicherung_Dateien_auf_BackupHD_mit_Rsync/en#Examples:|Backup files on BackupHD with Rsync]]
+
<br>[[Sicherung_Dateien_auf_BackupHD_mit_Rsync#Beispiele:|Sicherung_Dateien_auf_BackupHD_mit_Rsync]]

Version vom 16:43, 3. Nov. 2014

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 service center 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 /media in which you can mount the respective hdd partition:

 mkdir /media/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 /media/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 /media/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 /media/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 /media/backup of your user and config files. Enter the following command in the console window of Putty:
 cd /media/backup
 tar cvf backup.tar /media/backup/etc /media/backup/home /media/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 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:

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:

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. Give this as follows:

Datei:mc-ftp-machine_neu.png



The required data can be found in the customer service center: BackupHD/Onlinefestplatte 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 spaces is appeared on which the backup file should be copied. Confirm this with OK:

Datei:mc-ftp-copy-server_neu.png



To ensure that your backup file is transferred to the FTP server.

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. 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.

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