Interview Questions and Answers - Linux Administrator

By Parthiban Ponnusamy


1.  How do u force a user to change password on next login in linux?

A.  chage -d 0 "User"


2.What command can be used to findout server architechure (x86 or x64) apart from 
    uname?

A. arch

3. How do u findout the users who are NOT logged in for more than 30 days? which file u 
    will check?

A. last , lastlog,   /var/log/wtmp

4. whats is called 1.5 stage in boot process of linux?

A. Which contains extra code to allow cylinders above 1024, or LBA type drives, to be read. The  
    1.5 boot loader is stored (if needed) in the MBR or the boot partition.The great thing about  
    GRUB is that it includes knowledge of Linux file systems. Instead of using raw sectors on the 
    disk, as LILO does, GRUB can load a Linux kernel from an ext2 or ext3 file system. It does this 
    by making the two-stage boot loader into a three-stage boot loader. Stage 1 (MBR) boots a 
    stage 1.5 boot loader that understands the particular file system containing the Linux kernel 
    image. Examples include reiserfs_stage1_5 (to load from a Reiser journaling file system) or  
   e2fs_stage1_5 (to load from an ext2 or ext3 file system). When the stage 1.5 boot loader is   
    loaded and running, the stage 2 boot loader can be loaded."

    So Basically,

    Stage 1 Boot loader is MBR

    Stage 2 Boot loader is GRUB

    Stage 1.5 Boot loader is e2fs_stage1_5 
    (Basically this module will load the knowledge of Filesystem to Grub to read the kernel)

5. When u try to create a file, u got a error that "No space available". But actually space  
     available on volume? How do u resolve this issue?

A. Try this df -i   list inode information instead of block usage [Perhaps are you out of inodes on 
    this file system.], To "rectify it", remove unwanted files or move them somewhere else.]

Short cut keys : Helpfull to every one

By Madeswaran N

Posted by Picasa

Common NFS errors & solutions

By Madeswaran N

Common NFS errors & solutions:

1."Server Not Responding" Message
2.  "Access Denied" Message
3."Permission Denied" Message
4.  "Device Busy" Message

Error 1: If You Receive an NFS "Server Not Responding" Message

ping the nfs server from client

1.ping "nfs serer name or ip"

2./usr/bin/rpcinfo -p servername

The rpcinfo command should display the following processes:

    * portmap
    * nfs
    * mountd
    * status
    * nlockmgr
    * llockmgr

If any of these processes is not running, follow the below steps:


a.Make sure the /etc/rc.config.d/nfsconf file on the NFS server contains the following lines:

NFS_SERVER=1
START_MOUNTD=1

b.Make sure that the /etc/inetd.conf file on the NFS server does not contain a line to start rpc.mountd.
If it does, make sure the START_MOUNTD variable in /etc/rc.config.d/nfsconf is set to 0.

c.Issue the following command on the NFS server to start all the necessary NFS processes:

#/sbin/init.d/nfs.server start

Error 2: If You Receive an "Access Denied" Message

a.check the FS is exported or not

#/usr/sbin/showmount -e server_name

(If it is not exported means u have to edit /etc/exports file in NFS server and put the necessary entry and
then run the command
/usr/sbin/exportfs -a)

Error 3 :If You Receive a "Permission Denied" Message

a.Check the mount options in the /etc/fstab file on the NFS client. A directory you are attempting to write to may have
been mounted read-only.

b.Issue the ls -l command to check the HP-UX permissions on the server directory and on the client directory
that is the mount point. You may not be allowed access to the directory.

c.Issue the following command on the NFS server:

/usr/sbin/exportfs

Or, issue the following command on the NFS client:

/usr/sbin/showmount -e server_name

d. Check the export permissions on the exported directory. The directory may have been exported read-only to your client.
The system administrator of the NFS server can use the remount mount
option to mount the directory read/write without unmounting it

Error 4 : If You Receive a "Device Busy" Message

a.If you received the "device busy" message while attempting to mount a directory, try to access the mounted directory.
  If you can access it, then it is already mounted.
 
