简介
本文档介绍如何使用设备的USB端口从外部从Prime基础设施(PI)第1代设备获取备份,反之亦然。
问题
在许多客户场景中,文件传输协议/简单文件传输协议(FTP/TFTP)的使用在其数据中心受到限制,因此,在任何FTP/TFTP服务器的帮助下,将备份从PI移到外部点是客户面临的一大挑战。由于设备是基于Linux的服务器,因此很难将备份从任何其他方式移动到外部点,因为在不正确传输时,可能会损坏备份。
解决方案
为了克服这种情况,请找到一种替代解决方案,使用设备的USB端口将备份从Prime Server移至USB Stick。另一个优势是,它速度快得多,有助于减少通过FTP/TFTP/SFTP进行复制所需的时间,而且复制大数据也非常有帮助。
从PI第1代设备备份到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第1代设备
步骤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#