DISCLAIMER : Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility.If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.
Cloning a rootvg using alternate disk installation
Using this scenario, you can clone AIX® running on rootvg to an alternate disk on the same system, install a user-defined software bundle, and run a user-defined script to customize the AIX image on the alternate disk.
The information in
this how-to scenario was tested using specific versions of AIX. The
results you obtain might vary significantly depending on your version
and level of AIX.
Because
the alternate disk installation process
involves cloning an existing rootvg to a
target alternate disk, the target alternate disk must not be already
assigned to a volume group.
In this scenario you will do the following:
- Prepare for the alternate disk installation
- Perform the alternate disk installation and customization
- Boot off the alternate disk
- Verify the operation
Step 1. Prepare for the alternate disk installation
- Check the status of physical disks on your system. Type:
Output similar to the following displays:# lspv
We can use hdisk1 as our alternate disk because no volume group is assigned to this physical disk.hdisk0 0009710fa9c79877 rootvg active hdisk1 0009710f0b90db93 None
- Check to see if the alt_disk_copy fileset
has been installed by running the following:
Output similar to the following displays if the alt_disk_copy fileset is not installed:# lslpp -L bos.alt_disk_install.rte
lslpp: 0504-132 Fileset bos.alt_disk_install.rte not installed.
- Using volume 1 of the AIX installation
media, install the alt_disk_copy fileset
by running the following:
Output similar to the following displays:# geninstall -d/dev/cd0 bos.alt_disk_install.rte
+-----------------------------------------------------------------------------+ Summaries: +-----------------------------------------------------------------------------+ Installation Summary -------------------- Name Level Part Event Result ------------------------------------------------------------------------------- bos.alt_disk_install.rte 5.3.0.0 USR APPLY SUCCESS
- Create a user-defined bundle called /usr/sys/inst.data/user_bundles/MyBundle.bnd that
contains the following filesets:
I:bos.content_list I:bos.games
- Create the /home/scripts directory:
mkdir /home/scripts
- Create a user-defined customization script called AddUsers.sh in
the /home/scripts directory:
touch /home/scripts/AddUsers.sh chmod 755 /home/scripts/AddUsers.sh
- Edit /home/scripts/AddUsers.sh to contain
the following lines:
mkuser johndoe touch /home/johndoe/abc.txt touch /home/johndoe/xyz.txt
Step 2. Perform the alternate disk installation and customization
- To clone the rootvg to an alternate
disk, type the following at the command line to open the SMIT menu
:
# smit alt_clone
- Select hdisk1 in the Target Disk to Install field.
- Select the MyBundle bundle in the Bundle to Install field.
- Insert volume one of the installation media.
- Type /dev/cd0 in the Directory or Device with images field.
- Type /home/scripts/AddUsers.sh in the Customization script field.
- Press Enter to start the alternate disk installation.
- Check that the alternate disk was created, by running the following:
# lspv
Output similar to the following displays:
hdisk0 0009710fa9c79877 rootvg hdisk1 0009710f0b90db93 altinst_rootvg
Step 3. Boot from the alternate disk
- By default, the alternate-disk-installation process changes the
boot list to the alternate disk. To check this run the following:
Output similar to the following displays:# bootlist -m normal -o
hdisk1
- Reboot the system. Type:
# shutdown -r
The system boots from the boot image on the alternate disk (hdisk1).
Step 4. Verify the operation
- When the system reboots, it will be running off the alternate
disk. To check this, type the following:
Output similar to the following displays:# lspv
hdisk0 0009710fa9c79877 old_rootvg hdisk1 0009710f0b90db93 rootvg
- Verify that the customization script ran correctly, by typing
the following:
Output similar to the following displays:# find /home/johndoe -print
/home/johndoe /home/johndoe/.profile /home/johndoe/abc.txt /home/johndoe/xyz.txt
- Verify that the contents of your software bundle was installed,
by typing the following:
Output similar to the following displays:# lslpp -Lb MyBundle
Fileset Level State Description ---------------------------------------------------------------------------- bos.content_list 5.3.0.0 C AIX Release Content List bos.games 5.3.0.0 C Games
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.