b.If you received the "device busy" message while attempting to unmount a directory, a user or process is currently using the directory. Wait until the process completes, or follow these steps:
 
 1.Issue the following command to determine who is using the mounted directory:

       /usr/sbin/fuser -cu local_mount_point

   The fuser(1M) command will return a list of process IDs and user names that are currently using the directory
   mounted under local_mount_point. This will help you decide whether to kill the processes or wait for them to complete.

 2. To kill all processes using the mounted directory, issue the following command:

            /usr/sbin/fuser -ck local_mount_point

 3. Try again to unmount the directory.






Backup / Recover using tape in HP Unix

By Madeswaran N


HP-UX offers various commands  to backup file system,

a] dump / restore command (HFS filesystem only)

b] vxdump / vxrestore (vxfs filesystem only)

c] cpio command

d] fbackup / frecover command

e] dd command

f] tar command

g] make_net_recovery or make_tape_recovery commands


1. Backup /data directory to /dev/rmt/0m (tape drive)

# fbackup -i /data -I index.data -f /dev/rmt/0m


# -I index.data : index.data specifies the name of the on-line index file to be generated. It consists of one line for each file backed up during the session. Each line contains the file size, the volume number on which that file resides, and the file name. If the -I option is omitted, no index file is generated.
# -f /dev/rmt/0m : Specify tape device name
# -e /tmp : Exclude /tmp from backup
# -g /var/adm/fbackupfiles/hporabox11.backup.list.txt : File that contains a list of files / dirs to be included / excluded from the tape backup

Using the normal tape location to do a full backup but exclude /tmp and /cdrom /nfs directories, insert a new tape and enter:
# fbackup -f /dev/rmt/0m -i / -e /tmp -e /cdrom -e /nfs -v

2.To view contents of an fbackup tape

Type the following command:
# frecover -f /dev/rmt/0m -x -N -v

3.To verify the tape backup

# frecover -f /dev/rmt/0m -N


Restore from tape
=================

1.To restore all files and directories from tape, enter:
# frecover -f /dev/rmt/0m -r -v

2.To restore selected files or directories use -i /path option. For example, just restore /home/backuptest directory, enter:
# frecover -f /dev/rmt/0m -x -v -i /home/backuptest
    * -r : Recovery all data from tape
    * -x : Extracted / recover selected files / dires only specified by -i option
    * -i /path/to/file : Recover only this file or directory
    * -v : Verbose output



Recommendation before patching

By Madeswaran N

- Ensure you've done full dependency analysis on all the patches to be installed. The ITRC patch systems or swa should do all that for you now.

- Review the "special installation instructions" for all patches that you are to install.

- Ensure there are no unconfigured filesets on the system... something like this should return nothing:
swlist -l fileset -a state | sed -e '/^#.*$/d' -e '/^$/d' | grep -v configured

- ensure that you at least review a run of "swverify \*" - in general you don't need to worry too much about the WARNING levels, but you shoulkd always try and resolve the ERROR levels.

- if you have non-HP kernel filesets (such as EMC PowerPath or IBM atdd tape drivers), you should always review the patches you are installing, and the patch process with the relevant vendor.

- make sure you have run a "cleanup -d" on the dpot, so you don't have any superseded patches in it.
- always run a preview of the swinstall process and resolve *all* reported issues before proceeding
With those precautions in place you should really never encounter an unbootbale kernel as a result of patching.

Adding mirroring to the root vg - HP Unix

By Madeswaran N

  1. pvcreate -B /dev/rdisk/c2t2d0
    • Create the PV on the second disk so that LVM can manage it
    • -B makes it a bootable volume
  2. mkboot /dev/rdsk/c2t2d0
    • Installs the boot files on the second disk
  3. mkboot -a "hpux-lq (;0)/stand/vmunix" /dev/rdsk/c2t2d0
    • Creates an autoboot file on the disk, with information on how to boot
  4. vgextend /dev/vg00 /dev/dsk/c2t2d0
    • extends the volume group to include this second disk.
  5. vgdisplay -v vg00
    • To verify that the second disk is now part of the volume group
  6. lvlnboot -v
    • To verify that the system thinks this disk can boot
  7. lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
    • This extends the logical volume to the mirrored disk, effectively creating the mirrored copy.
    • This command needs to be run for each logical volume in the volume group

