Popular Posts

Showing posts with label Solaris 10. Show all posts
Showing posts with label Solaris 10. Show all posts

Mar 6, 2020

Solaris SVM mirroring root disks with Solaris volume manager

Solaris SVM mirroring root / boot disks with Solaris volume manager

APPLIES TO :  Oracle Solaris 8, 9, 10

ISSUE :  NIL

GOAL :  Mirror the Solaris root disk

SOLUTION :  Find below steps to mirror the root disk of Solaris 10 server.  

Prerequisites :   NIL


               1. Copy Partition table from root to mirror disk..
                       prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t0d1s2

               2. Create the metadb state databases
                       metadb -afc 3 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d1s7

               3. To see the new state database replicas we just created :
                       metadb

               4. Create two submirrors for the root volume
                       metainit -f d11 1 1 c0t0d0s0
                       metainit d12 1 1 c0t0d1s0

                       metainit -f d21 1 1 c0t0d0s1
                       metainit d22 1 1 c0t0d1s1

                       metainit -f d31 1 1 c0t0d0s3
                       metainit d32 1 1 c0t0d1s3

                       metainit -f d41 1 1 c0t0d0s4
                       metainit d42 1 1 c0t0d1s4

                       metainit -f d51 1 1 c0t0d0s5
                       metainit d52 1 1 c0t0d1s5

                       metainit -f d61 1 1 c0t0d0s6
                       metainit d62 1 1 c0t0d1s6

               5. Setup one way mirror OR create main mirror with primary disk's sub mirror
                       metainit -f d100 -m d11
                       metainit d200 -m d21
                       metainit d300 -m d31
                       metainit d400 -m d41
                       metainit d500 -m d51

                       metainit d600 -m d61

               6. Backup the configuration files
                       cp /etc/vfstab /etc/vfstab.premirr
                       cp /etc/system /etc/system.premirr

               7. Activiate the Mirror using the metaroot command which will update the /etc/system and /etc/vfstab files
                       metaroot d100
               8. Verify the configuration  file /etc/system and /etc/vfstab
                       cat /etc/system|grep "md"
                              rootdev:/pseudo/md@0:0,10,blk --> This extra line reflects the mirror configuration


                       cat /etc/vfstab|grep -i md
              dev/md/dsk/d100 /dev/md/rdsk/d100        /       ufs     1    --> the root volume entry in vfstab modified.                                        

               9. Modify the system file
                       echo "set md:mirrored_root_flag=1" >> /etc/system

               10. Modify the vfstab for other metadevice entries
                       /dev/md/dsk/d200 - - swap - no -
                       /dev/md/dsk/d100 /dev/md/rdsk/d100 / ufs 1 no -
                       /dev/md/dsk/d400 /dev/md/rdsk/d400 /usr ufs 1 no -
                       /dev/md/dsk/d300 /dev/md/rdsk/d300 /var ufs 1 no -
                       /dev/md/dsk/d500 /dev/md/rdsk/d500       /opt    ufs     2       yes     -
                       /dev/md/dsk/d600 /dev/md/rdsk/d600 /oracle ufs 2 yes logging

               11. Before rebooting, run the sync command multiple times and lockfs -fa command to flush the data to file system
                       sync
                       sync
                       sync

                       lockfs -fa

               12. Now we can reboot the system.
                       shutdown -i6 -g0 -y

               13. Attaching the other submirror to the main mirror and sync the data
                       metattach d100 d12
                       metattach d200 d22
                       metattach d300 d32
                       metattach d400 d42
                       metattach d500 d52
                       metattach d600 d62

               14. Change the swap partition from slice device to meta device
                       swap -l
                       swap -d /dev/dsk/c0t0d0s1
                       swap -a /dev/md/dsk/d0

               15. if the dump device shows any disk slice path change it to meta device path.
                       dumpadm
                       dumpadm -d /dev/md/dsk/d1

               16. The sync will start now. To check the status of the mirror 
                       metastat -cp

               17. Install the boot block on the mirror disk
                       installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d1s0

               18. Reboot the server with both primary and secondary disks to check the stability of the mirror functionality. 



~ Judi ~

Aug 26, 2019

vi cheat sheet & vi basic commands

vi cheat sheet & vi basic commands


APPLIES TO :  Oracle SPARC Solaris and all unix OS

ISSUE : 

GOAL :  Easy reference to work in vi editor

