Debian 6.0 P2V化

  • Debian 6.0 でP2Vをやってたんですが、なかなかうまくいかなかったんでメモっとく
  • 対象のバックアップ元はこんな感じ
# uname -a
Linux hostname 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686 GNU/Linux
# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3              9574420   8602432    971988  90% /
tmpfs                    62392         0     62392   0% /lib/init/rw
udev                     57236       172     57064   1% /dev
tmpfs                    62392         0     62392   0% /dev/shm
/dev/sda1               101086     64077     31790  67% /boot
  • 利用したのは、この辺

ツール バージョン 結果
VMware vCenter Converter Standalone 2011-08-31 5.0 失敗
Mondo Rescue v3.0.2-r3018 失敗
Relax-and-Recover 1.13.0-git201208040834 / 2012-08-04 成功

VMware vCenter Converter Standalone 5.0

  • パワーオンマシンのP2V
  • 以下のメッセージが出て終了しない
変換中にエラーが発生しました: 「GrubInstaller::InstallGrub: /usr/lib/vmware-converter/installGrub.sh failed with return code: 127, and message: Installing GRUB1 on (hd0)...
/vmware-updateGrub.sh: 59: grub: not found
Error installing GRUB
Error running vmware-updateGrub.sh through chroot into /mnt/p2v-src-root

Mondo Rescue

# mondoarchive -Oi -g -L -N -s 4300m -d /mnt/nfs/ -S /mnt/nfs/ -T /mnt/nfs/ -E /mnt 
  • 引数については、Mondo Rescue(Stray Penguin -Linux Memo-)を参考にしました。
  • HDDの残りが少ないので、「-S」「-T」あたりは、NFSマウント先のネットワークドライブに設定
  • バックアップ終了後、リストア時に以下のメッセージが表示される
mondorestore: error while loading shared libraries: libnewt.so.0.52: cannot open shared object file: No such file or directory
  • libnewt.so.0.52 / fdisk などその後も必要そうなライブラリ・実行ファイルなどを追加して実施する
    • ISOイメージに直接追加してたけど、「/usr/lib/mindi/rootfs」あたりに追加して再作成するとよい?
  • 結局、「/dev/sdax」の mount がうまくいかないというところまでで、あきらめる

Relax-and-Recover

  • 公式サイトの「Download」 → 「Snapshot releases from Git」 → 「Debian: 6.0」 から、パッケージ取得
  • 以下でインストール
# dpkg -I rear_1.13.0-0git201208040834_all.deb
 new debian package, version 2.0.
 size 239786 bytes: control archive= 14890 bytes.
     675 bytes,    15 lines      control
   39850 bytes,   447 lines      md5sums
 Package: rear
 Version: 1.13.0-0git201208040834
 Architecture: all
 Maintainer: Dag Wieers 
 Installed-Size: 3732
 Depends: mingetty, syslinux, ethtool, libc6, lsb-release, portmap, genisoimage, iproute, iputils-ping, nfs-client, binutils, parted
 Provides: rear
 Section: misc
 Priority: optional
 Homepage: http://relax-and-recover.org/
 Description: Relax and Recover is a bare metal disaster recovery and system
  migration framework. See http://relax-and-recover.org/ for all the details.
  We are still looking for a Debian package maintainer who would write better
  packages. Please contact us to volunteer for maintaining Relax-and-Recover
  in Debian and Ubuntu.
# aptitude install aptitude install mingetty syslinux ethtool libc6 lsb-release portmap genisoimage iproute iputils-ping nfs-client binutils parted
# dpkg -i rear_1.13.0-0git201208040834_all.deb
/etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
NETFS_URL=nfs://192.168.2.123/nfs
  • 以下でバックアップ
# rear -v mkbackup
Relax-and-Recover 1.13.0-git201208040834 / 2012-08-04
Using log file: /var/log/rear/rear-hostname.log
Creating disk layout
Creating root filesystem layout
TIP: To login as root via ssh you need to set up /root/.ssh/authorized_keys
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Creating initramfs
Making ISO image
Wrote ISO image: /var/lib/rear/output/rear-hostname.iso (28M)
Copying resulting files to nfs location
Creating tar archive '/tmp/rear.fAviiX8E7OAQH2l/outputfs/hostname/backup.tar.gz'
Archived 522 MiB [avg 11897 KiB/sec]
 [snip]
  • リストアの際には、作成された 「rear-hostname.iso」でブートし、以下を実行
# rear recover
  • 適当に、「5 continue」していくとリストア完了