Add a Lun to a VG in a SG cluster 11.11/23

By Madeswaran N

Once disk presented to host,

# pvcreate /dev/rdsk/cxtxdx

# vgextend /dev/vgname /dev/dsk/cxtxdx

# lvcreate -L /dev/vgname/lvname

# newfs -F vxfs -o largefiles /dev/vgname/rlvname

# cp -p /etc/cmcluster/pkgname/pkg.cntl /etc/cmcluster/pkgname/pkg.cntl.org

# vi /etc/cmcluster/pkgname/pkg.cntl

LV[33]=/dev/vgname/lvname; FS[33]=/oracle/ABN/sapdata20; FSMOUNT_OPT[33]="-o convosync=direct,mincache=direct,delaylog,nodatainlog"

(Add newly create Logical volume to pkg.cnt.file)

# vgexport -p -s -v -m /tmp/vgname.map /dev/vgname

# rcp /tmp/vgname.map nodee2:/tmp/vgname.map

# cp -p /etc/cmcluster/pkgname/pkg.cntl /etc/cmcluster/pkgname/pkg.cntl.node2

# rcp /etc/cmcluster/pkgname/pkg.cntl.node2 nodee2:/tmp/

(mount the mount point manually on the node where the vg is active now)

# mount -o convosync=direct,mincache=direct,delaylog,nodatainlog /dev/vgname/lvolname /oracle/ABN/sapdata20

On Adoptive Node :-

# vgexport /dev/vgname

# mkdir /dev/vgname

# ll /dev/vg*/group

# mknode /dev/vgname/group c 64 0x0X0000

# vgimport -p -s -v -m /tmp/vgname.map /dev/vgname -> (preview) if no error proceed below by removing -p

# vgimport -s -v -m /tmp/vgname.map /dev/vgname

# cp /tmp/pkg.cntl.node2 /etc/cmcluster/pkgname

# cp -p /etc/cmcluster/pkgname/pkg.cntl /etc/cmcluster/pkgname/pkg.cntl.org

# mv /etc/cmcluster/pkgname/pkg.cntl.node2 /etc/cmcluster/pkgname/pkg.cntl


Extending a VxFS Filesystem (No Online JFS)

By Madeswaran N

Extending a VxFS Filesystem (No Online JFS)
  1. Verify that there is enough space in the volume group
    • vgdisplay <VG Name>
    • If there is not enough space then the volume group must be extended - see procedure below.
  2. First lvextend the logical volume - 2 Options for lvextend:
    1. lvextend -L <New Size in MB> /dev/VG_NAME/LV_NAME
    2. lvextend -l <NEW Size in # of LEs> /dev/VG_NAME/LV_NAME
  3. Unmount the filesystem
  4. extendfs -F vxfs /dev/<VG_Name>/r<LV_Name>
    • Note:  extendfs uses the raw logical volume name (ie rlvol1)

How to determine if you have Online JFS
  • swlist -l fileset | grep -i advanced
How to determine the filesystem type
  • grep <mount point> /etc/fstab
  • Results should show the filesystem type (vxfs or hfs) in the return string

Extending a VxFS Filesystem (Online JFS)

