Recently we ignited the HP-UX server, later we had issues in LVM.
We were not able to delete the VGs when we wished to re-layout the VG and restore the data from Backup.
Beloa are the one finally helped.
vgchange -a n /dev/vg
vgexport /dev/vg
in script -
for vg in $(strings /etc/lvmtab | grep vg)
do
echo vgchange -a n $vg
echo vgexport $vg
done
Some useful scripts -
# printf "%-18s | %-17s | %-17s\n" "PV" "VGID" "PVID"; \ for pv in `ls /dev/rdsk/*` do xd -An -j8200 -N16 $pv > /dev/null 2>&1 if [[ $? -eq 0 ]]; then echo "$pv \c" xd -An -j8200 -N16 -tx $pv 2> /dev/null fi done \ | awk '$0 ~ /dev/ {printf "%-18s | %8s %8s | %8s %8s\n", $1, $4, $5, $2, $3}' \ | sort -k 2,5
Thursday, December 23, 2010
Wednesday, December 22, 2010
HP UNIX - To Find the Alternate Links
for pv in $(ls /dev/rdsk/*)
do
echo $pv
xd -An -j8200 -N16 -tx $pv 2> /dev/null
done > /tmp/output
do
echo $pv
xd -An -j8200 -N16 -tx $pv 2> /dev/null
done > /tmp/output
Wednesday, November 17, 2010
Linux LVM Notes
How to extend disk space of an existing file system in LVM, or How to configure LVM or create new volume group from command line, or Understand the maximum volume group size limitation.
How to create new Linux EXT3 file system in LVM with new hard disk by creating new logical volume?
Assuming a new IDE hard disk hooked up to Secondary-Slave IDE bus for the new logical volume / file system. Hence, the Linux device code will be /dev/hdd for this IDE hard disk, according to LANANA Linux Device List or the offline copy in /usr/src/linux-2.x/Documentation/devices.txt
1. Using the whole secondary-slave IDE hard disk for existing LVM volume group (called vg0 in my case) by creating the physical volume (PV):
pvcreate /dev/hdd
A similar message of this will be shown upon successful execution of pvcreate command:
pvcreate — physical volume “/dev/hdd” successfully created
2. Adding the new physical volume (PV) to volume group vg0, i.e. to extend the existing volume group size with new physical volume:
vgextend vg0 /dev/hdd
If no errors encounter while executing vgextend, a similar message of this will be seen:
vgextend — INFO: maximum logical volume size is 1023.97 Gigabyte
vgextend — doing automatic backup of volume group “vg0″
vgextend — volume group “vg0″ successfully extended
3. Create the new logical volume (LV) at 400MB (not fully utilize the whole IDE hard disk) to host the new EXT3 file system in question:
lvcreate -L 400M -n lvol1 vg0
Suppose lvcreate completed successfully, this similar message will be seen:
lvcreate — doing automatic backup of “vg0″
lvcreate — logical volume “/dev/vg0/lvol1″ successfully created
4. Now, create the new EXT3 file system on the new logical volume (LV) with 1% file system reserved block count:
mkfs -t ext3 -m 1 -v /dev/vg0/lvol1
Once the new EXT3 file system creation completed, you can examine the file system by executing
tune2fs -l /dev/vg0/lvol1
5. Create a mount point directory for the new EXT3 file system:
mkdir /mnt/newfs
6. It’s now ready to mount the new EXT3 file system:
mount -t ext3 /dev/vg0/lvol1 /mnt/newfs
To confirm that the new EXT3 file system has been mounted successful, type df -h
Reference and thanks to http://www.walkernews.net/2007/07/11/create-new-linux-ext3-file-system-in-lvm/
How to create new Linux EXT3 file system in LVM with new hard disk by creating new logical volume?
Assuming a new IDE hard disk hooked up to Secondary-Slave IDE bus for the new logical volume / file system. Hence, the Linux device code will be /dev/hdd for this IDE hard disk, according to LANANA Linux Device List or the offline copy in /usr/src/linux-2.x/Documentation/devices.txt
1. Using the whole secondary-slave IDE hard disk for existing LVM volume group (called vg0 in my case) by creating the physical volume (PV):
pvcreate /dev/hdd
A similar message of this will be shown upon successful execution of pvcreate command:
pvcreate — physical volume “/dev/hdd” successfully created
2. Adding the new physical volume (PV) to volume group vg0, i.e. to extend the existing volume group size with new physical volume:
vgextend vg0 /dev/hdd
If no errors encounter while executing vgextend, a similar message of this will be seen:
vgextend — INFO: maximum logical volume size is 1023.97 Gigabyte
vgextend — doing automatic backup of volume group “vg0″
vgextend — volume group “vg0″ successfully extended
3. Create the new logical volume (LV) at 400MB (not fully utilize the whole IDE hard disk) to host the new EXT3 file system in question:
lvcreate -L 400M -n lvol1 vg0
Suppose lvcreate completed successfully, this similar message will be seen:
lvcreate — doing automatic backup of “vg0″
lvcreate — logical volume “/dev/vg0/lvol1″ successfully created
4. Now, create the new EXT3 file system on the new logical volume (LV) with 1% file system reserved block count:
mkfs -t ext3 -m 1 -v /dev/vg0/lvol1
Once the new EXT3 file system creation completed, you can examine the file system by executing
tune2fs -l /dev/vg0/lvol1
5. Create a mount point directory for the new EXT3 file system:
mkdir /mnt/newfs
6. It’s now ready to mount the new EXT3 file system:
mount -t ext3 /dev/vg0/lvol1 /mnt/newfs
To confirm that the new EXT3 file system has been mounted successful, type df -h
Reference and thanks to http://www.walkernews.net/2007/07/11/create-new-linux-ext3-file-system-in-lvm/
Tuesday, September 21, 2010
OpenSolaris SSH root
For openSolaris, we need to modify the role for the root user to enable root ssh .
### enable root ssh login ###
rolemod -K type=normal root
### enable root ssh login ###
rolemod -K type=normal root
Saturday, September 18, 2010
Friday, August 13, 2010
Monday, August 9, 2010
Adding timestamp for each line in nohup.out
http://blogs.sun.com/LetTheSunShineIn/entry/adding_timestamp_for_each_line
Saturday, August 7, 2010
To configure the newly added LUNS on RHEL:
To configure the newly added LUNS on RHEL:
# ls /sys/class/fc_host
host0 host1 host2 host3
fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
echo "1" > /sys/class/fc_host/host0/issue_lip
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "1" > /sys/class/fc_host/host1/issue_lip
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "1" > /sys/class/fc_host/host2/issue_lip
echo "- - -" > /sys/class/scsi_host/host2/scan
echo "1" > /sys/class/fc_host/host3/issue_lip
echo "- - -" > /sys/class/scsi_host/host3/scan
cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l
fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
Alternatively, we can
run the re-scan-scsi script.
To scan new LUNs on Linux operating system which is using QLogic driver
You need to find out driver proc file /proc/scsi/qlaXXX.
For example on my system it is /proc/scsi/qla2300/0
Once file is identified you need to type following command (login as the root):
# echo "scsi-qlascan" > /proc/scsi/qla2300/0
# cat /proc/scsi/qla2300/0
Now use the script rescan-scsi-bus.sh new LUN as a device. Run script as follows:
# ./rescan-scsi-bus.sh -l -w
The output of ls -l /sys/block/*/device should give you an idea about how each device is connected to the system.
Thanks & Reference: http://lazysystemadmin.blogspot.com/2010/06/scan-and-configure-new-luns-on-redhat.html
# ls /sys/class/fc_host
host0 host1 host2 host3
fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
echo "1" > /sys/class/fc_host/host0/issue_lip
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "1" > /sys/class/fc_host/host1/issue_lip
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "1" > /sys/class/fc_host/host2/issue_lip
echo "- - -" > /sys/class/scsi_host/host2/scan
echo "1" > /sys/class/fc_host/host3/issue_lip
echo "- - -" > /sys/class/scsi_host/host3/scan
cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l
fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
Alternatively, we can
run the re-scan-scsi script.
To scan new LUNs on Linux operating system which is using QLogic driver
You need to find out driver proc file /proc/scsi/qlaXXX.
For example on my system it is /proc/scsi/qla2300/0
Once file is identified you need to type following command (login as the root):
# echo "scsi-qlascan" > /proc/scsi/qla2300/0
# cat /proc/scsi/qla2300/0
Now use the script rescan-scsi-bus.sh new LUN as a device. Run script as follows:
# ./rescan-scsi-bus.sh -l -w
The output of ls -l /sys/block/*/device should give you an idea about how each device is connected to the system.
Thanks & Reference: http://lazysystemadmin.blogspot.com/2010/06/scan-and-configure-new-luns-on-redhat.html
Thursday, June 3, 2010
HP-UX : Processors and Core
Number of Processors:
#top
#ioscan -Cprocessor
To find out the core:
#echo "selclass qualifier cpu;info;wait;il" | cstm
#top
#ioscan -Cprocessor
To find out the core:
#echo "selclass qualifier cpu;info;wait;il" | cstm
Wednesday, May 26, 2010
HP-UX: Booting from an alternate kernel
HP-UX: Booting from an alternate kernel
Press a key, while PDC is waiting for the 10 seconds manual overide.
Autosearch for boot path enabled
To override, press any key with 10 seconds.
Boot from primary boot path (Y or N)?> N
Boot from alternate boot path (Y or N)?> N
Enter boot path, comman, or ?>
console>boot
Interact with IPL (Y or N)?>Y
Booting...
Boot IO Dependent Code (IODC) revision 4
Hard Booted
ISL Revision A.00.38 Oct 26, 1994
ISL>hpux boot disk()/stand/vmunix.prev
Press a key, while PDC is waiting for the 10 seconds manual overide.
Autosearch for boot path enabled
To override, press any key with 10 seconds.
Boot from primary boot path (Y or N)?> N
Boot from alternate boot path (Y or N)?> N
Enter boot path, comman, or ?>
console>boot
Interact with IPL (Y or N)?>Y
Booting...
Boot IO Dependent Code (IODC) revision 4
Hard Booted
ISL Revision A.00.38 Oct 26, 1994
ISL>hpux boot disk()/stand/vmunix.prev
Thursday, May 6, 2010
ISSUE: Veritas file system mount issue
ISSUE: file system mount issue
STATUS:
- found disks failed in "vxdisk list"
- - rootdg03 rootdg failed was:c4t0d3s2
- - oracled09 oracledg failed was:c3t1d0s2
- - oracled10 oracledg failed was:c4t0d1s2
- - oracled11 oracledg failed was:c4t0d2s2
- - oracled12 oracledg failed was:c4t0d4s2
- found disks not available in "format" too
12. c4t0d0
/pci@6,4000/fibre-channel@4/sd@0,0
13. c4t0d1
/pci@6,4000/fibre-channel@4/sd@0,1
/pci@6,4000/fibre-channel@3/sd@0,1
18. c5t1d0
/pci@6,4000/fibre-channel@3/sd@1,0
19. c5t1d1
/pci@6,4000/fibre-channel@3/sd@1,1
- found volumes in recover states, recovered the volumes using below commands.
vxmend -g dg -o force off plex
vxmend -g dg on plex
vxmend -g dg fix clean plex
vxvol -g dg start vol
- fsck and mounted the volumes, its working fine
- to fix issue with stale entries for dmp and disks, went for device tree cleanup with reconfiguration reboot
STATUS:
- found disks failed in "vxdisk list"
- - rootdg03 rootdg failed was:c4t0d3s2
- - oracled09 oracledg failed was:c3t1d0s2
- - oracled10 oracledg failed was:c4t0d1s2
- - oracled11 oracledg failed was:c4t0d2s2
- - oracled12 oracledg failed was:c4t0d4s2
- found disks not available in "format" too
12. c4t0d0
/pci@6,4000/fibre-channel@4/sd@0,0
13. c4t0d1
/pci@6,4000/fibre-channel@4/sd@0,1
/pci@6,4000/fibre-channel@3/sd@0,1
18. c5t1d0
/pci@6,4000/fibre-channel@3/sd@1,0
19. c5t1d1
/pci@6,4000/fibre-channel@3/sd@1,1
- found volumes in recover states, recovered the volumes using below commands.
vxmend -g dg -o force off plex
vxmend -g dg on plex
vxmend -g dg fix clean plex
vxvol -g dg start vol
- fsck and mounted the volumes, its working fine
- to fix issue with stale entries for dmp and disks, went for device tree cleanup with reconfiguration reboot
Wednesday, April 28, 2010
Account is disabled – see Account Administrator
This time is a tip to enable a user account if your system uses password aging or the user was locked out due to the unsuccessful login attempts.
login: user
Password:
Account is disabled – see Account Administrator
To enable a locked or disabled HP-UX account, run the command:
/usr/lbin/modprpw -l -k
login: user
Password:
Account is disabled – see Account Administrator
To enable a locked or disabled HP-UX account, run the command:
/usr/lbin/modprpw -l -k
Monday, April 19, 2010
20 Linux System Monitoring Tools Every SysAdmin Should Know
http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html
Tuesday, March 23, 2010
Wednesday, January 27, 2010
Redhat Linux : Forgot Root Password and How to Reset?
You can log in using single-user mode and create a new root password.
To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:
At the boot loader menu, use the arrow keys to highlight the installation you want to edit and type [A] to enter into append mode.
You are presented with a prompt that looks similar to the following:
grub append> ro root=LABEL=/
Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. The result should look like the following:
ro root=LABEL=/ single
Press [Enter] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:
sh-2.05b#
You can now change the root password by typing
passwd root
You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.
Reference: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/step-guide/s1-q-and-a-root-passwd.html
To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:
At the boot loader menu, use the arrow keys to highlight the installation you want to edit and type [A] to enter into append mode.
You are presented with a prompt that looks similar to the following:
grub append> ro root=LABEL=/
Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. The result should look like the following:
ro root=LABEL=/ single
Press [Enter] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:
sh-2.05b#
You can now change the root password by typing
passwd root
You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.
Reference: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/step-guide/s1-q-and-a-root-passwd.html
Subscribe to:
Posts (Atom)