Archive for the ‘Linux OS’ Category

Creating Partition Space In Sun Solaris 10

November 3rd, 2019, posted in Solaris
Share

Open  console and start with this :Oracle Database,DBA immam,DBA imam,oracle issues,oracle database,oracle clone issues,oracle clone,oracle autoconfig,oracle autoconfig issues

bash-3.00# format

It gives the following output.

Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
Specify disk (enter its number):


Check out, AVAILABLE DISK SELECTIONS. Now, I have only one disk (c0d0). Select the ‘0’ (Zero) no. disk to make partitioned in it.

Specify disk (enter its number): 0

It will give the following output.

selecting c0d0
Controller working list found
[disk formatted, defect list found]
Warning: Current Disk has mounted partitions.
/dev/dsk/c0d0s0 is currently mounted on /. Please see umount(1M).
/dev/dsk/c0d0s1 is currently used by swap. Please see swap(1M).
/dev/dsk/c0d0s3 is currently mounted on /mytest. Please see umount(1M).
FORMAT MENU:
disk          – select a disk
type         – select (define) a disk type
partition – select (define) a partition table
current    – describe the current disk
format     –  format and analyze the disk
fdisk         – run the fdisk program
repair      – repair a defective sector
show       – translate a disk address
label       – write label to the disk
analyze – surface analysis
defect    – defect list management
backup   – search for backup labels
verify     – read and display labels
save        – save new disk/partition definitions
volname – set 8-character volume name
!<cmd> – execute <cmd>, then return
quit
format>

Now enter ‘p’ (Partition) to initiate partitioning procedure in it.

format> p

It will give following output :

PARTITION MENU:
0 – change `0′ partition
1 – change `1′ partition
2 – change `2′ partition
3 – change `3′ partition
4 – change `4′ partition
5 – change `5′ partition
6 – change `6′ partition
7 – change `7′ partition
select – select a predefined table
modify – modify a predefined partition table
name – name the current table
print – display the current table
label – write partition map and label to the disk
!<cmd> – execute <cmd>, then return
quit
partition>

To see existing partitions, issue ‘p’ (print).

partition> p

It will give following output.

Current partition table (original):
Total disk cylinders available: 2085 + 2 (reserved cylinders)

Part      Tag     Flag      Cylinders         Size               Blocks
0       root    wm       3 – 1308       10.00GB          (1306/0/0)     20980890
1       swap    wu    1309 – 1570        2.01GB          (262/0/0)       4209030
2     backup    wm       0 – 2084       15.97GB         (2085/0/0)    33495525
3 unassigned    wu    1571 – 1672      800.11MB    (102/0/0)   1638630
4 unassigned    wm                     0               0                      (0/0/0)           0
5 unassigned    wm                     0               0                      (0/0/0)           0
6 unassigned    wm                     0               0                      (0/0/0)           0
7 unassigned    wm                     0               0                      (0/0/0)           0
8       boot    wu                          0 –    0        7.84MB    (1/0/0)       16065
9 alternates    wu                     1 –    2       15.69MB    (2/0/0)       32130

partition>

Checkout the table. No 0, 1, 2,8 and 9 is not usable. no. 3 is not usable as already created a partition there. 4,5,6 and 7 is available to make partition. So, I have selected 4.

partition> 4

It will give following output :

Part      Tag           Flag     Cylinders        Size            Blocks
4 unassigned    wm       0               0         (0/0/0)           0

Enter partition id tag[unassigned]:

Keep partition id and permission flags empty.

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:

Now, check previous partition of no. 4. It is number 3. Its Cylinders count ended at 1672. So, we will start from 1673. (If there is no no. 3 that i created previously, then we would have look for part no. 1. Not 2, because it is not usable, it represents whole disk size).

Now enter 1673

Enter new starting cyl[0]: 1673

and partition size 500mb.

Enter partition size[0b, 0c, 1673e, 0.00mb, 0.00gb]: 500mb

Now enter ‘label’ to confirm your partition.

partition> label
Ready to label disk, continue? y

Now, again see your partitioning summary.

partition> p
Current partition table (unnamed):
Total disk cylinders available: 2085 + 2 (reserved cylinders)

Part      Tag     Flag      Cylinders         Size               Blocks
0       root    wm       3 – 1308       10.00GB          (1306/0/0)     20980890
1       swap    wu    1309 – 1570        2.01GB          (262/0/0)       4209030
2     backup    wm       0 – 2084       15.97GB         (2085/0/0)    33495525
3 unassigned    wu    1571 – 1672      800.11MB    (102/0/0)   1638630
4 unassigned      wm    1673 – 1736     502.03MB   (64/0/0) 1028160
5 unassigned    wm                     0               0                      (0/0/0)           0
6 unassigned    wm                     0               0                      (0/0/0)           0
7 unassigned    wm                     0               0                      (0/0/0)           0
8       boot    wu                          0 –    0        7.84MB    (1/0/0)       16065
9 alternates    wu                     1 –    2       15.69MB    (2/0/0)       32130

