2019년 8월 9일 금요일

REAR : Linux on POWER에서 사용가능한 OS backup 솔루션


Redhat이건 Ubuntu건 Linux on POWER의 OS backup/restore 솔루션으로 REAR(RElax-And-Recover)라는 open source tool을 이용할 수 있습니다.

REAR는 다음 URL에 사용법이나 source code 등이 자세히 나와 있습니다. 

http://relax-and-recover.org

Ubuntu 18.04 같은 경우에는 다음과 같이 정규 apt repository에 포함이 되어 있습니다.

u0017649@sys-99014:~/files$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:        18.10
Codename:       cosmic

u0017649@sys-99014:~$ apt-cache pkgnames | grep -i rear
rear
rear-doc

REAR와 함께 install 되어야 하는 pre-requisite OS package들은 대략 다음과 같습니다.

u0017649@sys-99014:~$ sudo apt-get install -y rear rear-doc
...
The following NEW packages will be installed:
  attr isolinux keyutils libisoburn1 libnfsidmap2 libtirpc1 nfs-common rear rear-doc rpcbind syslinux-common xorriso
...

그러나 Ubuntu 16.04 같은 경우에는 다음과 같이 REAR가 apt repository에 포함되어있지 않습니다.

u0017649@sys-99404:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

u0017649@sys-99404:~$ apt-cache pkgnames | grep rear

이 경우에도 당황하지 않으셔도 됩니다.  Ubuntu 18.04에 있는 최신 REAR를 download 받아서 사용할 수 있으니까요.  물론 여기서는 ppc64el용의 것을 download 받으셔야 합니다.

u0017649@sys-99014:~/REAR$ wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/r/rear/rear_2.3+dfsg-1_ppc64el.deb

그리고 다음과 같이 REAR 설치에 필요한 prerequisite OS package들을 download 받습니다.

u0017649@sys-99404:~/REAR$ apt-get download attr isolinux keyutils libisoburn1 libnfsidmap2 libtirpc1 nfs-common rpcbind syslinux-common xorriso libburn4 libisoburn1 libisofs6 libevent-2.0-5
Get:1 http://ports.ubuntu.com/ubuntu-ports xenial/main ppc64el attr ppc64el 1:2.4.47-2 [24.6 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports xenial/main ppc64el isolinux all 3:6.03+dfsg-11ubuntu1 [44.6 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports xenial/main ppc64el keyutils ppc64el 1.5.9-8ubuntu1 [46.7 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports xenial/main ppc64el libnfsidmap2 ppc64el 0.25-5 [29.9 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports xenial/main ppc64el rpcbind ppc64el 0.2.3-0.2 [38.4 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports xenial/main ppc64el syslinux-common all 3:6.03+dfsg-11ubuntu1 [1,181 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports xenial/universe ppc64el libisoburn1 ppc64el 1.4.2-4ubuntu1 [335 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports xenial/universe ppc64el xorriso ppc64el 1.4.2-4ubuntu1 [263 kB]
...

Download가 다 끝난 뒤 보면 아래와 같은 file들이 보입니다.

u0017649@sys-99404:~/REAR$ ls -l
total 2948
-rw-r--r-- 1 u0017649 u0017649   24640 Sep  9  2014 attr_1%3a2.4.47-2_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649   44606 Feb 24  2016 isolinux_3%3a6.03+dfsg-11ubuntu1_all.deb
-rw-r--r-- 1 u0017649 u0017649   46694 Dec 10  2015 keyutils_1.5.9-8ubuntu1_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649  139746 Feb 17  2016 libburn4_1.4.2.pl01-1_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649  108980 Mar 13  2017 libevent-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649  334928 Apr 18  2016 libisoburn1_1.4.2-4ubuntu1_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649  195768 Feb  5  2016 libisofs6_1.4.2-2_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649   29864 Feb 17  2014 libnfsidmap2_0.25-5_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649   70442 Sep  5  2018 libtirpc1_0.2.5-1ubuntu0.1_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649  171216 May  8 19:08 nfs-common_1%3a1.2.8-9ubuntu12.2_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649  336988 Aug  8 22:26 rear_2.3+dfsg-1_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649   38358 Nov 11  2015 rpcbind_0.2.3-0.2_ppc64el.deb
-rw-r--r-- 1 u0017649 u0017649 1181310 Feb 24  2016 syslinux-common_3%3a6.03+dfsg-11ubuntu1_all.deb
-rw-r--r-- 1 u0017649 u0017649  263420 Apr 18  2016 xorriso_1.4.2-4ubuntu1_ppc64el.deb

이를 아래와 같이 dpkg 명령으로 다 설치하면 됩니다.

u0017649@sys-99404:~/REAR$ sudo dpkg -i *
...
Setting up xorriso (1.4.2-4ubuntu1) ...
Setting up rear:ppc64el (2.3+dfsg-1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for install-info (6.1.0.dfsg.1-5) ...

이제 rear 명령을 쓰실 수 있습니다.

u0017649@sys-99404:~$ which rear
/usr/sbin/rear

REAR를 통해 boot 이미지를 만들고 backup을 받으려면 USB storage(또는 USB stick)를 사용하시는 것이 일반적입니다.  USB port에 USB storage를 꽂으시고 그것이 /dev/sdc로 인식되면, 아래와 같이 일단 format을 해줍니다.  이때 당연히 USB storage 안의 기존 data는 모두 삭제되는데, label은 REAR-000으로 붙여집니다.

u0017649@sys-99404:~$ sudo rear format /dev/sdc

그리고 다음과 같이 REAR의 local config file을 업데이트합니다.

u0017649@sys-99404:~$ sudo vi /etc/rear/local.conf
OUTPUT=USB
BACKUP=NETFS
BACKUP_URL="usb:///dev/disk/by-label/REAR-000"

다음 명령으로 USB storage 안에 boot image를 만듭니다.

u0017649@sys-99404:~$ sudo rear -v mkrescue

그리고나서 아래와 같은 명령으로 OS backup을 받습니다.  이때 backup에 사용되는 format은 tar 입니다.

u0017649@sys-99404:~$ sudo rear -v mkbackup

이제 저 USB storage로부터 booting을 하여 'Recover Arch Rear'를 선택한 뒤, 'arch rear' prompt가 나오면 'rear recover' 명령을 수행하면 OS가 restore 됩니다.   저는 USB storage도 없고 물리적인 linux 서버도 없어서 restore는 테스트해보지 못했습니다만, REAR의 홈페이지에 나와 있는 유튜브 동영상 중에 캡춰한 화면의 recover 메뉴는 아래와 같습니다.




혹시 필요하신 분들을 위하여, 위에서 사용한 'REAR' directory 속의 rear 및 그 prerequisite OS package들을 download 받아둔 REAR.tgz 파일을 아래 Google drive에 올려두었습니다.

https://drive.google.com/open?id=10FjolrZSpuDl6qDKv3dKwOJyCLMxXr7l


댓글 없음:

댓글 쓰기