Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Thursday 21 December 2017

Multipath command with an examples

In linux operating system device mapping through multipath is widely used. Here, we can give you some example how we will use the multipath commands in Linux server

➤ Normally multipath device has a Word Wide Identifier (WWID), which is globally unique and unchanging.

➤ When new devices are brought under the control of DM-Multipath, the new devices may be seen in three different places under the /dev directory: /dev/mapper/mpathn, /dev/mpath/mpathn, and /dev/dm-n

➤ The devices in /dev/mapper are created early in the boot process. Use these devices to access the multipathed devices, for example when creating logical volumes.
The devices in /dev/mpath are provided as a convenience so that all multipathed devices can be seen in one directory. These devices are created by the udev device manager and may not be available on startup when the system needs to access them.

Note: Do not use these devices for creating logical volumes or filesystems

➤ Any devices of the form /dev/dm-n are for internal use only and should never be used.

Please find the multipath syntax which we used in the Linux operating system.


l    -> Display the current multipath configuration gathered from sysfs and the device mapper.
ll  -> Display the current multipath configuration gathered from sysfs, the device mapper, and all other available components on the system.
f    -> Remove the named multipath device.
F   -> Remove all unused multipath devices.
v   ->  Verbosity level
          . 0 no output
          . 1 print created devmap names only
          . 2 default verbosity
          . 3 print debug information
d   -> Dry run, do not create or update devmaps
r    -> Force devmap reload

⧪ How to display the current multipath configuration with all information.