By Madeswaran N

  1. Verify that there is enough space in the volume group
    • Check the volume group for enough space
      • vgdisplay <VG Name>
    • Check the logical volume to determine if mirroring or striping is in effect
      • lvdisplay /dev/vg_name/lv_name
    • If there is not enough space then the volume group must be extended - see procedure below.
  2. First lvextend the logical volume - 2 Options for lvextend:
    1. lvextend -L <New Size in MB> /dev/VG_NAME/LV_NAME
    2. lvextend -l <NEW Size in # of LEs> /dev/VG_NAME/LV_NAME
  3. fsadm -F vxfs  -b <new size of filesystem in K> <MOUNT POINT>
    • NOTE:  extendfs will NOT work with Online JFS, you must use fsadm
    • NOTE:  new size of the filesystem = <# of LEs> * <LE Size in MB> * 1024
    • NOTE:  If lvextend -L was used simply multipy size in MB by 1024
    • NOTE:  If this FAILS with errno 28, then the filesystem is 100% full and must be reduced to less than 100%.
    • NOTE:  If this FAILS with "write failure at block XXXXXXXX : No such device or address" then the new size may be too big, use a smaller number

How to use swapoff in HP Unix

By Madeswaran N

# swapinfo -tam
Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev       12288       0   12288    0%       0       -    1  /dev/vg00/lvol2
reserve       -     391    -391
memory     1938     628    1310   32%
total     14226    1019   13207    7%       -       0    -
 
# lvcreate -L 1024 -n swap2 /dev/vg01
Logical volume "/dev/vg01/swap2" has been successfully created with
character device "/dev/vg01/rswap2".
Logical volume "/dev/vg01/swap2" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
 
# swapon -p 1 /dev/vg01/swap2
 
# swapinfo -tam
Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev       12288       0   12288    0%       0       -    1  /dev/vg00/lvol2
dev        1024       0    1024    0%       0       -    1  /dev/vg01/swap2
reserve       -     391    -391
memory     1938     628    1310   32%
total     15250    1019   14231    7%       -       0    -
 
# swapoff /dev/vg01/swap2
 
# swapinfo -tam
Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev       12288       0   12288    0%       0       -    1  /dev/vg00/lvol2
reserve       -     391    -391
memory     1938     628    1310   32%
total     14226    1019   13207    7%       -       0    -
 
# lvremove /dev/vg01/swap2
The logical volume "/dev/vg01/swap2" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vg01/swap2" has been successfully removed.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

Verify the latest standard patch bundles

By Madeswaran N

HP-UX 11i v1

# swlist -l bundle BUNDLE11i HWEnable11i GOLDBASE11i GOLDAPPS11i

HP-UX 11i v2

# swlist -l bundle BUNDLE11i HWEnable11i FEATURE11i QPKBASE QPKAPPS
 
HP-UX 11i v3
# swlist -l bundle BUNDLE11i HWEnable11i FEATURE11i QPKBASE
 
Verify latest available patches
 
After installing the latest standard patch bundles, that are delivered on a six month schedule, you need to check for the latest available patches for your products. Using any of the available tools to perform patch assestments of your systems will give you detailed information on the patches available.

Configure disk to use for veritas volume manager (VxVM)

By Madeswaran N

1. Detect new disk -> dfsadm, cfgadm -c configure control_number
2. Labeling disk -> format, choose disk number, label
3. Configure disks
# vxdisksetup -i disk_name
or using vxdiskadm -> choose 1. Add or initialize one or more disks
4. make diskgroup
# vxdg init dg_name disk_name=device_name
* vxdg init backupdg backupdg01=Disk_24
5. make volume
# vxassist -g backupdg maxsize
2096883712
# vxassist -g backupdg make backuplv 2096883712
*size=output from vxassist -g dg_name maxsize
6. Start volume
# vxvol -g backupdg startall
7. Make Filesystem
# mkfs -F vxfs /dev/vx/rdsk/backupdg/backuplv
8. Mounting Filesystem
# mkdir /backup
# mount -F vxfs /dev/vx/dsk/backupdg/backuplv /backup
9. Edit /etc/vfstab

Bootup/Shutdown in HP unix

By Madeswaran N

shutdown -r 0 –> reboot
shutdown -h now  –> shutdown and halt
shutdown 0 –> shutdown to single user mode
reboot 0 –> reboot
init 1 – single user mode
hpux -is  boots single user mode

