簡介
本文說明如何使用裝置的USB埠從外部獲取Prime基礎架構(PI)第1代裝置的備份,反之亦然。
問題
在許多客戶場景中,檔案傳輸協定/簡單檔案傳輸協定(FTP/TFTP)的使用在其資料中心受到限制,因此,客戶在任何FTP/TFTP伺服器的幫助下從PI將備份移動到外部點是一個巨大的挑戰。由於裝置是基於Linux的伺服器,因此很難將備份從任何其他方式移動到外部點,因為在傳輸不當時,它可能會損壞備份。
解決方案
為了克服這種情況,請使用裝置的USB埠找到備用解決方案,將備份從Prime Server移動到USB Stick。另一個優點是它速度快得多,有助於減少通過FTP/TFTP/SFTP進行複製所需的時間,而且複製大型資料也會非常有用。
從PI Gen1裝置備份到USB
步驟1.插入USB閃存檔。
步驟2.建立一個支援的新分區ext4檔案系統。
-bash-4.1# fdisk -l n e l t 8e w
-bash-4.1# partprobe
-bash-4.1# mkfs.ext4 /dev/sdb1
-bash-4.1# mkdir /media/usb-drive/
-bash-4.1# mount -t ext4 /dev/sdb1 /media/usb-drive/
-bash-4.1# umount /media/usb-drive
步驟3.將備份從defaultRepo複製到新裝載的檔案系統。
步驟4.在兩個位置驗證md5的檔案。
從USB備份到PI Gen1裝置
步驟1.登入PI。
pi/admin#
步驟2.導覽至shell。
pi/admin# shell
Enter shell access password :
Starting bash shell ...
ade #
ade #
ade # sudo su -
-bash-4.1#
步驟3.檢視PI中的所有磁碟分割槽。
-bash-4.1# fdisk -l
Disk /dev/sda: 897.0 GB, 896998047744 bytes
255 heads, 63 sectors/track, 109053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000591be
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 77 102400 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3 77 109054 875359232 8e Linux LVM
Disk /dev/mapper/smosvg-rootvol: 4194 MB, 4194304000 bytes
255 heads, 63 sectors/track, 509 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-swapvol: 16.8 GB, 16777216000 bytes
255 heads, 63 sectors/track, 2039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-tmpvol: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-usrvol: 7348 MB, 7348420608 bytes
255 heads, 63 sectors/track, 893 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-varvol: 4194 MB, 4194304000 bytes
255 heads, 63 sectors/track, 509 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-optvol: 716.3 GB, 716252905472 bytes
255 heads, 63 sectors/track, 87079 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-home: 134 MB, 134217728 bytes
255 heads, 63 sectors/track, 16 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-recvol: 134 MB, 134217728 bytes
255 heads, 63 sectors/track, 16 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-altrootvol: 134 MB, 134217728 bytes
255 heads, 63 sectors/track, 16 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-localdiskvol: 134.6 GB, 134553272320 bytes
255 heads, 63 sectors/track, 16358 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/smosvg-storeddatavol: 10.5 GB, 10502537216 bytes
255 heads, 63 sectors/track, 1276 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdb: 62.1 GB, 62075699200 bytes
255 heads, 63 sectors/track, 7546 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa5fe72c5
Device Boot Start End Blocks Id System
/dev/sdb1 1 7546 60613213+ 8e Linux LVM
步驟4.建立新目錄並裝載它。
-bash-4.1# mkdir /media/usb-drive/
-bash-4.1# mount -t ext4 /dev/sdb1 /media/usb-drive/
-bash-4.1# ls -lv
total 60
-rw-------. 1 root root 8494 Aug 24 2018 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Aug 24 2018 bin
-rw-r--r--. 1 root root 18977 Aug 24 2018 install.log
-rw-r--r--. 1 root root 5646 Aug 24 2018 install.log.syslog
-rw-r--r--. 1 root root 5 Aug 24 2018 iso.ks.cfg
-rw-------. 1 root root 164 Aug 24 2018 ks-post.log
-rw-------. 1 root root 381 Aug 24 2018 ks-post-toinstall.log
-rw-rw-r--. 1 root root 120 Aug 23 17:47 test.log
-bash-4.1# cd /media/usb-drive/
-bash-4.1# pwd
/media/usb-drive
步驟5.復製備份之前,請檢查USB備份的md5。
-bash-4.1# ls -lv
total 21197320
-rw-r--r--. 1 root root 21706033973 Jun 28 14:57 pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg
drwx------. 2 root root 16384 Jun 28 14:29 lost+found
-bash-4.1#
-bash-4.1#
-bash-4.1# md5sum pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg
44daa932e7ca10fafe480302f7a17b6a pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg
-bash-4.1#
-bash-4.1#
步驟6.將備份複製到/localdisk/defaultRepo檔案夾中。
-bash-4.1# cp pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg /localdisk/defaultRepo/
-bash-4.1#
-bash-4.1#
-bash-4.1# cd /localdisk/defaultRepo/
-bash-4.1# ls -lv
total 21218032
-rw-r--r--. 1 root root 21706033973 Aug 23 18:56 pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg
-bash-4.1#
-bash-4.1#
步驟7.驗證使用先前md5的已復製備份的md5。
-bash-4.1# md5sum pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg
44daa932e7ca10fafe480302f7a17b6a pi-180419-1332__VER3.1.0.0.132_BKSZ204G_CPU16_MEM3G_RAM15G_SWAP15G_APP_CK1589549125.tar.gpg
-bash-4.1#
-bash-4.1#
步驟8.解除安裝目錄。
-bash-4.1# umount /media/usb-drive
-bash-4.1#
-bash-4.1#
-bash-4.1#