- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Mirror rootvg
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 03:41 AM
04-22-2005 03:41 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 03:47 AM
04-22-2005 03:47 AM
Solutionpvcreate -B /dev/rdsk/c1t0d0 #use real disk
mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk
# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?
If you are running 64-bit OS:
# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?
vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0
# real disk. repeat for other lvols
lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 03:56 AM
04-22-2005 03:56 AM
Re: Mirror rootvg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 03:57 AM
04-22-2005 03:57 AM
Re: Mirror rootvg
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:01 AM
04-22-2005 04:01 AM
Re: Mirror rootvg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:04 AM
04-22-2005 04:04 AM
Re: Mirror rootvg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:06 AM
04-22-2005 04:06 AM
Re: Mirror rootvg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:30 AM
04-22-2005 04:30 AM
Re: Mirror rootvg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:56 AM
04-22-2005 04:56 AM
Re: Mirror rootvg
This is tried and true.
Hope it helps
B
#!/usr/bin/ksh
VG=$( bdf |grep /stand|awk -F\/ '{print $3}')
FINDPRIMDSK=$(vgdisplay -v /dev/$VG|grep "PV Name"| awk -F\/ '{print $NF}')
OSCHECK=$(uname -r | awk -F\. '{print $2}')
# Checking to see if the command was executed with the unused disk device file name
if [ -z "$1" ];then
echo "/nUsage: OSMirror
exit 1
else
# Checking to see if the disk is a block device file & is not in lvmtab.
if [ -b "/dev/dsk/$1" ];then
strings /etc/lvmtab |grep -q /dev/dsk/$1 > /dev/null 2>&1
if [ $? -ne 0 ];then
NEWDISK=$1
else
echo "/nError: The disk device $1 is already in use"
exit 1
fi
else
echo "/nError: The disk device $1 is not a valid block device"
exit 1
fi
fi
# Testing to see if the Alternate disk is equal to or larger than the root disk.
PRIMDSK=$(diskinfo /dev/rdsk/$FINDPRIMDSK|grep size: | awk '{print $2}')
ALTDSK=$(diskinfo /dev/rdsk/$1|grep size:|awk '{print $2}')
if [ $PRIMDSK -gt $ALTDSK ];then
echo "\n Error: Selected disk is smaller than the root disk"
exit 1
else
NEWDISK=$1
fi
# Creating the raw disk as a bootable device
pvcreate -B -f /dev/rdsk/$NEWDISK
if [ $? -ne 0 ];then
echo "\nError: pvcreate failed"
exit 1
fi
mkboot /dev/rdsk/$NEWDISK
if [ $? -ne 0 ];then
echo "\nError: mkboot failed"
exit 1
fi
mkboot -a "hpux -lq" /dev/rdsk/$NEWDISK
if [ $? -ne 0 ];then
echo "\nError: mkboot -a failed"
exit 1
fi
#adding the disk to the existing OS volume group
vgextend $VG /dev/dsk/$NEWDISK
if [ $? -ne 0 ];then
echo "\nError: vgextend failed"
exit 1
fi
#Collecting the list of root logical volumes in order to be used for mirroring.
LVOLLIST=$( bdf |grep $VG|awk '{print $1}'|awk -F\/ '{print $NF}')
SWAP=$(swapinfo |grep $VG |head -1|awk '{print $NF}'|sort|awk -F\/ '{print $NF}'
)
LVOLLIST="$LVOLLIST $SWAP"
for i in $LVOLLIST;do
echo $i | sed 's/lvol//' >> /tmp/rootmirror_$$
done
sort -n -k1 /tmp/rootmirror_$$ > /tmp/rootmirror1_$$
mv /tmp/rootmirror1_$$ /tmp/rootmirror_$$
LVOLLIST=$(cat /tmp/rootmirror_$$)
# Creating the Mirror of the logical volumes on the new disk
for i in $LVOLLIST;do
lvextend -m 1 /dev/$VG/lvol$i /dev/dsk/$NEWDISK
done
#Finding the logical volume group that / is mounted on.
# Double checking with bdf and fstab.
RLVOL1=$(bdf|grep /$ |awk '{print $1}')
RLVOL2=$(grep " / " /etc/fstab | awk '{print $1}')
RLVOL3=$(grep " /stand " /etc/fstab | awk '{print $1}')
if [ "$RLVOL1" = "$RLVOL2" ];then
lvlnboot -r $RLVOL1
lvlnboot -b $RLVOL3
lvlnboot -s /dev/$VG/$SWAP
else
echo "Error: Could not determine the correct logical volume for / "
exit 1
fi
#cleanup
rm /tmp/rootmirror*
#Setting the Mirror as the alternate bootable device
HWPATH=$( ioscan /dev/dsk/$NEWDISK | tail -1 |awk '{print $1}')
setboot -a $HWPATH
# LIFFILE variable set for 32 or 64 bit systems. updatediaglif2 is used with
# 64 bit systems.
#
RDISK=/dev/rdsk/$NEWDISK
if [ $OSCHECK = "11" ]
then
BITLEVEL=`getconf KERNEL_BITS`
if [ $BITLEVEL = "32" ]
then
LIFFILE=/usr/sbin/diag/lif/updatediaglif
elif [ $BITLEVEL = "64" ]
then
LIFFILE=/usr/sbin/diag/lif/updatediaglif2
else
echo "ERROR: could not determine the whether the OS is 32 or 64 bit"
echo "Run getconf KERNEL_BITS to determine if the command is working"
echo "properly. A 32 or 64 bit level should be displayed"
echo "ODE not copied to $ALTROOT lif files"
fi
else
LIFFILE=/usr/sbin/diag/lif/updatediaglif
fi
# Verify that the updatediaglif file exists
# ISL, AUTO, HPUX, PAD, and LABEL are not overwriten during the copy.
# To add protection to any other lif files add -p "lif file" to the
# mkboot command below
if [ $? = 0 ]
then
if [ -f $LIFFILE ]
then
mkboot -b $LIFFILE -p ISL -p AUTO -p HPUX -p PAD -p LABEL $RDISK
if [ $? -ne 0 ]
then
echo "The mkboot command was not successful"
else
echo "mkboot copy to $RDISK successful"
fi
else
echo "The $LIFFILE does not exist. ODE not copied to $ALTROOT"
exit 1
fi
else
exit 1
fi