Interupting the boot process:

  • Configuration Menu
  • Information Menu
  • Service Menu

GSP Mode

  • From the console hit <ctrl><b>
  • Hit <Enter> at the GSP console login (default is no password)
  • Now low level commands can be entered
    • ps  –> power status

To reboot to single user mode:

  1. shutdown -r 0
  2. hit <space> during 10 sec window to interrupt reboot
  3. enter: <b><o>
  4. interact with ipl? yes
  5. hpux -is  (i=init, s=single user)


Recover OS using Ignite Backup

By Madeswaran N


HP-UX have a software to backup the OS called "Ignite". It bundled with OS installed. The easy way to make a OS backup is using tape data cartridge. Just plug the tape to tape library, and run command "make_tape_recovery -AI".

To restore OS using recovery tape, go  MP (management processor) and boot to tape (Sequential media) and follow the intructions.

To simplify manage the archive of OS backup, we can utilize "Ignite Server". We can make OS backup to disk (via network) in another server (Ignite Server).The command is "make_net_recovery -s ignite_server -x inc_entire=vg00″.

To recovery OS using ignite server (Client and Ignite server in same IP subnet):

1. Boot the failed system to Ignite server (boot lan install or boot lan.ip_ignite_server install)
2. Do not interact with ISL
3. Select "Install HP-UX" and follow the instructions to fill about server configurations (network, hostname, etc)
4. Select recovery configurations to use
If clients to use is different subnet, we must use a boot helper server. the boot helper server have same subnet with client server. to setting up boot helper:
* for example: IP Ignite server is 10.2.2.1 & GW 10.2.2.254, OS to be restored is restore01 and target client is client01 (10.2.3.1 & GW 10.2.3.254)

1. Make sure the boot helper server have Ignite software with same version with client & Ignite server
2. Point the installation to Ignite server
# instl_adm -t 10.2.2.1
3. To verify the correct configuration in boot helper, run command instl_adm -d
4. Specify the temporary ip address at boot helper that client can use to boot. Edit /etc/opt/ignite/instl_boottab

5. Copy the CINDEX & recovery directory from source (OS to be restored) to target client (server use to restore).
at Ignite Server:
# cd /var/opt/ignite/clients/restore01
# find CINDEX recovery | cpio -pvdma ../client01
# edit CINDEX file at target client (/var/opt/ignite/clients/client01/CINDEX)
- make a full path for system_cfg, control_cfg & archive_cfg. (/var/opt/ignite/clients/client01/../…..)

6. Boot to boot helper or direct to ignite server


Windows XP, 2000 and 2003 Boot Process

By Madeswaran N

following are the booting files for xp ; boot.ini, ntldt, ntdetect.com, ntoskrnl.exe,bootdd.sys, bootsect.dos,hal.dll, system.

First there will be pre- boot sequence, it includes the following
1.POST(power on self test) first check for hardware
2.loads boot.ini, loads mbr.
3.mbr loads active partation
4ntldr loads o.s.


boot process:  first loads boot.ini, ntldr will be in boot.ini it loads os. boot.ini shows available os for selection, ntdetect.com check for hardware, ntoskrnl.exe loads drivers for devices.

Booting process are classified into 5 steps.

1.POST
2.The MBR reads the boot sector which is the first sector of the active partition.
3.Ntldr locket path of os from boot.ini
4.Ntldr to run ntdedetect.com to get information about installed hardware.
5.Ntldr reads the registry files then select a hardware profile, control set and  loads device drivers. 
6.After that Ntoskrnl.exe takes over and starts winlogon.exe which starts lsass.exe
   this is the program that display the welcome screen.


Difference between Windows XP Professional Edition and Windows XP Home Edition?

By Madeswaran N

What is the difference between Windows XP Professional Edition and Windows XP Home Edition?      


Although the XP Pro and Home Editions share the same common core code, they don't have the same features. The right version for you depends on the functionality you need.


Backup—XP Pro has the standard Win2K backup program; XP Home has no backup program.

