Saturday, July 30, 2011

How to find Linux version ?

Bookmark and Share

Most of the times when we say a Linux version then we are referring to the specific Linux distributions…such as Red Hat, SuSe, Debian, Ubuntu etc.

Below are the CLIs that list their distribution specific Linux versions.

On Red Hat Linux Distribution:

# cat /etc/redhat-release

On Novell SuSe Linux Distribution:

# cat /etc/SuSE-release

On Debian Linux Distribution:

# cat /etc/debian_version

On Ubuntu Linux Distribution:

# lsb_release –a

# cat /etc/lsb-release

The contents of these files shouldn’t be changed or altered since different server softwares such as Oracle database refer to those files to decide their own compatibility. Sometimes /etc/issue or /etc/issue.net is also referred for their contents. However, it is not reliable since it is overwritten on some distributions during system boot.

To find exact Linux kernel version installed on the machine, following CLIs can be used…

# uname –a
Linux linux-bk6098 2.6.34.8-0.2-default #1 SMP 2011-04-06 18:11:26 +0200 i686 i686 i386 GNU/Linux

# cat /proc/version
Linux version 2.6.34.8-0.2-default (geeko@buildhost) (gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) ) #1 SMP 2011-04-06 18:11:26 +0200

If you know any Linux distribution that differs from above CLI for determining their version then do post your comments below.


Monday, July 25, 2011

HP-UX disk mapping between persistent and legacy DSF

Bookmark and Share

Below cli lists all mapping between legacy and agile DSF for storage attached to HP-UX server.

# ioscan -m dsf
Persistent DSF           Legacy DSF(s)
========================================
/dev/rdisk/disk1         /dev/rdsk/c0t0d0
/dev/rdisk/disk1_p1      /dev/rdsk/c0t0d0s1
/dev/rdisk/disk1_p2      /dev/rdsk/c0t0d0s2
/dev/rdisk/disk1_p3      /dev/rdsk/c0t0d0s3


HP-UX kernel : 32 bit or 64 bit ?

Bookmark and Share

Below is the CLI to identify kernel bits on HP-UX,

# getconf KERNLE_BITS
64   <---for 64 bit kernel  or
32   <---for 32 bit kernel

Another alternate way to find out the same is...

# print_manifest | grep -i "OS mode"
    OS mode:            64 bit

Identifying Processor support…

# getconf HW_CPU_SUPP_BITS
64

# getconf HW_32_64_CAPABLE
1

and it works! :)


Wednesday, July 13, 2011

Create single HP-UX tape .depot from multiple HP-UX depots

Bookmark and Share

I was looking for a way to create .depot file on HP-UX and CLI swpackage came to rescue.

Below is the CLI for creating single tape .depot file from multiple software depots.

Assumption: Your depot packages are in current directory

# /usr/sbin/swpackage -x target_type=tape -s `pwd` -d `pwd`/YourPackages.depot "YourPackages"

Is there any other way to create .depot package on HP-UX? Do let everyone know in comments below.

 




Technology