Working with the Linux Rescue System (Software RAID)
Please use the “Print” function at the bottom of the page to create a PDF.
For Dedicated Servers and Server Power Deals managed in the Cloud Panel
In this article, you will learn how to use your Dedicated Servers Linux rescue system to back up the data of your server.
Note
How to boot your server into the Linux rescue system is explained in the following article:
Checking the Status of the Software RAID
To check the status of the software RAID, enter the following command in the shell:
rescue:~# cat /proc/mdstat
After entering the command, the following information is displayed, for example:
rescue:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [faulty]
md126 : active (auto-read-only) raid1 sda2[0] sdb2[2]
29293440 blocks super 1.0 [2/2] [UU]
md127 : active (auto-read-only) raid1 sda4[0] sdb4[2]
937699136 blocks super 1.0 [2/2] [UU]
bitmap: 0/7 pages [0KB], 65536KB chunk
In the above example, md127 must be mounted.
Important Information About Partitioning Your Dedicated Server
On Dedicated Servers managed in the Cloud Panel, only one partition will be created during setup and when reinstalling the operating system as of 20/10/2021. On Dedicated Servers set up before this date and on Dedicated Servers purchased as part of a Server Power Deal, the operating system images include the Logical Volume Manager (LVM). The Logical Volume Manager places a logical layer between the file system and the partitions of the disks used. This makes it possible to create a file system that spans multiple partitions and/or disks. In this way, for example, the storage space of several partitions or disks can be combined.
Display Partitioning
To display a list of the file systems and identify the file system, enter the command df -h. The abbreviation df stands for disk free. The parameter -h allows you to display the number of occupied blocks in gigabytes, megabytes or kilobytes in a machine-readable form.
rescue:~# df -h
Example:
rescue:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 630M 560M 71M 89% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 14M 16G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
To list the existing disks, partitions, logical volumes, and multiple devices, enter the command fdisk -l. fdisk is a command line program for partitioning hard disks. This program lets you display, create or delete partitions.
rescue:~# fdisk -l
Note
Depending on the server type and server model, the displayed partitions, logical volumes, and multiple devices may differ.
The following example lists information about hard disks, partitions, logical volumes, and multiple devices of a server with software raid. In this example, the server's operating system uses the Logical Volume Manager:
rescue:~# fdisk -l
Disk /dev/ram0: 640 MiB, 671088640 bytes, 1310720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 857E5503-92EF-4576-B9E9-C1E9D6CB603F
Device Start End Sectors Size Type
/dev/sda1 2048 6143 4096 2M BIOS boot
/dev/sda2 6144 58593279 58587136 28G Linux RAID
/dev/sda3 58593280 78125055 19531776 9.3G Linux swap
/dev/sda4 78125056 937701375 859576320 409.9G Linux RAID
Disk /dev/sdb: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3CDA280F-70D3-4EBF-AC09-1C94C23A3BB3
Device Start End Sectors Size Type
/dev/sdb1 2048 6143 4096 2M BIOS boot
/dev/sdb2 6144 58593279 58587136 28G Linux RAID
/dev/sdb3 58593280 78125055 19531776 9.3G Linux swap
/dev/sdb4 78125056 937701375 859576320 409.9G Linux RAID
Disk /dev/md127: 28 GiB, 29996482560 bytes, 58586880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md126: 409.9 GiB, 440102879232 bytes, 859575936 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/vg00-usr: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/vg00-var: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/vg00-home: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 640 MiB, 671088640 bytes, 1310720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 640 MiB, 671088640 bytes, 1310720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 640 MiB, 671088640 bytes, 1310720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 640 MiB, 671088640 bytes, 1310720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 640 MiB, 671088640 bytes, 1310720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Make a note of the paths of the logical volumes or the multiple device. In this example it is /dev/md127.
Finding the Mount Points
To view the mount points of the devices and partitions you are using, enter the following command:
[root@localhost ~]# lsblk
Then, information similar to the following example will be displayed:
Dedicated Servers with HDD:[root@2A2E3A1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 511M 0 part
│ └─md1 9:1 0 511M 0 raid1 /boot/efi
├─sda2 8:2 0 1.4G 0 part
│ └─md2 9:2 0 1.4G 0 raid1 /boot
├─sda3 8:3 0 3.7G 0 part [SWAP]
└─sda4 8:4 0 1.8T 0 part
└─md4 9:4 0 1.8T 0 raid1 /
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 511M 0 part
│ └─md1 9:1 0 511M 0 raid1 /boot/efi
├─sdb2 8:18 0 1.4G 0 part
│ └─md2 9:2 0 1.4G 0 raid1 /boot
├─sdb3 8:19 0 3.7G 0 part [SWAP]
└─sdb4 8:20 0 1.8T 0 part
└─md4 9:4 0 1.8T 0 raid1 /Dedicated Servers with NVMe:
rescue:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
sdb 8:16 0 447.1G 0 disk
nvme1n1 259:0 0 894.3G 0 disk
├─nvme1n1p1 259:6 0 511M 0 part
│ └─md124 9:124 0 510.9M 0 raid1
├─nvme1n1p2 259:7 0 1.4G 0 part
│ └─md125 9:125 0 1.4G 0 raid1
├─nvme1n1p3 259:8 0 3.7G 0 part
│ └─md126 9:126 0 3.7G 0 raid1
└─nvme1n1p4 259:9 0 888.7G 0 part
└─md127 9:127 0 888.5G 0 raid1
nvme0n1 259:1 0 894.3G 0 disk
├─nvme0n1p1 259:2 0 511M 0 part
│ └─md124 9:124 0 510.9M 0 raid1
├─nvme0n1p2 259:3 0 1.4G 0 part
│ └─md125 9:125 0 1.4G 0 raid1
├─nvme0n1p3 259:4 0 3.7G 0 part
│ └─md126 9:126 0 3.7G 0 raid1
└─nvme0n1p4 259:5 0 888.7G 0 part
└─md127 9:127 0 888.5G 0 raid1Make a note of the devices and partitions and their mount points.
Starting the Logical Volume Management Manually
Usually all logical volumes are started when the rescue system is started. If these are not active, you can start the logical volumes manually. To do this, enter the following commands:
rescue:~# pvscan
rescue:~# vgscan
rescue:~# vgchange -a y
File System Check
Before you mount the logical volume or multiple device, you should check consistency of the file system using File System Check (FSCK).
Caution
A file system check must not be performed with mounted and/or encrypted partitions, as this can result in data loss. If you check the file system of a logical volume or multiple device, it may also not be mounted.
Therefore, make sure that the partition, logical volume, or multiple device is not mounted or encrypted before checking it with the File System Check.
To check a partition, logical volume, or multiple device using the File System Check, type the following command:
Partition
rescue:/# fsck -f /PATH/PARTITION
Logical Volume
rescue:/# fsck -f /PATH/LOGICAL_VOLUME
Multiple device
rescue:/# fsck -f /PATH/MULTIPLE_DEVICE
The following example checks the file system of md127:
rescue:/# fsck -f /dev/md127
fsck from util-linux 2.29.2
e2fsck 1.43.4 (31-Jan-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
root: 4026/1831424 files (1.7% non-contiguous), 190579/7323360 blocks
Mounting a Multiple Device or a Logical Volume
To create the directory in which to mount the logical volume or multiple device, type the following command:
rescue:/# mkdir /mnt/DIRECTORY_NAME
Example:
rescue:/# mkdir /mnt/md127
To mount the logical volume or multiple device, type the following command:
rescue:/# mount /PATH/PARTITION /mnt/DIRECTORY
Dedicated Servers with HDD:
rescue:/# mount /dev/md127 /mnt/md4
Dedicated Servers with NVMe:
rescue:/# mount /dev/md127 /mnt/md127
Backing up Files
You have the following options to back up the data of your server:
You save the data on your local computer using WinSCP.
You save the data on another server using Secure Copy.
After backing up your data, you can install a new image on the server or restore a backup of your system. Then you can copy the saved data to the server.
Backup Data to a Local Computer Using WinSCP
If you are using WinSCP to back up your data to a local computer, you can select the desired data and drag and drop it to a directory on your local computer.
Copy Data to Another Server Using Secure Copy
Secure Copy is an encrypted data transfer protocol based on Secure Shell. To transfer the data, enter the following command in the shell:
scp -r /PATH/LIST username@IP-ADRESS:/PATH/DESTINATION LIST
Example:
scp -r /mnt root@82.165.69.130:/home/backup
Unmounting the file systems
Before you boot the server into the normal mode, you need to unmount the mounted logical volumes or multiple devices. To do this, use the umount command.
Caution
If you restart the server with mounted file systems, data loss may occur!
To unmount the mounted logical volumes or partitions, enter the following command:
rescue:/# umount /PATH/MULTIPLE_DEVICE /mnt/DIRECTORY
or
rescue:/# umount /PATH/LOGICAL_VOLUME /mnt/DIRECTORY
In the following example a Multiple Device is unmounted:
rescue:/# mount /dev/md127 /mnt/md127
Content
- Checking the Status of the Software RAID
- Important Information About Partitioning Your Dedicated Server
- Display Partitioning
- Finding the Mount Points
- Starting the Logical Volume Management Manually
- File System Check
- Mounting a Multiple Device or a Logical Volume
- Backing up Files
- Unmounting the file systems
- To top