Dynamic Disks—XP Pro supports dynamic disks; XP Home doesn't.


IIS—XP Pro includes IIS; XP Home doesn't.


Encrypted File System (EFS)—EFS debuted in Win2K and lets you encrypt files on an NTFS partition, a very useful feature for mobile machines. XP Pro includes EFS; XP Home doesn't.


Multiprocessor—XP Pro supports up to two processors; XP Home supports only one (as did Windows Me/Win98).

Remote Assistance—Both editions support Remote Assistance, which lets someone from a Help desk connect to the client desktop to troubleshoot problems.


Remote Desktop—XP Pro adds to Remote Assistance by letting any machine running a Terminal Services client run one Terminal Services session against an XP Pro machine.


Domain Membership—XP Pro systems can be domain members; XP Home systems can't, but they can access domain resources.

Group Policy—XP Pro supports group policies; XP Home doesn't.


IntelliMirror—XP Pro supports IntelliMirror, which includes Microsoft Remote Installation Services (RIS), software deployment, and user setting management; XP Home doesn't support IntelliMirror.

Upgrade from Windows Me/Win98—Both XP Pro and XP Home support this upgrade

Upgrade from Win2K/NT—Only XP Pro supports this upgrade.


64-bit Support—Only XP Pro will have a 64-bit version that supports the Itanium systems.

Network Support—XP Pro includes support for Network Monitor, SNMP, IP Security (IPSec), and the Client Services for NetWare (CSNW); XP Home doesn't. 


Clipboard Hack Problem - Shocking news about CTRL+C

By Madeswaran N

Clipboard Hack Problem - Shocking news about CTRL+C

Ctrl+C may be the most important work we do everyday. But it's not a very safe thing to do. Read on to know why. What happens when you press Ctrl+C while you are online. We do copy various data by Ctrl + C for pasting elsewhere. This copied data is stored in clipboard and is accessible from the net by a combination of Javascripts and ASP. This is called clipboard hack problem.

Just try this:

1. Copy any text by Ctrl + C
2. Click the Link: http://www.sourcecodesworld.com/special/clipboard.asp
3. You will see the text you copied was accessed by this web page.

Surprised!
I know you are because i was also surprised to see it. Do not keep sensitive data (like passwords, credit card numbers, PIN etc.) in the clipboard while surfing the web. It is extremely easy to extract the text stored in the clipboard to steal your sensitive information. Forward this information to as many friends as you can, to save them from online frauds!

It is true, text you last copied for pasting (copy & paste) can be stolen when you visit web sites using a combination of JavaScript and ASP (or PHP, or CGI) to write your possible sensitive data to a database on another server.

How Cipboard Hack is done?


The Clipboard hack is done by the following Source Code:

<script language="JavaScript">
var content = clipboardData.getData("Text");
alert(content);
</script>

How to safeguard yourself from Clipboard Hack Problem?


To avoid clipboard hack problem, do the following:
1. Go to internet options->security.
2. Press custom level.
3. In the security settings, select disable under Allow paste operations via script. (Scripting sub heading)

Now the contents of your clipboard are safe.

Interestingly, this hack works only on internet explorer, and not on Mozilla Firefox browser. Please forward this article to as many friends as you can to make them aware of this issue with CTRL+C.     

How to break mirror with two identical copies - HP unix

By Madeswaran N

Split LVs

Now all logical volumes in /dev/vg00 volume group are mirrored. It is time to split this mirror so we have two identical copies of our system. To make sure you don't loose any data this should be done only when all your applications are stopped.

# lvsplit -s bkp /dev/vg00/lv*
Logical volume "/dev/vg00/lvol1bkp" has been successfully created with
character device "/dev/vg00/rlvol1bkp".
Logical volume "/dev/vg00/lvol1" has been successfully split.
--(text cut)--
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

With this we have split every logical volume to the original and copy with 'bkp' sufix. For example, lvol1 and lvol1bkp, lvol2 and lvol2bkp, and so on. In case of a problem after patching we will use 'bkp' logical volumes.