SOLUTION :  


     1. To Move the cursor left  in vi editor
                 Press h
                 Press 5h - to move the cursor 5 characters left

     2. To Move the cursor right  in vi editor
                 Press l
                 Press 5l - to move the cursor 5 characters right

     3. To Move the cursor down  in vi editor
                 Press j
                 Press 5j - to move the cursor 5 lines down

     4. To Move the cursor up  in vi editor
                 Press k
                 Press 5k - to move the cursor 5 lines up

     5. To move the cursor to the right one word at a time in vi editor
                 Press w (“word”)
                 Press 5w - to move the cursor 5 words right

     6. To move the cursor to the left one word at a time  in vi editor
                 Press b (“back”)
                 Press 5b - to move the cursor 5 words left

     7. To move the cursor to the last character of the current word in vi editor
                 Press e (“end”)

     Moving to Start or End of Line
     8. To move the cursor to the start of the current line in vi editor
                 Press ^ or Press 0

     9. To move the cursor to the end of the current line in vi editor
                 Press $

     10. To move the cursor to the beginning of the next line down in vi editor
                 Press the Return key

     11. To move the cursor one character to the left in vi editor
                 Press the Back Space key

     12. To move the cursor one character to the right in vi editor
                 Press the Space Bar

     13. To move the cursor to the top of the screen in vi editor
                 Press H (“high”)

     14. Move to the first non-blank character of the line in vi editor
                 Press ^

     15. Jump forward one sentence in vi editor
                 Press )

     16. Jump backward one sentence in vi editor
                 Press (

     17. Jump forward one paragraph in vi editor
                 Press }

     18. Jump backward one paragraph in vi editor
                 Press {

     19. Jump to the middle of the screen in vi editor
                 Press M

     20. Jump to the bottom of the screen in vi editor
                 Press L

     21. Move the cursor to the end of file  in vi editor
                 Press G

     22. To create line numbers at the beginning of file  in vi editor
                 :set number

     23. Append or add a text next to the cursor in vi editor
                 Press a and type your content and press esc when finished

     24. Insert a text at the left of the cursor in vi editor
                 Press i and type your content and press esc when finished.

     25. Insert new line below the cursor  in vi editor
                 Press o

     26. Insert new line above the cursor  in vi editor
                 Press O

     27. Undoing a previous command or a change  in vi editor
                 Press u

     28. Undo all changes made to a line in vi editor
                 Press U

     29. To delete one character, position the cursor over the character to be deleted in vi editor
                 Press x

     30. To delete a word, place the cursor at the beginning of the word in vi editor
                 Press dw

     31. To delete a line, place the cursor anywhere on the line in vi editor
                 Press dd

     Copying Lines
     32. To Copy a line, place the cursor anywhere on the line  in vi editor
                 Press yy

     33. Paste the copied line, place the cursor above the line we need to paste in vi editor
                 Press p
                 Press P - paste the copied line to the above line


     Searching and Replacing
     34. Search a string in vi editor
                 :s/string
                 The first match of your string will be highlighted, Type n to see the additional occurance of nex match.

     35. Search and Replace a string in a line in vi editor
                 :s/pattern/replace/
                 This will replace the pattern with replace in the current line

     36. Search and Replace a string in a entire file in vi editor
                 :%s/pattern/replace/
                 This will replace every occurance of pattern with replace



~Judi~

Mar 13, 2018

Oracle Solaris Explorer Data Collector

Oracle Solaris Explorer Data Collector

Oracle Solaris explorer : 

The latest Services Tools Bundle is (STB) 8.18.17.12.12 (13-Mar-2018)

APPLIES TO :  Solaris 8,9,10, 11

     1. To determine if your version of Oracle Solaris is 32 or 64 bit, run:
                judi-dev-01 #:  isainfo -v        ### Output will look like:
                                64-bit sparcv9 applications
                                32-bit sparc applications
                To determine the kernel modules, run:
                judi-dev-01 #:  isainfo -vk        ### Output will look like:
                                64-bit sparcv9 kernel modules
     2. Download and Install Oracle Services Tools Bundle
                Download and unzip the Oracle Services Tools Bundle from Doc ID 1153444.1
                Dwonload the zip file based on your Solaris bit and version

     3. Oracle Explorer Data Collector Installation
                chmod +x install_stb.sh  ### Make sure the install script is executable:
                ./install_stb.sh -verbose  ### Run the following command:
                  

     4. Oracle Explorer Data Collector man pages
                To access the Explorer man page of section 1m on Solaris 10, run:
                man -M /opt/SUNWexplo/man -s 1m explorer

     5. Run Explorer
                explorer -w all -T DA -SR <Service Request number>

     6. Run Explorer for Different Modules/Groups
                explorer -w all  ### Runs all modules.
                explorer -w all,interactive  ### If the modules tagged to the group all require user interaction, the user is prompted for input.
                explorer -w default  ### Runs modules tagged to default
                explorer -w default,interactive  ### Runs modules tagged to default group. If the modules tagged to the group default require user interaction, the user is prompted for input.
                explorer -w extended  ### Runs modules tagged to mandatory or extended group.
                explorer -w <module name>  ### Runs <module name> and modules tagged to the mandatory group.
                explorer -w default,<module name> 

     7. Explorer Output Directory
                To store its collection result file, Explorer will create a subdirectory in the output directory of Explorer. 
                /var/explorer/output   ###  on Solaris 11 or later
                /opt/SUNWexplo/output   ###  on Solaris 8, 9, and 10.
                


~Judi~


Popular Posts