[root@localhost~]# multipath -ll
Dec 21 11:27:17 | multipath.conf line 35, invalid keyword: selector
mpathf (3600c0ff00019e9e9dc94c25801000000) dm-6 HP,MSA 2040 SAN
size=466G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=70 status=active
  |- 1:0:0:4 sdg 8:96 active ready running
  |- 2:0:0:4 sdj 8:144 active ready running
  |- 1:0:1:4 sdq 65:0 active ready running
  `- 2:0:1:4 sdt 65:48 active ready running

⧪ How to remove multipath devices with multipath Command

[root@localhost~]# multipath -f mpathf

Note: if we use -F option then it is remove all unused devices.

⧪ How to Force reload device map with multipath Command

[root@localhost~]# multipath -r

Saturday 24 June 2017

Sun Solaris zonecfg commands with an example

"zonecfg" command is very useful command which is mostly used during configuration of new zone or installed zone as well as for removal of any zone configuration files.

This command are valid for Sun Solaris 10.x,11.x,12.x version.

➤ Command for creating a Solaris zone:

Please find the below commands to creating a zone on Sun Solaris server. The command must be run on Global zone with root user.

!-[solaris]# zonecfg -z <zone>

Example: !-[solaris]# zonecfg -z sunz01

Once you run the above command, you can enter in the configuration file, where you can add or edit the configuration for the zone.

Command for deleting a Solaris zone:

Please find the below command to deleting a Solaris zone from Global zone.

!-[solaris]# zonecfg -z <zone> delete -F

Example: !-[solaris]# zonecfg -z sunz01 delete -F

using above command you can delete or remove the configuration file of solaris local zone.

Note: You need to shutdown and uninstall the local zone before deleting the configuration files of Sun Solaris local zone.

Command for display zone current configuration:

Please find the below command to display the current configuration of local Solaris zones.

!-[solaris]# zonecfg -z <zone> info

Example: !-[solaris]#zonecfg -z sunz01 info

This command output show you the zonename, zonepath, autoboot etc attributes information of the solaris zone.

Command for zone creation file:

Please find the below command to create a solaris zone creation file.

!-[solaris]#zonecfg -z <zone> export

Example: !-[solaris]#zonecfg -z sun01 export

Once the creation file has been export you can use this file to another zone creation as well as for restoration of this local zone if any problem occur on this zone.

Sunday 18 June 2017

Sun Solaris Processes Monitoring - prstat command

"PRSTAT" command basically used for monitoring the current memory and CPU utilization of Sun solaris local zones and global zone.

Using "prstat" command we can display the solaris zone process information. This command generate the reports information about the processes and zones.

The prstat statistics utility shows a summary of the processes that are using system resources currently. The prstat utility summarizes this information for an every 5 seconds by default and reports the statistics for that period.

Display the zones process information:

!-[solaris]# prstat -Z

 PID USERNAME  SIZE   RSS STATE   PRI NICE      TIME  CPU PROCESS/NLWP
 18638 20159    2118M 1502M cpu43    10    0   0:00:44 2.4% oracle/7
 20927 24076    8784K 8136K cpu127    0    2   0:00:17 1.8% prstat/1
   897 24865     916M  512M sleep    59    0  27:52:32 0.7% java/95
 17511 26055     599M  285M sleep    59    0  35:08:33 0.6% java/115
 12540 26055     951M  341M sleep    59    0  31:00:01 0.5% java/101

 ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     8     3427   73G   27G    21%  44:01:48 2.8% sunz01
     0      100  465M  132M   0.1% 507:26:46 2.6% global
     6     4056   86G   32G    25%  35:23:30 2.3% sunz02    
Total: 13382 processes, 36594 lwps, load averages: 9.11, 9.27, 9.47

Using above command "prstat -Z" we can monitor the server process utilization in every 5 second. This command is show you the global zone & their local zone process utilization only.

If you want to only specific zone process utilization then you can use the below command.

!-[solaris]# prstat -z sun01

This command output show you only process utilization of specific zone only.

Note:

-Z Reports information about processes and zones.
-z Reports information about a particular zone.

You can use the below syntax to monitor the Global zone as well as only specific zone.

Monday 22 May 2017

Basic HP-UX Commands for Logical Volume Manager (LVM)

This post is useful for those users which are beginners on HP-UX platform. They can easily find all the basic command which are required for creation a file system using logical volume manager (LVM).

Concept of LVM are same in all Unix operating system. LVM is basically used for disk management in operating system that allow to manager the physical disks and logical volume. Here, I will provide to you all basic HP-UX commands.

Basic Commands of HP-UX LVM: 

⏩ How to create a new volume group, logical volume and file system on HP-UX operating system
 
For creating a new physical volume group on HP-UX system, please use the below method.

hpx:/>pvcreate /dev/rdsk/c2t1d1

"Pvcreate" command is used for creating a physical volume on operating system.
⏩ How to create a volume group on HP-UX operating system.

For creating a volume group, first we need to create a directory which we used as a volume group. In my case I will use my volume group name "vstorage" so I need to create a directory with name of vstorage.

hpx:/>mkdir /dev/vstorage
hpx:/>mknod /dev/vstorage/group c 64 0x010000

Once you create a directory, then please create a new volume group with the available disk c2t1d1.

hpx:/>vgcreate /dev/vstorage /dev/dsk/c2t1d1

⏩ How to create a logical group on HP-UX operating system.

When you successfully create a new volume group "vstorage" as describe in above step, we will create a logical group as describe below.

hpx:/>lvcreate -L 2048 /dev/vstorage

If you see the above command we have created a 2 GB size of logical volume.

⏩ How to create a filesystem on HP-UX operating system.

When you successfully created a new logical volume group, then we will create a new file system with the help of VG and LV.

Please find the below command to create a filesystem on HP-UX operating system using LVM.

hpx:/>newfs -F vxfs -o largefiles /dev/vstorage/vg_vstorage

Note: Here, we used "vstorage" as a VG and vg_vstorage as a LV. Now we will create a directory where we mount the new LV.

hpx:/>mkdir /hpux
hpx:/>mount /dev/vstorage/vg_vstorage /hpux

Now, your new file system "/hpux" has been created with the help of LVM. You can mount the file system permanently in filesystem configuration file, so once you take a reboot of server, your file system will not disappear.

Please comment on the post, if you are facing any issue regarding this topic.