After splitting, new logical volumes (ones with the 'bkp' suffix) needs to be checked with the fsck for consistency.

# for i in /dev/vg00/lv*bkp; do fsck -F $(fstyp $i) $i; done
log replay in progress
replay complete - marking super-block as CLEAN
unknown_fstyp (no matches)
fsck: invalid argument to "-F FStype" option
fsck: /dev/vg00/lvol2bkp is not a valid file system type
usage: fsck [-F FStype] [-V] [-m] [special...]
or fsck [-F FStype] [-V] [-m] [-o specific_options] [special...]
log replay in progress
replay complete - marking super-block as CLEAN
--(text cut)--

Do not worry about that error we got there. It is because we tried to fsck SWAP filesystem.


How to remove a boot mirror disk on Integrity / Itanium servers

By Madeswaran N


 

PROBLEM

 

How to remove a functional mirror disk from the boot / root mirror configuration.

 

This document provides steps to remove a functional mirror disk from an LVM boot

disk configuration.

 

These steps apply to Integrity / Itanium based HP-UX systems ONLY.

 

CONFIGURATION

 

Integrity servers

rx1600 rx1620

rx2600 rx2620

rx4640 bl60p

rx7620 rx7640

rx8620 rx8640

 

 

RESOLUTION

 

Example disk to be removed from a mirror set:

c2t1d0s2

 

1. lvreduce -m 0 /dev/vg00/lvol1 /dev/dsk/c2t1d0s2

 

2. vgreduce /dev/vg00 /dev/dsk/c2t1d0s2

 

 

Safety checks :

 

# vgdisplay -v /dev/vg00 | grep c2t1d0

Should not return anything

 

# strings /etc/lvmtab

Ensure that c2t1d0 or s2 device is not listed.

 

# lvlnboot -v

Ensure no errors and that c2t1d0 is no longer listed.

 

 

3. Steps to remove EFI disk partitions :

 

# idisk -wR /dev/rdsk/c2t1d0

 

NOTE: This is destructive, ensure specify correct disk !

Note the use or rdsk device and whole disk device file.

 

4. Remove the special device files which are no longer used.

 

# rmsf /dev/rdsk/c2t1d0s1

# rmsf /dev/rdsk/c2t1d0s2

# rmsf /dev/rdsk/c2t1d0s3

 

# rmsf /dev/dsk/c2t1d0s1

# rmsf /dev/dsk/c2t1d0s2

# rmsf /dev/dsk/c2t1d0s3

 

 

Use pvcreate or pvcreate -f to format the disk for LVM usage and create or

extend the disk into a volume group.


Route add in HP Unix

By Madeswaran N

Let us assume your router address is 192.168.1.254 and network ID is 192.168.1.0/24, then you can type route command as follows:
# route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.254

OR

To add a default route:
# route add default 192.168.1.254

Verify that (display) routing table is updated (display routing table):
# netstat -nr

Test it i.e. try to ping or send nslookup request:
# ping mycorp.com

To flush all routing entries use command [quite handy to clean your gordian knot ;)] :
# route -f

However if I reboot HPUX box then above routing entries gets removed. To pick up your setting upon each reboot your need to configure Routes in HPUX networking configuration file - /etc/rc.config.d/netconf. To add default router/gateway 192.168.1.254:


# vi /etc/rc.config.d/netconf

Add or modify following entries

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

Reboot HP-UX system/server to take effect


# shutdown -ry 0


HP UNIX - Device file name conversion

By Madeswaran N

Both HP-UX and Sun Solars uses almost same device file naming convention. Typically it look like as follows:

c#t#d#

Let us try to understand what those letters

  • c - Instance number of interface card
  • t - SCSI target address
  • d - Device number aka SCSI LUN

Use ioscan command to get information about your device under HP-UX. A block device file is always in /dev/dsk and a character device file in /dev/rdsk directory.

  • /dev/dsk/c0t5d0 - Block device file
  • /dev/rdsk/c0t5d0 - Raw device file