43 lines
970 B
Bash
43 lines
970 B
Bash
#!/bin/sh
|
|
|
|
IP="10.20.0.1"
|
|
|
|
# our partclone.dd wrapper script to support ext4
|
|
cd /usr/sbin
|
|
mv partclone.dd partclone.dd-backup
|
|
wget http://$IP/pxelinux/scripts/partclone.dd-restore -O partclone.dd
|
|
chmod +x partclone.dd
|
|
|
|
# mount NFS and symlink image folder
|
|
mount -t nfs $IP:/cluster /mnt
|
|
rm -rf /home/partimag
|
|
ln -s /mnt/images /home/partimag
|
|
|
|
# restore image and umount NFS afterwards
|
|
ocs-sr -b -p /bin/true -e -g auto restoreparts computenode sda1 sda3
|
|
umount /mnt
|
|
|
|
# mount restored system
|
|
mount /dev/sda3 /mnt
|
|
mount /dev/sda1 /mnt/boot
|
|
mount -o bind /proc /mnt/proc
|
|
mount -o bind /dev /mnt/dev
|
|
mount -o bind /sys /mnt/sys
|
|
|
|
# create system specific initrd
|
|
chroot /mnt /usr/bin/mkinitcpio -p linux
|
|
|
|
# create miscellaneous file systems
|
|
mkswap -U 72f3bc4e-237f-4737-94fa-fa3e4d598642 /dev/sda2
|
|
mkfs.xfs /dev/sda5
|
|
xfs_admin -U cf837a59-c7b3-40a9-bf83-20acb6eb0fb8 /dev/sda5
|
|
|
|
# clean up
|
|
umount /mnt/sys
|
|
umount /mnt/dev
|
|
umount /mnt/proc
|
|
umount /mnt/boot
|
|
umount /mnt
|
|
|
|
bash
|