问题描述
我有2台服务器,Ubuntu 18.04。首先是我要备份的主服务器。第二个是在Ubuntu 18.04-KS-4服务器-Atom N2800-4GB DDR3 1066 MHz-SoftRAID 2x 2To SATA-经过测试的服务器上进行测试的。
我通过“ dd”命令进行备份,然后我通过服务器2下载此备份(wget)(490GB,约24小时下载)。
现在我要测试我的备份,所以我尝试了:
dd if=sdadisk.img of=/dev/sdb
我得到:
193536+0 records in
193536+0 records out
99090432 bytes (99 MB,94 MiB) copied,5.06239 s,19.6 MB/s
但是什么都不会改变。
fdisk -l
disk /dev/sda: 1.8 TiB,2000398934016 bytes,3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
disklabel type: dos
disk identifier: 0x8efed6c9
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 4096 1050623 1046528 511M fd Linux raid autodetect
/dev/sda2 1050624 3905974271 3904923648 1.8T fd Linux raid autodetect
/dev/sda3 3905974272 3907020799 1046528 511M 82 Linux swap / Solaris
GPT PMBR size mismatch (879097967 != 3907029167) will be corrected by w(rite).
disk /dev/sdb: 1.8 TiB,3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
disklabel type: gpt
disk identifier: B3B13223-6382-4EB6-84C3-8E66C917D396
Device Start End Sectors Size Type
/dev/sdb1 2048 1048575 1046528 511M EFI System
/dev/sdb2 1048576 2095103 1046528 511M Linux RAID
/dev/sdb3 2095104 878039039 875943936 417.7G Linux RAID
/dev/sdb4 878039040 879085567 1046528 511M Linux swap
disk /dev/md1: 511 MiB,535756800 bytes,1046400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
disk /dev/md2: 1.8 TiB,1999320842240 bytes,3904923520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
lsblk -l
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
├─sda2 8:2 0 1.8T 0 part
│ └─md2 9:2 0 1.8T 0 raid1 /
└─sda3 8:3 0 511M 0 part [SWAP]
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 511M 0 part
├─sdb2 8:18 0 511M 0 part
├─sdb3 8:19 0 417.7G 0 part
└─sdb4 8:20 0 511M 0 part
我认为问题出在服务器2上的磁盘配置上,尤其是它们之间的“ Linux突袭”。我正在搜索其更改方式,我测试了诸如“ mdadm ...”之类的命令,但它没有按预期工作。所以我有问题:
- 当我可以正确地测试备份时,如何将“ Linux raid”从2个HDDS更改为当前系统和2个清晰的HDD?
- 通常可以在1.8TB上还原490GB备份吗?
- 我选择了完整Linux备份的最佳选择吗?
解决方法
要回答问题3:“我选择了完整Linux备份的最佳选择吗?”
您使用的工具正确,但使用的 dd 命令使用的工具不正确。
您似乎为sda驱动器创建了.img文件(通常仅用于创建可引导磁盘,而不是驱动器的完整备份。
如果要创建完整备份,例如/ dev / sda,则应运行以下命令:
dd if=/dev/sda of=/dev/sdb
但是,在您的情况下,/ dev / sda驱动器的大小是/ dev / sdb驱动器的两倍,因此您可能需要考虑使用 tar 备份重要文件以及压缩备份使用 gzip或bzip2 。