本文適用於 Synology Active Backup for Business beta 版
與 CentOS 7
之間進行備份。
注意:CentOS 8
的備份操作需要額外安裝 bc
依賴包,另外需要將內核從``kerne-4.18.0-240.el8.x86_64升級至
kernel-4.18.0-240.1.1並安裝
kernel-devel-4.18.0-240.1.1.el8_3.x86_64` 內核開發包以支持備份還原。
一、環境介紹
Synology NAS
型號為:DS716+
Synology OS
版本為:6.2.3-25426 update2
二、環境部署
1. 虛擬機
對虛擬機的創建,此處略過具體步驟。
此處需要指出的是對 CentOS 7
鏡像的獲取:除官網外,推薦使用清華大學鏡像站提供的下載鏈接,有額外的加速效果(2-5MB/s
)
提示:該版本安裝完成后為 CentOS Linux release 7.9.2009 (Core)
,兼容 7.8
。
注意:如果不做磁盤調整默認安裝使用的 lvm
類型的磁盤,推薦使用 SinglePatition
手動分區。
詳細:該磁盤在還原過程會出現問題,具體來說是引導器 grub2
在 grub
界面可讀取到 lvm
分區的磁盤內容,但系統在啟動過程中識別不了 lvm
磁盤類型。而能讀取到 lvm
類型的磁盤類型是 grub2
獨有的,這在 grub1
中則沒有。具體錯誤會在文末給出,需要完美還原請使用 SinglePatition
手動分區。
2. 配置網絡
為方便后續相關操作,請提前配置好 NAS
端靜態 IP
地址。
3. 套件安裝
對測試版套件的安裝,具體位置如下。
套件中心 - Beta 套件 - 加入測試
提示:
1、測試版前讓您在 Synology 套件正式發布之前先體驗全新功能,但不建議將其用於商業用途。
2、如果您已安裝穩定的 Active Backup for Business版本,則會更新至測試版。
4. 套件配置
在加入測試后需要下載 CentOS
相關服務端配置軟件包,具體操作如下。
Active Backup for Business - 物理服務器 - Linux - 添加設備
注意:上述截圖中已經寫明具體操作步驟,教程后續也會參照該步驟。除此之外,額外需要注意到安裝包下載位置也在此處。為方便大家的使用,筆者將下載位置置於下方。
CentOS: 6.10, 7.8, 8.1
RHEL: 6.10, 7.8, 8.1
Fedora: 30, 31, 32
Ubuntu: 16.04, 18.04, 20.04
Debian: 8.0 to 10
三、備份之 CentOS
端設置
1. 創建 repo
yum-config-manager --add-repo="https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/"
rpm --import https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
rpm --import https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-Testing-7
yum clean all
yum makecache
2. 文件上傳(代理程序和驅動程序)
yum -y install lrzsz unzip
rz -E
# 其他的方法接可。比如 sftp scp FileZilla
unzip Synology_Active_Backup_for_Business_Agent-2.2.0-1761-x64-rpm.zip
3. 安裝依賴包
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install make libaio dkms gcc
4. 文件運行(代理程序和驅動程序)
sudo ./install.run
abb-cli -c
四、備份之 ABB
端設置
1. 查看設備加入
2. 添加任務
3. 效果驗證
4. 效果文件(備份文件)
提示:這是通過 LVM
類型的磁盤進行備份的,從這些文件中就可以看到備份文件為 img
后綴名,但奇怪的地方在於已經有 sda.img
,但依然有 centos=home.img
等三個文件。
五、還原之 ABB
端設置
物理服務器 - Linux - 還原
注:
-
對於文件級還原,請進入 Active Backup for Business Portal。
-
對於整台設備或基於存儲空間的還原,請下載 Linux 恢復媒體並參閱本文。
為方便大家的使用,筆者將下載位置置於下方。
Linux 恢復媒體:https://global.download.synology.com/download/Utility/ActiveBackupRecoveryMediaCreator/2.2.0-1211/Linux/Synology-Recovery-Media-1211(1761).iso
六、還原之 VM
設置
1、鏡像介質啟動
提示:這個文件就是第五節中 ABB
套件內提供的鏡像下載,您也可以通過筆者提供的鏈接直接下載。另外,由於該文件在筆者做實驗之前就已經下載完成,故日期上顯示為昨天但文件內容一致。
2、完成 NAS
登錄
提示:這里輸入用戶名密碼。可能會出現信任問題,保持信任即可。
注意:如果不對 VM
做出自定義調整,默認創建的 VM
是沒有網卡的。
3、選擇驅動器和磁盤
提示:選擇需要還原的鏡像文件名稱。筆者上述截圖中顯示多個是因為兼顧到系統版本 CentOS7
和 CentOS8
以及系統安裝類型 mini
或 Server With GUI
做出的多次實驗備份,故讀者在實驗時僅有一個可選項。
4、選擇恢復模式
提示:建議選擇 Entire device restore
,筆者在使用 Manually restore specified volumes (Advanced)
會有磁盤空間不足的報錯(實際配置上是完全一直的)。
5、 選擇備份時間點
6、恢復預覽
7、預計恢復時間
8、效果圖展示
注意:由於備份與還原的機器共用同一個 IP
地址。如果立即啟動還原機,會出現還原機占用備份機 IP
地址的情況。
七、問題匯總
1. LVM
所出現的問題
正常啟動是這樣,但是如果將無法啟動的 swap 和 home 取消掛載。
因為根分區是可以正常掛載的,所以系統可以起得來。
附:第 2.2.0-1761 版新增功能
What's new
Supports backing up and restoring Linux physical servers of the following distributions:
CentOS: 6.10, 7.8, 8.1
RHEL: 6.10, 7.8, 8.1
Ubuntu: 16.04, 18.04, 20.04
Fedora: 30, 31, 32
Debian: 8.0 to 10
Added support for VMware vSphere 7.0.0
Added support for compression and encryption settings for personal computers, physical servers, and virtual machines at the backup destination.
Supports migrating instantly restored virtual machines on Virtual Machine Manager to VMware vSphere or Microsoft Hyper-V.
Users can now back up a maximum of 50 devices (personal computers, physical servers, and virtual machines) concurrently. The actual number varies by RAM capacity:
Less than 8 GB: 10
Between 8 GB and 32 GB: 30
More than 32 GB: 50
Supports customizing pre/post scripts for physical server backups.
Supports removing data when the storage is deleted.
Added support for backup reports in PDF format to be attached in emails.
Supports deleting reports.
Supports automatically checking if the required services on VMware vSphere/Microsoft Hyper-V are properly configured when adding a hypervisor or creating a backup task.
Supports skipping duplicated pagefile.sys, hiberfil.sys, and swapfiles.sys files when backing up personal computers and physical servers.
Scheduled backup tasks for physical servers/personal computers will be canceled when the devices are disconnected for over an hour after tasks start.
Displays tasks that have been restored within the last 48 hours in "Restore Status."
Added support for restoring a file's metadata along with the file restoration from Active Backup for Business Portal.
Fixed Issues (General Issue)
Fixed an issue where the schedule of reports might not be editable.
Fixed an issue where manually creating a folder in the "@ActiveBackup" folder might cause the backup data within the manually created folder inaccessible.
Fixed an issue where "Backup now" might fail when the backup task was created during the forbidden backup time of the backup window.
Fixed an issue where the system might not properly display the finish time of backup tasks on the Activities page and the Task List tab
Fixed Issues (Servers and Workstations)
Fixed an issue where the system might incorrectly identify multiple devices with the same UUID when performing entire device restoration.
Fixed Issues (Virtual Machines)
Fixed an issue where Microsoft Hyper-V virtual machine backup tasks might fail if the size of the virtual machine disk was not an integer multiple of 1 KB.
Fixed an issue where Microsoft Hyper-V virtual machine backup tasks might fail when it was connected to Synology NAS via its hostname.
Fixed an issue where Microsoft Hyper-V virtual machine restoration might fail if the virtual machine used Cluster Shared Volumes.
Fixed an issue where Microsoft Hyper-V virtual machine restoration might fail when its Windows guest OS time format was 24-hours.
Fix an issue where the restoration performance might be slow when there were too many files in the destination folder.
Fixed an issue where the restoration might fail if the virtual machine contained a physical disk or a Raw Device Mapping (RDM).
Fixed an issue where instantly restored virtual machines might not display in the Restore Status page if Active Backup for Business had been restarted.
Fixed an issue where the system might not able to perform a backup task and a retention policy at the same time.
Limitations
Backup tasks that have enabled compression or encryption at backup destinations can't apply the following settings:
Instant restore to Synology Virtual Machine Manager
Instant restore to VMware (for virtual machines on VMware vSphere 7.0.1)
Instant restore to Microsoft Hyper-V
Backup verification