Well, its done.

Now, issue ‘q’ to exit partition and again ‘q’ to exit format.

partition> q
FORMAT MENU:
disk – select a disk
type – select (define) a disk type
partition – select (define) a partition table
current – describe the current disk
format – format and analyze the disk
fdisk – run the fdisk program
repair – repair a defective sector
show – translate a disk address
label – write label to the disk
analyze – surface analysis
defect – defect list management
backup – search for backup labels
verify – read and display labels
save – save new disk/partition definitions
volname – set 8-character volume name
!<cmd> – execute <cmd>, then return
quit
format> q
bash-3.00#

Then, format file system.

bash-3.00# newfs /dev/rdsk/c0d0s4

Result :

bash-3.00# newfs /dev/rdsk/c0d0s4
newfs: construct a new file system /dev/rdsk/c0d0s4: (y/n)? y
Warning: 4032 sector(s) in last cylinder unallocated
/dev/rdsk/c0d0s4:           1028160 sectors in 168 cylinders of 48 tracks, 128 sectors
502.0MB in 13 cyl groups (13 c/g, 39.00MB/g, 18624 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 80032, 160032, 240032, 320032, 400032, 480032, 560032, 640032, 720032,
800032, 880032, 960032

Now, we have to mount this partition.

Create a directory in root directory.

bash-3.00# cd /
bash-3.00# mkdir oracle

Our partition is at ‘/dev/dsk/c0d0s4’. We will mount it to previously created oracle directory.

bash-3.00# mount /dev/dsk/c0d0s4 /oracle

Check newly created partition.

bash-3.00# cd /oracle/
bash-3.00# ls
lost+found
bash-3.00# df -h
Filesystem                         size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        9.9G   3.4G   6.4G    35%    /
/devices                             0K     0K     0K     0%    /devices
ctfs                                 0K     0K     0K     0%    /system/contract
proc                                 0K     0K     0K     0%    /proc
mnttab                               0K     0K     0K     0%    /etc/mnttab
swap                               2.3G   548K   2.3G     1%    /etc/svc/volatile
objfs                                0K     0K     0K     0%    /system/object
sharefs                              0K     0K     0K     0%    /etc/dfs/sharetab
fd                                   0K     0K     0K     0%    /dev/fd
swap                               2.3G   136K   2.3G     1%    /tmp
swap                               2.3G    32K   2.3G     1%    /var/run
/dev/dsk/c0d0s3        752M   1.0M   698M     1%    /mytest
/dev/dsk/c0d0s4        472M   1.0M   424M     1%    /oracle
bash-3.00#

To make it permanent. you need to edit the file ( /etc/vfstab ) {stands for Virtual File System Table} using command:

vi /etc/vfstab

now : enter your new partition information in the last line device to mount device

/dev/dsk/c0d0s4 /dev/rdsk/c0d0s4 /oracle ufs 1 yes –
Share

How To Add-Remove Vdisk From Guest LDOMS

September 8th, 2019, posted in Solaris
Share

I’ll share the simple steps needed to add and remove a virtual disk in a running domain without any outage.
This is a system running Oracle VM Server for SPARC 3.1 with a Solaris 11.1 guest domain named ldom0.
I used NFS storage because it is easy to set up and lets me use live migration.

 

Adding a virtual disk to a running domain

The entire sequence of commands in the control domain defines, adds and removes a disk while the guest domain runs:

# mkfile -n 20g  /ldomsnfs/ldom0/disk1.img       # 1. create a disk image file
# ldm add-vdsdev /ldomsnfs/ldom0/disk1.img vol01@primary-vds0 # 2. define vdisk
# ldm add-vdisk vdisk01 vol01@primary-vds0 ldom0 # 3. add disk to the domain
# ldm rm-vdisk vdisk01 ldom0                     # 4. take it away from the domain.
# ldm rm-vdsdev vol01@primary-vds0               # 5. undefine the virtual disk
# rm disk1.img                                   # 6. save a little space.

That’s all there is to it. The new disk is available for the domain’s use after step 3 until I take it away in step 4.

 

Viewing reconfiguration from within the guest

Let’s take a look from the guest domain’s perspective.
In the guest, you can see one disk before adding more (before command 3, above) via the formatcommand:

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c3d1 
          /virtual-devices@100/channel-devices@200/disk@1
Specify disk (enter its number): ^C

There’s one disk until ldm add-vdisk is issued in the control domain.
That results in a dynamic reconfiguration event that can be seen, if you are curious, by entering dmesg within the guest:

# dmesg|tail
...snip...
Nov 20 12:03:23 ldom0 vdc: [ID 625787 kern.info] vdisk@0 is online using ldc@16,0
Nov 20 12:03:23 ldom0 cnex: [ID 799930 kern.info] channel-device: vdc0
Nov 20 12:03:23 ldom0 genunix: [ID 936769 kern.info] vdc0 is /virtual-devices@100/channel-devices@200/disk@0
Nov 20 12:03:23 ldom0 genunix: [ID 408114 kern.info] /virtual-devices@100/channel-devices@200/disk@0 (vdc0) online

You can see the added disk using format and then use it. In this case I created a temporary ZFS pool.

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c3d0 
          /virtual-devices@100/channel-devices@200/disk@0
       1. c3d1 
          /virtual-devices@100/channel-devices@200/disk@1
Specify disk (enter its number): ^C
# zpool create temp c3d0
# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  19.9G  5.27G  14.6G  26%  1.00x  ONLINE  -
temp   19.9G   112K  19.9G   0%  1.00x  ONLINE  -

At this point I can just go ahead and use the added disk space. I could have done other things like add it to the existing ZFS pool
to make it a mirror, but this illustrates the point.

 

What happens if I try to remove an in-use disk

It could be very damaging to remove a virtual device while it is in use, so the default behavior
is that Solaris tells logical domains manager that the device is in use and cannot be removed.
That’s a very important advantage of Oracle VM Server for SPARC: the logical domains framework and Solaris work cooperatively,
in this and many other aspects.

In this case, we’re prevented from yanking a disk while it is in use.
If I try to remove the disk while it’s in use, I get an error message – exactly what you want:

# ldm rm-vdisk vdisk01 ldom0
Dynamic reconfiguration of the virtual device on domain ldom0
failed with error code (-122).
The OS on domain ldom0 did not report a reason for the failure.
Check the logs on that OS instance for any further information.
Failed to remove vdisk instance

The reason is “because it’s in use!” 🙂 An administrator would log into the guest to see what file systems are mounted.
This behavior can be overridden using the “-f” option if you are certain
you know what you’re doing.

Removing the disk

I issued zpool destroy temp in the guest and repeated the ldm rm-vdsdev and it worked.
Using zpool export temp would work just as well, and if I choose I can add that virtual disk to a different
domain and it could use zpool import temp to access data created by ldom0.
With other file systems, a regular umount would have the same effect, making it possible to remove the disk without -f.

The format command now shows only one disk again, and dmesg shows kernel messages when disk went offline:

Nov 20 12:42:10 ldom0 vdc: [ID 990228 kern.info] vdisk@0 is offline
Nov 20 12:42:10 ldom0 genunix: [ID 408114 kern.info] /virtual-devices@100/channel-devices@200/disk@0 (vdc0) offline

 

Summary

Solaris and the logical domain manager are engineered to work together in a coordinated fashion
to provide operational flexibility.
One of the values this provides is that
administrators can safely add and remove virtual devices while domains run.
This can be used for operational tasks like adding or removing disk capacity or IOPS as needed.
The same capabilities are also available for virtual network devices.

Share

Show Faulted Hardware in ILOM

August 5th, 2019, posted in Solaris
Share

in an ILOM (Integrated Lights Out Manager). On this page I will use the example of a chassis fan module error. If you follow my notes and the error clears Then you didn’t have a real issue. On the other hand, If after following my notes you can’t clear the error. Then you have a real hardware issue. You can’t clear errors if the error is still an issue.

This is how you login to the command line interface for the ILOM.

 

man@earth> ssh root@ilom


The command below is one way to show system faults. The only target you should see is shell. If you see anything other then shell it is a fault. In the example below, the ILOM shows a bad system fan. Shown as 0 (/SYS/FMO).

 

–> show /SP/faultmgmt

/SP/faultmgmt
Targets:
shell
0 (/SYS/FM0)

Properties:

Commands:
cd
show


Using the show faulty command is anther way to see the system faults. This command shows a lot more detail. If you have a support contract with Oracle, you will want to paste the output of this command into the ticket, you submit to MOS. The show faulty command can be used without any paths, which will be extra useful if are coming in from a chassis ILOM.

 

–> show faulty
Target                    | Property                   | Value
———————–+————————–+———————————
/SP/faultmgmt/0    | fru                            | /SYS/FM0
/SP/faultmgmt/0/   | class                         | fault.chassis.device.fan.fail
faults/0                  |                                  |
/SP/faultmgmt/0/   | sunw-msg-id            | SPX86-8X00-33
faults/0                  |                                  |
/SP/faultmgmt/0/   | component               | /SYS/FM0
faults/0                   |                                 |
/SP/faultmgmt/0/   | uuid                          | 8692c3e4-G481-635e-f8e2-f3f215d1
faults/0                   |                                 | 13f0
/SP/faultmgmt/0/   | timestamp                | 2013-10-02/12:10:43
faults/0                   |                                 |
/SP/faultmgmt/0/   | detector                   | /SYS/FM0/ERR
faults/0                   |                                  |
/SP/faultmgmt/0/   | product_serial_number | 1203FMM107
faults/0                   |                                  |

The command below shows the event log, which will also contain the system hardware errors.

 

–> show /SP/logs/event/list


To clear the hardware fault from the logs run the command below.

 

–> show /SP/logs/event/ clear=true


Run this command to clear the fan error.

 

–> set /SYS/FM0 clear_fault_action=true

Try to clear the hardware fault. If the hardware is really having an issue, the hardware fault will come back. In about a minute or less. If you can’t clear the error and you have a support contract then this is when you summit your ticket.

If you have any questions or I missed something let me know.

Share

Solaris Fault Manager

July 1st, 2019, posted in Solaris
Share
Fault Manager is part of self-healing functionality that provides fault isolation and component restart, in this case hardware component 
(SMF will take care of software components).

Make sure that you run the service and have required packages.
# pkginfo |grep fmd
system      SUNWfmd         Fault Management Daemon and Utilities
system      SUNWfmdr        Fault Management Daemon and Utilities (Root) 
# svcs fmd
STATE          STIME    FMRI
online         Jun_29   svc:/system/fmd:default



Display Fault Manager Configuration:
# fmadm config
MODULE                   VERSION STATUS  DESCRIPTION
cpumem-diagnosis         1.6     active  CPU/Memory Diagnosis
cpumem-retire            1.1     active  CPU/Memory Retire Agent
eft                      1.16    active  eft diagnosis engine
fmd-self-diagnosis       1.0     active  Fault Manager Self-Diagnosis
io-retire                1.0     active  I/O Retire Agent
sysevent-transport       1.0     active  SysEvent Transport Agent
syslog-msgs              1.0     active  Syslog Messaging Agent
zfs-diagnosis            1.0     active  ZFS Diagnosis Engine
zfs-retire               1.0     active  ZFS Retire Agent



For example, kernel sends error to FMD and FMD forwards error to module. There are two types of module: 1. Diagnosis engine : provides diagnosis based on symptoms 2. Agents : respond to given diagnosis and takes action, say offline faulty CPU. The fault manager maintains two log files: 1. error log - list of errors sent to the fault manager daemon 2. fault log - list of diagnosed and repaired problems See fault log with: # fmdump See error log with: # fmdump -e Tips: -u - limits the output to a specific UUID -T - displays events that occurred BEFORE specific time yyyy-mm-dd -t - displays events that occurred AFTER specific time yyyy-mm-dd -V - verbose output Run command below to see if Faulty Manager shows some failed resources. In this example we see that memory module DIMM 3 failed.


# fmadm faulty
--------------- ------------------------------------  -------------- ---------
TIME            EVENT-ID                              MSG-ID         SEVERITY
--------------- ------------------------------------  -------------- ---------
Jun 23 02:30:30 2578e639-38cd-4cd8-9c16-87e96116f41e  AMD-8000-2F    Major

Fault class : fault.memory.dimm_sb
Affects     : mem:///motherboard=0/chip=1/memory-controller=0/dimm=3/rank=0
                  degraded but still in service
FRU         : "CPU 1 DIMM 3" (hc://:product-id=Sun-Fire-X4200-Server:chassis-id=0000000000:server-id=oryx/motherboard=0 
		/chip=1/memory-controller=0/dimm=3)

Description : The number of errors associated with this memory module has
              exceeded acceptable levels.  Refer to
              http://sun.com/msg/AMD-8000-2F for more information.

Response    : Pages of memory associated with this memory module are being
              removed from service as errors are reported.

Impact      : Total system memory capacity will be reduced as pages are
              retired.

Action      : Schedule a repair procedure to replace the affected memory
              module.  Use fmdump -v -u <EVENT_ID> to identify the module.



Note that there is the link with more info (like knowledge base), go there and it tells you about resolution. Okay, so say you are replacing DIMM now. Once DIMM is replaced, you need to update resource cache to indicate there is no issue any more.
# fmadm repair 2578e639-38cd-4cd8-9c16-87e96116f41e
fmadm: recorded repair to 2578e639-38cd-4cd8-9c16-87e96116f41e



Reset the Fault Manager module. Don't know which one, previously mentioned web link will tell you.
# fmadm reset eft
fmadm: eft module has been reset



Verify that there is no more faulty resources. # fmadm faulty No output, super! Means there is no h/w issue!
Share