Archive for the ‘Linux OS’ Category

Change Solaris Zones Configurations Online

May 29th, 2022, posted in Solaris
Share
I assume you are aware that Solaris Zones are one of the most valuable features of Solaris since years. In this post I focus on the “Live Zone Reconfiguration” feature available since
Solaris 11.2 for Solaris Zones and since Solaris 11.3 for Kernel Zones. CPU pools, filesystems, network and disk configurations can be changed while Solaris Zones are running.

1. Limit CPU usage of a Solaris Zone using dedicated-cpu

By default Solaris Zones share the CPUs with the global and all other local Zones.
Our sample Zone currently uses 16 virtual CPUs.

# zlogin v0131 psrinfo | wc -l
16

 

We can now assign 4 dedicated virtual CPUs to be used by this Zone only.
# zonecfg -z v0131 -r "add dedicated-cpu; set ncpus=4; end"

zone 'v0131': Checking: Adding dedicated-cpu

zone 'v0131': Applying the changes

# zlogin v0131 psrinfo | wc -l
4

 

The “zonecfg -r” changes the configuration of the running Zone only.
Make sure to run the command once again to make the configuration persistent for the next Zone reboot.
# zonecfg -z v0131 "add dedicated-cpu; set ncpus=4; end"

 

2. Create and mount an additional ZFS filesystem
# zfs create v0131_data/myapp

# zonecfg -z v0131 -r "add fs; set type=zfs; set dir=/myapp; set special=v0131_data/myapp; end"

zone 'v0131': Checking: Mounting fs dir=/myapp

zone 'v0131': Applying the changes

# zlogin v0131 mount | grep myapp

/myapp on /myapp read/write/setuid/devices/rstchown/nonbmand/exec/xattr/atime/zone=v0131/nozonemod/sharezone=4/dev=d50045 on Fri Jun 10 11:56:19 2016

 

And make it persistent
# zonecfg -z v0131 "add fs; set type=zfs; set dir=/myapp; set special=v0131_data/myapp; end"
Adding network interfaces and disk devices are similar to the samples above.
Share

Last Command Examples For Linux And Unix

May 8th, 2022, posted in Solaris
Share

How to find out last logins of users and times informations on Linux/Unix-like operating systems ?

You need to use the last command to show who has recently used the server and logged in and out date/time.

 

The last command reads listing of last logged in users from the system file called /var/log/wtmp or the file designated by the -f options.

Purpose

To find out when a particular user last logged in to the Linux or Unix server.

Syntax

The basic syntax is:

last
last [userNameHere] last [tty] last [options] [userNameHere]

If no options provided last command displays a list of all users logged in (and out) since /var/log/wtmp file was created. You can filter out results by supplying names of users and tty’s to show only those entries matching the username/tty.

last command examples

To find out who has recently logged in and out on your server, type:
$ last
Sample outputs:

root     pts/1        10.1.6.120       Tue Jan 28 05:59   still logged in   
root     pts/0        10.1.6.120       Tue Jan 28 04:08   still logged in   
root     pts/0        10.1.6.120       Sat Jan 25 06:33 - 08:55  (02:22)    
root     pts/1        10.1.6.120       Thu Jan 23 14:47 - 14:51  (00:03)    
root     pts/0        10.1.6.120       Thu Jan 23 13:02 - 14:51  (01:48)    
root     pts/0        10.1.6.120       Tue Jan  7 12:02 - 12:38  (00:35)    
 
wtmp begins Tue Jan  7 12:02:54 2014

You can specifies a file to search other than /var/log/wtmp using -f option. For example, search /nas/server/webserver/.log/wtmp:
$ last -f /nas/server/webserver/.log/wtmp
last -f /nas/server/webserver/.log/wtmp userNameHere

List all users last logged in/out time

last command searches back through the file /var/log/wtmp file and the output may go back to several months. Just use the less command or more command as follows to display output one screen at a time:
$ last | more
last | less

List a particular user last logged in

