since my disk clone script for irix was quite popular i figured i could also share the one for osf. here it comes:
Code: Select all
########################################################################
#
# R-A-C OSF/1 AdvFS system disk clone
#
#
# this script generally assumes disk id 1 and that your target disk is
# partitioned already. if not run:
# disklabel -wr -t advfs /dev/rdisk/dsk1c
#
# then partition your disk using diskconfig or disklabel.
# this script expects the following partitions:
# - a: root, rather small.
# - b: usr, the big one. everything else goes there.
# - d: swap, not necessary for the cloning.
#
# if you should not have var as part of the usr domain change the
# related parts accordingly.
# if you should use the clone with a different id than the original
# remember to change the swap entry in /etc/sysconfigtab on the clone.
#
########################################################################
echo preparing ...
rmfdmn -f clone_usr
rmfdmn -f clone_root
cd /mnt
mkdir dr du dv
echo creating clone root domain ...
mkfdmn /dev/disk/dsk1a clone_root
echo creating clone root fileset ...
mkfset clone_root root
mount_advfs clone_root#root /mnt/dr
echo creating clone usr domain ...
mkfdmn /dev/disk/dsk1b clone_usr
echo creating clone usr fileset ...
mkfset clone_usr usr
mount_advfs clone_usr#usr /mnt/du
echo putting var into the usr domain ...
mkfset clone_usr var
mount_advfs clone_usr#var /mnt/dv
echo dumping ...
vdump 0f - / | ( cd /mnt/dr ; vrestore xf - )
vdump 0f - /usr | ( cd /mnt/du ; vrestore xf - )
vdump 0f - /var | ( cd /mnt/dv ; vrestore xf - )
echo fixing domains for the clone ...
cd /mnt/dr/etc/fdmns
mv root_domain root_domain_old
mv usr_domain usr_domain_old
mv clone_root root_domain
mv clone_usr usr_domain
echo cleaning up ...
cd /mnt
umount dr
umount du
umount dv
rmdir dr du dv
echo all done
exit 0
r-a-c.de