- 论坛徽章:
- 0
|
本人刚接触aix不久
环境:p650分2个lpar,aix5200-01
克隆rootvg成功做过几次了,基本上就是alt_disk_install -C hdiskn,今天想练手测试几个参数,怎知屡屡碰壁,还望高手不惜赐教
测试内容:
1.修改image.data,定制目标盘的文件系统size
2.测试/etc/exclude.rootvg文件,即定制备份文件列表
3.测试-s参数,在克隆rootvg的完成阶段运行一个shell脚本
4.测试在克隆的完成阶段在目标盘安装一个软件包
5.使用-R参数替换/etc/resolv.conf
先做以下的准备:
1.待安装软件包为Mozilla 1.7.13.0
位于/tmp/Mozilla并且/usr/sys/inst.data/user_bundles有其定义:
# pwd
/usr/sys/inst.data/user_bundles
# more Mozilla.1.7.13.0.bnd
#MEDIA=/tmp/Mozilla
#Mozilla 1.7.13.0
I:Mozilla.base
I:Mozilla.base.rte
I:Mozilla.base.adt
用smit install_bundle测试该bundle可以安装,
为了在克隆时将Mozilla安装到目标盘,源盘中的Mozilla已经用installp -u命令去除:
# lslpp -l Mozilla*
lslpp: 0504-132 Fileset Mozilla* not installed.
2./etc/exclude.rootvg有以下内容:
# more /etc/exclude.rootvg
/info/
3.目标盘中/etc/resolv.conf将被/tmp/resolv.conf替换
# cat /etc/resolv.conf
nameserver 192.168.0.1
# more /tmp/resolv.conf
nameserver 218.247.141.66
nameserver 202.106.127.1
nameserver 202.96.134.133
4.要运行的脚本在/tmp/post.sh:
# more /tmp/post.sh
#!/bin/sh
rm -rf /alt_inst/tmp/Mozilla
rm /tmp/resolv.conf
rm /alt_inst/tmp/resolv.conf
6.修改/image.data中的fs_data节,我对比df -k命令的输出,将lv size改小了:
fs_data:
FS_NAME= /
FS_SIZE= 38472
FS_MIN_SIZE= 38472
FS_LV= /dev/hd4
FS_FS= 4096
FS_NBPI= 2048
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
fs_data:
FS_NAME= /usr
FS_SIZE= 3016312
FS_MIN_SIZE= 2916312
FS_LV= /dev/hd2
FS_FS= 4096
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
fs_data:
FS_NAME= /var
FS_SIZE= 31736
FS_MIN_SIZE= 31736
FS_LV= /dev/hd9var
FS_FS= 4096
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= true
FS_AGSIZE= 16
fs_data:
FS_NAME= /tmp
FS_SIZE= 296440
FS_MIN_SIZE= 296440
FS_LV= /dev/hd3
FS_FS= 4096
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
fs_data:
FS_NAME= /home
FS_SIZE= 8440
FS_MIN_SIZE= 8440
FS_LV= /dev/hd1
FS_FS= 512
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
fs_data:
FS_NAME= /opt
FS_SIZE= 86984
FS_MIN_SIZE= 86984
FS_LV= /dev/hd10opt
FS_FS= 512
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
fs_data:
FS_NAME= /info
FS_SIZE= 1108016
FS_MIN_SIZE= 1108016
FS_LV= /dev/lv00
FS_FS= 4096
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
fs_data:
FS_NAME= /backup
FS_SIZE= 263408
FS_MIN_SIZE= 263408
FS_LV= /dev/backuplv00
FS_JFS2_BS=
FS_JFS2_SPARSE=
FS_JFS2_INLINELOG=
FS_JFS2_SIZEINLINELOG=
# lspv
hdisk0 00c61aeff359b84a rootvg active
hdisk1 0036d35a21b7c49e None
# hostname
p650lp1
# df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 131072 111796 15% 1811 3% /
/dev/hd2 1703936 245776 86% 27165 7% /usr
/dev/hd9var 131072 115148 13% 566 2% /var
/dev/hd3 262144 136000 49% 161 1% /tmp
/dev/hd1 131072 126852 4% 18 1% /home
/proc - - - - - /proc
/dev/hd10opt 131072 87580 34% 1003 4% /opt
/dev/lv00 3276800 2722792 17% 753 1% /info
/dev/backuplv00 4194304 4062600 4% 18 1% /backup#
以上为系统克隆前的状态:
先做简单的:
alt_disk_install -C -B -i /image.data hdisk1
rootvg被成功克隆
接着试这个:
alt_disk_install -X
alt_disk_install -C -B -i /image.data -e /etc/exclude.rootvg hdisk1
以下为命令输出的信息,rootvg没有被克隆:
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating logical volume alt_lv00.
Creating logical volume alt_backuplv00.
Creating /alt_inst/ file system.
Creating /alt_inst/backup file system.
Creating /alt_inst/home file system.
Creating /alt_inst/info file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Generating a list of files, based on the exclude list /etc/exclude.rootvg,
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
/usr/bin/lslpp: No such file or directory
Modifying ODM on cloned disk.
0518-402 odmadd: Cannot open class: CuAt, stanza line: 2 /tmp/.fake_cuat
Check path name and permissions.
0518-402 odmadd: Cannot open class: CuDv, stanza line: 2 /tmp/.fake_cudv
Check path name and permissions.
0518-402 odmadd: Cannot open class: CuDvDr, stanza line: 2 /tmp/.fake_cudvdr
Check path name and permissions.
cat: 0652-050 Cannot open /alt_inst/etc/filesystems.
cp: /alt_inst/etc/filesystems: A file or directory in the path name does not exi
st.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[35]: /alt_inst/etc/filesystems.tmp: 0403-005 Cannot c
reate the specified file.
cp: /alt_inst/etc/filesystems.tmp: A file or directory in the path name does not
exist.
A file or directory in the path name does not exist.
/usr/sbin/alt_disk_install[57]: /alt_inst/etc/filesystems.save: 0403-005 Cannot
create the specified file.
cp: /alt_inst/etc/filesystems.save: A file or directory in the path name does no
t exist.
Building boot image on cloned disk.
mv: 0653-401 Cannot rename /alt_inst/dev/hd5 to /alt_inst/dev/orig.hd5:
A file or directory in the path name does not exist.
mknod: /alt_inst/dev/hd5: A file or directory in the path name does not exist.
mv: 0653-401 Cannot rename /alt_inst/dev/hdisk0 to /alt_inst/dev/orig.hdisk0:
A file or directory in the path name does not exist.
mv: 0653-401 Cannot rename /alt_inst/dev/rhdisk0 to /alt_inst/dev/orig.rhdisk0:
A file or directory in the path name does not exist.
mknod: /alt_inst/dev/hdisk0: A file or directory in the path name does not exist
.
mknod: /alt_inst/dev/rhdisk0: A file or directory in the path name does not exis
t.
0518-506 odmget: Cannot open object class CuAt
Check path name and permissions.
0518-506 odmget: Cannot open object class CuAt
Check path name and permissions.
0518-506 odmget: Cannot open object class CuAt
Check path name and permissions.
/usr/sbin/bosboot: No such file or directory
/usr/sbin/bosboot: No such file or directory
0505-120 alt_disk_install: Error running bosboot in the cloned
root volume group.
Cleaning up.
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/info
forced unmount of /alt_inst/home
forced unmount of /alt_inst/backup
forced unmount of /alt_inst
forced unmount of /alt_inst
#
我反复试了几次,只要用了-e /etc/exclude.rootvg,克隆就通不过,
再来试其他的:
# alt_disk_install -C -B -b Mozilla.1.7.13.0 -I acXY -l /tmp/Mozilla \
> -s /tmp/post.sh -i /image.data -R /tmp/resolv.conf -O hdisk1
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating logical volume alt_lv00.
Creating logical volume alt_backuplv00.
Creating /alt_inst/ file system.
Creating /alt_inst/backup file system.
Creating /alt_inst/home file system.
Creating /alt_inst/info file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
Installing optional filesets or updates into altinst_rootvg...
##################################################
installp cmd: chroot /alt_inst /usr/sbin/installp -acXYb -d /tmp_install -f /tmp
/bundle.altinst 2>&1
##################################################
+-----------------------------------------------------------------------------+
Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
FAILURES
--------
Filesets listed in this section failed pre-installation verification
and will not be installed.
Missing Filesets
----------------
The following filesets could not be found on the installation media.
If you feel these filesets really are on the media, check for typographical
errors in the name specified or, if installing from directory, check for
discrepancies between the Table of Contents file (.toc) and the images that
reside in the directory.
I:Mozilla.base
I:Mozilla.base.rte
I:Mozilla.base.adt
<< End of Failure Section >>
FILESET STATISTICS
------------------
3 Selected to be installed, of which:
3 FAILED pre-installation verification
----
0 Total to be installed
Pre-installation Failure/Warning Summary
----------------------------------------
Name Level Pre-installation Failure/Warning
-------------------------------------------------------------------------------
I:Mozilla.base Not found on the installation media
I:Mozilla.base.rte Not found on the installation media
I:Mozilla.base.adt Not found on the installation media
Warning: error installing bundle name: /tmp/bundle.altinst
forced unmount of /alt_inst/tmp_install
Running user specified customization script /tmp/post.sh...
Modifying ODM on cloned disk.
Building boot image on cloned disk.
Resetting all device attributes.
NOTE: The first boot from altinst_rootvg will prompt to define the new system
console.
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/info
forced unmount of /alt_inst/home
forced unmount of /alt_inst/backup
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
rootvg被成功克隆,从hdisk1启动系统可以知道/etc/resolv.conf被/tmp/resolv.conf替换掉,post.sh脚本也运行了,但Mozilla没有被安装,
本人对alt_disk_install命令只看过man手册,不太清楚其运行过程调用installp的细节,也查不到有用的资料,郁闷...整到现在,只好冒个泡,求高人解答-_-! |
|