To find out when user vivek last logged in, type:
$ last vivek
$ last vivek | less
$ last vivek | grep 'Thu Jan 23'


Sample outputs:

Fig. 01 Displaying out when user vivek last logged in on server

Fig. 01 Displaying out when user vivek last logged in on server

Share

Oracle Solaris Includes Ksplice

April 8th, 2022, posted in Solaris
Share

Look what we have here :

-bash-5.0$ pkg list ksplice
NAME (PUBLISHER)     VERSION                    IFO
system/ksplice       11.4-11.4.29.0.1.82.3      i--

 

Ksplice supports online Kernel Updates.

Oracle Support delivers in rare cases of Kernel issues
an IDR which are installed online using ksplice.

For a Solaris Admin such an IDR is handled like other IDRs.
It can be installed as usual with the pkg command.

 

Here a sample:

# pkg info -g ./idr4712.1.p5p idr4712
          Name: idr4712
       Summary: To back out This IDR : # /usr/bin/pkg uninstall -r idr4712
   Description: sparc IDR built for release : Solaris 11.4 SRU # 29.82.3
         State: Not installed
     Publisher: solaris
       Version: 1
        Branch: None
Packaging Date: February 12, 2021 at 10:22:38 AM
          Size: 4.08 kB
          FMRI: pkg://solaris/[email protected]:20210212T102238Z


-bash-5.0$ pkg list -g ./idr4712.1.p5p -af
NAME (PUBLISHER)         VERSION                      IFO
idr4712                  1                            ---
system/kernel/platform   11.4-11.4.29.0.1.82.3.4712.1 ---
system/ksplice           11.4-11.4.29.0.1.82.3.4712.1 ---
system/osnet-splice      11.4-11.4.29.0.1.82.3.4712.1 ---


# pkg set-publisher -g file:///var/tmp/idr4712.1.p5p solaris

# pkg install idr4712
          Packages to install:   2
            Packages to update:   2
            Services to change:   3
       Create boot environment:  No
Create backup boot environment: Yes
..
..
..

Using spliceadm you can verify the installed splices.

# spliceadm
ID        STATE        CVE             BUGID
471201    applied      N/A             32407818

 

in case of a problem you can even revert the fix

# spliceadm reverse 471201
Splice 471201 reversed successfully on Fri Apr 23 13:15:20.

# spliceadm status
ID        STATE        CVE             BUGID
471201    not-applied  N/A             32407818

 

Another powerful and easy to use Solaris Feature

Share

How Adjust Time Quickly at Boot on Solaris Servers

March 20th, 2022, posted in Solaris
Share

On Solaris 11.4 NTP does update the time after boot.
By default this can take a few minutes, because the NTP client
waits for a few reply’s of the NTP servers.

To update the time quickly it is recommended to use the ‘burst iburst’
flags in the ntp.conf

server <ntpserverip> burst iburst

Using this configuration NTP adjusts the time a few seconds after start.
This is an important configuration if you start your apps or databases automatically.

Share

SWAP size Adding While installing a Oracle Database 19c on Oracle Linux

January 30th, 2022, posted in Oracle, Solaris
Share

SWAP size Adding While installing a Oracle Database 19c on Oracle Linux,SWAP size Adding,installing a Oracle Database 19c,Oracle Linux,Oracle,Linux

SWAP Size Adding  size while installing a Oracle Database 19c on Oracle Linux

Below is the error message I received while I was trying to install Oracle Database 19c on Oracle Linux 7.

PRVF-7573 : Sufficient swap size is not available on node

As per my error on the installer screen I needed 16GB of SWAP space where as my system has just 4GB. So I need to add a swap file for the installation to continue. 

Below steps will outline the steps for the same.

dd if=/dev/sdb of=/tmp/swap01 bs=1K count=16M
chmod 600 /tmp/swap01
mkswap /tmp/swap01
swapon /tmp/swap01

Make sure the bs (*) count is equal to your required SWAP space. Also, the /dev/sdb has enough storage as needed

Share