You are on page 1of 213

Sun Solaris 10 Operating System

Page 146

System Messaging

/etc/syslog.conf file is responsible for sending or redirecting the messages to the log file or console or user or loghost. Note: 1. By default every system will be its own loghost 2. Before going to do any configuration, make sure whether the packages related to the services are completely installed along with its dependencies. 3. As precaution have the backup of the default configuration file. 1. Daemon 2. User process 3. Kernel 4. logger (this is the only command to generated the messages which is used to check out the configuration performed on the file /etc/syslog.conf) These above four persons can generate the messages to files or loghost or to user or to the console.

Level of messages: emerg - 0 (first priority) = Panic conditions that would normally be broadcasted to all users. alert - 1 = Conditions that should be corrected immediately, such as a corrupted system database. crit - 2 = Warnings about critical conditions, such as hard device errors err - 3 = Other errors warning - 4 = Warning messages notice - 5 = Conditions that are not error conditions but that migght require special handling, such as failed login attempt. A failed login attempt is considered a notice and not an error. info - 6 = Information messages debug - 7 = Messages that are normally used only when debugging a program none - 8 = Does not send messages from the inidcated facility to the selected file,

NOTE: When we specify a syslog level, it means that the specified level and all higher levels. For eg, if we specify err level, then it includes crit, alert and emerg level too.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 147

To compile: # /usr/ccs/bin/m4 /etc/syslog.conf

Solaris-10: # svcadm enable system/system-log Starts the syslogd daemon # svcadm disable system/system-log Stops the syslogd deamon

# svcadm refresh system/system-log Makes the Operating System to re-read the configuratiton file /etc/syslog.conf This command is must if the changes is done to the configuration file.

Solaris-9: # /etc/init.d/syslog start # /etc/init.d/syslog stop

Output:(With default entry to the file)

# Copyright (c) 1991-1998 by Sun Microsystems, Inc. # All rights reserved. # # syslog configuration file. # # This file is processed by m4 so be careful to quote (`') names # that match m4 reserved words. Also, within ifdef's, arguments # containing commas must be quoted. # *.err;kern.notice;auth.notice /dev/sysmsg *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages

*.alert;kern.err;daemon.err *.alert *.emerg

operator root *

# if a non-loghost machine chooses to have authentication messages # sent to the loghost machine, un-comment out the following line: #auth.notice ifdef(`LOGHOST', /var/log/authlog, @fire1) mail.debug ifdef(`LOGHOST', /var/log/syslog, @fire1)

# # non-loghost machines will use the following lines to cause "user" # log messages to be logged locally. # ifdef(`LOGHOST', ,
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 148

user.err user.err user.alert user.emerg )

/dev/sysmsg /var/adm/messages `root, operator' *

Eg entry from the file /etc/syslog.conf *.err;kern.debug;daemon.notice;mail.crit A B C D E /var/adm/messages

where A = *.err means, all (user process, kernel, daemon, logger) who ever generating the error message B = kern.debug means, only kernel generating debug messages C = daemon.notice means, only deamon generating notice messages D = mail.crit means, only mail generating critical messages E = /var/adm/messages all above mentioned messages have to be logged to the file /var/adm/messages

# tail -f /var/adm/messages will display all the messges generated by all. Output-truncated: bash-3.00# tail -f /var/adm/messages Sep 3 14:12:40 sunfire2 genunix: [ID 935449 kern.info] disabled. Control with "atapi-cd-dma-enabled" property Sep 3 14:12:40 sunfire2 genunix: [ID 882269 kern.info] selected Sep 3 14:12:40 sunfire2 genunix: [ID 935449 kern.info] disabled. Control with "atapi-cd-dma-enabled" property Sep 3 14:12:40 sunfire2 genunix: [ID 882269 kern.info] selected Sep 3 14:12:40 sunfire2 genunix: [ID 773945 kern.info] selected

ATA DMA off: PIO mode 4 ATA DMA off: PIO mode 4 UltraDMA mode 6

Note: Option: -f = option along with tail command refresh the file and keep on display the contents to the user.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 149

To test: 1. edit the file /etc/syslog.conf *.notice /var/log/logs-test

2. Save the file 3. Create a empty file under /var/log # touch /var/log/logs-test 4. Refresh the system-log # svcadm refresh system-log 5. To test the configuration eg: # logger -p local0.notice Notice:level "test message" eg: # logger -p local0.notice Crit:level "test message" Note: If the same message is generated for several times, the same message will not be logged to the specified file.

Now customizing the file /etc/syslog.conf Option-1: By editing the above file, with the following line *.err;kern.debug;daemon.notice;mail.crit /var/adm/test_log

By this entry, we understand that, the log will be sent to the file /var/adm/test_log Note: 1. Make sure that the file /var/adm/test_log is esisting. 2. Compile the file 3. Refresh the service

Option-2: By editing the above file, with the following line *.err;kern.debug;daemon.notice;mail.crit *

By thins entry, the messages will be sent to all the user's who are currently logged in

Option-3: By editing the above file, with the following line *.err;kern.debug;daemon.notice;mail.crit che

By this entry, the messages will be sent only to the user che (as specified)

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 150

Output: Example entry of the file /var/adm/messages Sep 11 04:08:52 sunfire3 in.routed[185]: [ID 300549 daemon.warning] interface nge0 to A B C D E 192.168.0.200 restored G H Here A = Date & time when the message is generated B = System name (here, local system name) C = Process name/PID number D = Message ID, facility.level informations E = Incoming request (here through the interface nge0) F = PPID number ( NOTE: NOT seen in the above output line) G = IP address H = Port number ( NOTE: NOT seen in the above output line)

0 - Used to debug the configuration file - This command reads the configuration file - NOTE: Only root user can run this command in Multi-user mode Output truncated: bash-3.00# /usr/sbin/syslogd -d main(1): Started at time Fri Sep 11 04:19:46 2009 hnc_init(1): hostname cache configured 2037 entry ttl:1200 getnets(1): found 1 addresses, they are: 0.0.0.0.2.2 amiloghost(1): testing 192.168.0.100.2.2 cfline(1): (*.err;kern.notice;auth.notice /dev/sysmsg) cfline(1): (*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages) cfline(1): (*.err;kern.debug;daemon.notice;mail.crit /Desktop/log_file) cfline(1): (*.err;kern.debug;daemon.notice;mail.crit /Desktop/log_test) cfline(1): (*.err;kern.debug;daemon.notice;mail.crit india ) cfline(1): (*.err;kern.debug;daemon.notice;mail.crit /dev/console ) logerror(1): syslogd: /dev/console : No such file or directory logerror_to_console(1): syslogd: /dev/console : No such file or directory cfline(1): (*.alert;kern.err;daemon.err operator) cfline(1): (*.alert root)

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 151

RBAC - Role Based Acess Control: RBAC is an alternative method to assign special privilidge to a non-root user as an authorization or as role or as profile. Note: In Linux the same implementation is said to be us SUDO. Configuration files: /etc/user_attr: - Extended user attributes Database - Associates users and roles with authrizations and profiles NOTE: When creating a new user account with no rights profiles, authorizations or roles, nothing is added to the file. /etc/security/auth_attr: - Authrization attributes Database - Defines authorizations and their attributes and identifies the associated help file

/etc/security/prof_attr: - Rights profile attributes database - Defines profiles, lists the profile's assigned authorizations, and identifies the associated help

/etc/security/exec_attr: - Profile attributes database - Defines the privileged operations assinged to a profile Roles: - Will have an entry to the file /etc/passwd and /etc/shadow - Similar to user account - Collection of profiles Profiles: - Will have a dedicated shell - Profile shells will assingned - Bourne Shell & Kron shell have profile shells - pfsh (bourne profile shell), pfksh (korn profile shell) - Is collection of numbner of commands. NOTE: 1. If the user/role change from the specified profile shell then they are not permitted to execute the authorized commands 2. It's not possible to login to the system directly using role. A role can only be used by switching the user to the role with "su" command. 3. We can also set up the "root" user as a role through a manaul process. This approach prevents users from logging in directory as the root user. Therefore, they must login as themselves first, and then use the su command to assume the role.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 152

We can perform RBAC by three ways to an user: 1. Directly adding the authorization to the user account 2. Creating a profile, and adding the profile to the user account 3. Creating a profile, adding it to role, then adding the role to the user account. 4. Adding authorization to role and adding the role to an user

I. Adding authorization to an user account: # useradd -m -d /export/home/shyam -s /usr/bin/pfsh \ -A solaris.admin.usermgr.pswd \ solaris.system.shutdown \ solaris.system.admin.fsmgr.write shyam

# passwd shyam Here, we had added the existing authorization to the user account using -A option with #useradd command Note: The shell assinged is profile shell. Output: bash-3.00# su shyam sunfire1% echo $SHELL /usr/bin/pfsh sunfire1% auths solaris.admin.usermgr.pswd,solaris.system.shutdown,solaris.admin.fsmgr.write,sol aris.device.cdrw,solaris.profmgr.read,solaris.jobs.users,solaris.mail.mailq,sola ris.admin.usermgr.read,solaris.admin.logsvc.read,solaris.admin.fsmgr.read,solari s.admin.serialmgr.read,solaris.admin.diskmgr.read,solaris.admin.procmgr.user,sol aris.compsys.read,solaris.admin.printer.read,solaris.admin.prodreg.read,solaris. admin.dcmgr.read,solaris.snmp.read,solaris.project.read,solaris.admin.patchmgr.r ead,solaris.network.hosts.read,solaris.admin.volmgr.read sunfire1% profiles Basic Solaris User All sunfire1% profiles -l All: * sunfire1% roles No roles

# roles - Returns the information about, to which roles the user is authorized to login # profiles - Returns the information about, to which profile the user is authorized to execute

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 153

# profiles -l - Retuns the detailed information about the permitted commands that can be executed by the user # auths - Returns the information about the permitted autorization mapped to the user account.

When a user is created with addittional information like authrization, profiles or roles, # useradd command update the entry to the file /etc/user_attr

Output: (Relevant to the topic) prabhu::::type=normal;auths=solaris.admin.usermgr.pswd,solaris.system.shutdown,s olaris.admin.fsmgr.write

Note: We cannot see an entry to the file for a normal user.

II. Creating a profile and adding it to an user account: WTD: 1. Determine the name of the profile 2. Determine what commands has to be added to the profile 3. Edit the file /etc/security/prof_attr file accodingly 4. Edit the file /etc/security/exec_attr file by providing the list of commands to the profile 5. Map the profile to the user HTD: Eample-1: Profile name=testprofile Commands added to the profile=shutdown,format,useradd,passwd Step-1: Adding/Creating a profile # vi /etc/security/prof_attr testprofile:::This is a test profile to test RBAC 1 2 Here, 1 = Name of the profile 2 = Comment about the profile (Optional)

Step-2: Mapping the list of commands to the created profile # vi /etc/security/exec_attr testprofile:suser:cmd:::/usr/sbin/shutdown:uid=0 testprofile:suser:cmd:::/usr/sbin/format:uid=0 testprofile:suser:cmd:::/usr/sbin/useradd:uid=0 testprofile:suser:cmd:::/usr/bin/passwd:uid=0
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 154

Step-3: Mapping the profile to the user account # useradd -m -d /export/home/accel -s /usr/bin/pfksh -P testprofile accel Here we have added the profile named "testprofile" to the user. Output: bash-3.00# su - accel sunfire1% echo $SHELL /usr/bin/pfksh sunfire1% roles No roles sunfire1% profiles testprofile Basic Solaris User All sunfire1% profiles -l testprofile: /usr/sbin/shutdown uid=0 /usr/sbin/format uid=0 /usr/sbin/useradd uid=0 /usr/bin/passwd uid=0 All: *

Example-2 Profile name: complete List of commands added: Creating a profile with all root privilidges Step-1: Step-1: Adding/Creating a profile # vi /etc/security/prof_attr complete:::This is to test the duplication of root profile 1 2 Here, 1 = Name of the profile 2 = Comment about the profile (Optional)

Step-2: Mapping the list of commands to the created profile # vi /etc/security/exec_attr complete:suser:cmd:::*:uid=0 Step-3: Mapping the user to the profile # useradd -m -d /export/home/aita -s /usr/bin/pfsh -P complete aita

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 155

Output: bash-3.00# su - aita sunfire1# echo $USER root sunfire1# roles No roles sunfire1# profiles Web Console Management All Basic Solaris User sunfire1# profiles -l | more Web Console Management: /usr/share/webconsole/private/bin/smcwebstart

uid=noaccess, gid=noaccess, privs=proc_audit

All: *

Note: 1. The output of the commands # profiles # profiles -l will be similar for the root user. 2. From the above output, we can also observe the change in the shell of the user. Normally for the user the shell is $, but since the all the privilidge is given to the user, the shell is #

III. Creating a role, profile and mapping it to the user account. WTD: 1. Determine the name of the user 2. Create the role 3. Assign the password to the role Note: a. Role should have a password to it. b. Without having a password it's not possible to login to that role 4. 5. 6. 7. Create a profile Add the list of commands to the profile Add the profile to the role Add the role to the user

Note: This method has some more layer of security by assiging a password to a role.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 156

HTD: Step-1: Create a role # roleadd -m -d /export/home/policy -s /usr/bin/pfsh policy 1. This command will update the following files a. /etc/passwd b. /etc/shadow c. /etc/user_attr Output: bash-3.00# roleadd -m -d /export/home/policy -s /usr/bin/pfsh policy 80 blocks bash-3.00# passwd policy New Password: Re-enter new Password: passwd: password successfully changed for policy bash-3.00# grep policy /etc/passwd policy:x:112:1::/export/home/policy:/usr/bin/pfsh bash-3.00# grep policy /etc/shadow policy:xXuxPLl/Wt13Q:14512:::::: bash-3.00# grep policy /etc/user_attr policy::::type=role;profiles=All

Step-2: Creating a profile Note: To create a profile pls do refer II Creating a profile. Let's make use of the above existing profile. For eg, let's take the profile "testprofile"

Step-3: Adding the profile to the role # rolemod -P testprofile,All policy Adds the profile named "testprofile" to the existing role "quality".

Now we can observe the changes to the file /etc/user_attr Output: quality::::type=normal;roles=complete;auths=solaris.admin.usermgr.pswd, solaris.system.shutdown,solaris.admin.fsmgr.write

Step-4: Mapping the role to the user: # useradd -m -d /export/home/nokia -R policy -s /bin/bash nokia
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 157

Adding a role to the user. Output: bash-3.00# useradd -m -d /export/home/nokia -R policy -s /bin/bash nokia 80 blocks bash-3.00# passwd nokia New Password: Re-enter new Password: passwd: password successfully changed for nokia bash-3.00# su nokia sunfire1% auths solaris.device.cdrw,solaris.profmgr.read,solaris.jobs.users,solaris.mail.mailq,s olaris.admin.usermgr.read,solaris.admin.logsvc.read,solaris.admin.fsmgr.read,sol aris.admin.serialmgr.read,solaris.admin.diskmgr.read,solaris.admin.procmgr.user, solaris.compsys.read,solaris.admin.printer.read,solaris.admin.prodreg.read,solar is.admin.dcmgr.read,solaris.snmp.read,solaris.project.read,solaris.admin.patchmg r.read,solaris.network.hosts.read,solaris.admin.volmgr.read sunfire1% profiles Basic Solaris User All sunfire1% profiles -l All: * sunfire1% roles policy sunfire1% su policy Password: sunfire1% profiles testprofile All Basic Solaris User sunfire1% profiles -l testprofile: /usr/sbin/shutdown uid=0 /usr/sbin/format uid=0 /usr/sbin/useradd uid=0 /usr/bin/passwd uid=0 All: *

Note: Authorized acitivity can be performed by the user, only after switch to the role. Role user account CANNOT be directly logged into the system.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 158

Output: bash-3.00# su nokia sunfire1% su policy Password: $ /usr/sbin/shutdown -g 180 -i 5 Shutdown started. Fri Sep 25 17:26:01 IST 2009

Broadcast Message from root (pts/3) on sunfire1 Fri Sep 25 17:26:01... The system sunfire1 will be shut down in 3 minutes

Note: Default auths is assigned to an used is defined in the file /etc/security/policy.conf bash-3.00# grep -i auths /etc/security/policy.conf AUTHS_GRANTED=solaris.device.cdrw

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 159

NAMING SERVICE NIS -> Network Information System used to store the centralized user administration works with same environment LAN NIS has 3 components Includes a. NIS Master b. NIS Slave c. NIS Client NIS Master Server: 1. The first system to be prepared in the domain 2. Has the source file 3. Has NIS maps which are built from the source files 4. Provides single point of control 5. Only one master server for a domain 6. Daemons (Runs on NIS Master server): a. ypserv b. ypbind c. ypxfrd d. rpc.yppasswd e. rpc.ypdated NIS Slave 1. 2. 3. 4. 5. 6. Server: An optional system in the domain Doesnt have source files for that domain But has maps which are received from the master server Provides load balancing when the master server is busy Provides redundancy when the master server fails Deamons (Runs on NIS Slaver server): a. Ypserve b. ypbind

NIS Client: 1. Doesnt have source files and maps 2. Binds to the slaver server dynamically when the master sercer is either busy or down. 3. Deamons (Runs on NIS Client): a. ypbind DNS -> Domain Name System WAN

LDAP -> Light Weight Directory Access Protocol works with other environments too.

With ref to the diagram. (1) -> whenever the user is trying to login to the system by issusing the user login name and password system first go and check the enties to the file /etc/nsswitch.conf. nsswitch.conf -> Name Servcie SWITCH CONFiguration file. it'll inform the system that the way how the user logins has to be searched. For eg: first with nis server, then with local files and so on.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 160

We are provided with number of templates for the naming service. nsswitch.nis nsswitch.nisplus nsswitch.dns nsswitch.ldap (2) -> after reading the entry of the file, it moves and reads the file /etc/hosts (3) -> now it'll reaches the NIS server (4) -> reads the database of the NIS server to permit the user logins. /etc/passwd, /etc/shadow and some files will be checked and if the issued login name exists in the database of the NIS server. The system responds +ively. (5) And it'll be redirected to the client to authenticante the login.

NIS Server Configuration Steps: 1. # cp /etc/nsswitch.nis /etc/nsswitch.conf 2. # domainname aita.com 3. # domainname > /etc/defaultdomain 4. # cd /etc 5. # touch ethers bootparams locale timezone netgroup netmasks 6. # ypinit -m 7. # /usr/lib/netsvc/yp/ypstart # /usr/lib/netsvc/yp/ypstop 8. # ypcat hosts 9. # ypcat user5 passwd 10. # ypwhich

TO CONFIGURE NIS CLIENT: 1. # cp /etc/nsswitch.nis /etc/nsswitch.conf 2. # domainname accel.com 3. # domainname > /etc/defaultdomain 4. # ypinit -c 5. # /usr/lib/netsvc/yp/ypstart 6. # ypwhich -m

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 161

TO UPDATE THE USER ADDITION: 1. # cd /var/yp 2. # /usr/ccs/bin/make

# ypwhich will display the name of the NIS Master server # ypmatch -k <user_name> passwd # ypmatch -k shivan passwd will display the entry for user "shivan" in the passwd database

# ypcat hosts will display the hosts database

# ypinit -m to initate the NIS Master server # ypinit -c to intiate it as a client when prompted for list of servers, provides the server name. NIS search status codes: SUCCESS - requested entry was found UNAVAIL - source was unavailable NOTFOUND - source contains no such entry TRYAGAIN - source returned an "I'm busy, try later' message ACTIONS: Continue - try the next source Return - stop looking for an entry Default Actions: SUCCESS = return UNAVAIL = continue NOTFOUND = continue TRAGAIN = continue Note: NOTFOUND = return The next source in the list will only be searched if NIS is down or has been disabled Normally, a success indicated that the search is over and an unsuccessful result indicates that the next source should be queried. There are occassions, however when you want to stop searching when an unsuccessful search result is returned. Information handled by a name service includes, 1. system (host)names and address 2. User names 3. Passwords 4. Groups 5. Automounter configuration files
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 162

(auto.master, auto.home) 6. Access permisssions & RBAC database files NOTE: YP to NIS, 1. NIS was formerly known as SUN Yellow Pages (YP). The functionality of the second NIS remains the same, only the same has changed. 2. NIS administration database are called MAPS. 3. NIS stored information about workstation names and addresses, users, the network itself, and network services. This collection of network information is reffered to as the NIS NAMESPACE. 4. Any system can be an NIS client, but only system with disks should be NIS servers, whether master or slave. 5. Servers are also clients of themselves. 6. The master copies of the maps are located on the NIS master server, in the directory /var/yp/domain_name 7. Under <domain-name> directory each map is stored as 2 files. a. mapname.dir b. mapname.pag /etc/bootparams: 1. Contains the path names that clients need during startup: root, swap and possibly others.

/etc/ethers: 1. Contains system names and ethernet addresses. The system name in the key - ethers.byname 2. Contains system names and etehnet addresses. The ethernet addresses is the key in the map ethers.byaddr /etc/netgroup: 1. netgroup - contains groupname, username and system name. The groupname is the key. 2. netgroup.byhost - contians the group name, user name and system name is the key. 3. netgroup.byuser - contains the group name, user name and system name. The username is the key. /etc/netmask: netmasks.byaddr - contains the network masks to be used with YP subnetting. The address is the key. /etc/timezone: timezone.byname - contians the default timezone database. The timezone name is the key. /etc/shadow - agening.byname /etc/security/auth_attr - authorization attributes for RBAC. contains the autorizzation description database, part of RBAC. /etc/auto_home - auto.home Automounter file for home directory.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 163

/etc/auto_master - auto.master Master automounter map /etc/security/exec_attr Contains execution profiles, part of RBAC /etc/hosts hosts.byaddr hosts.byname /etc/group group.byid group.byname group.byaddr /etc/usre_attr contains the extended user attributes database, part of RBAC

/etc/security/prof_attr Contains profile descriptions, part of RBAC

/etc/passwd /etc/shadow passwd.byname passwd.byid map.key.pag and map.key.dir map - base name of the map (hosts, passwd and so on...) key - the map's sort key (byname, byaddr and so on...) pag - the map's data dir - an index to the *.pag file These above were some of the databases, files are reffered after activating NIS. Still some more files and directories are there.

To construct a NIS slave server: # ypinit -s

To delete the NIS server configuration: 1. Replace the file # cp /etc/nsswitch.files /etc/nsswitch.conf

2. Remove the binding directory # cd /var/yp # rm -rf binding


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 164

Note: Make sure that the yp services are stopped. # /usr/lib/netsvc/yp/ypstop

In short:

NIS Creation: * * * * * * * /etc/hosts domainname domainname > /etc/defaultdomain cd /etc;touch ethers timezone netmasks netgroup bootparams locale cp /etc/nsswitch.nis /etc/nsswitch.conf ypinit -m ypinit -s ypinit -c svcadm enable nis/server svcadm enable nis/client

Deletion: * * * * * rm /etc/defaultdomain rm -r /var/yp/<domainname> rm -r /var/yp/binding/<domainname> svcadm disable /nis/server svcadm disable /nis/client cp /etc/nsswitch.files nsswitch.conf

Output: Configuring Master Server: bash-3.00# hostname sunfire1 bash-3.00# cp /var/yp/Makefile /var/yp/Makefile.orig bash-3.00# domainname solaris.com bash-3.00# domainname solaris.com bash-3.00# domainname > /etc/defaultdomain bash-3.00# cd /etc bash-3.00# touch ethers bootparams locale netgroup netmasks timezone bash-3.00# vi /etc/hosts "/etc/hosts" [Read only] 6 lines, 125 characters # # Internet host table # #192.168.0.157 sunfire103 master 127.0.0.1 localhost loghost sunfire1 192.168.0.100 sunfire1 192.168.0.150 sunfire2 192.168.0.200 sunfire3 ~ ~
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 165

"/etc/hosts" 8 lines, 171 characters bash-3.00# bash-3.00# ypinit -m In order for NIS to operate sucessfully, we have to construct a list of the NIS servers. Please continue to add the names for YP servers in order of preference, one per line. When you are done with the list, type a <control D> or a return on a line by itself. next host to add: sunfire1 next host to add: ^D The current list of yp servers looks like this: sunfire1 Is this correct? [y/n: y] y

Installing the YP database will require that you answer a few questions. Questions will all be asked at the beginning of the procedure. Do you want this procedure to quit on non-fatal errors? [y/n: n] OK, please remember to go back and redo manually whatever fails. If you don't, some part of the system (perhaps the yp itself) won't work. The yp domain directory is /var/yp/solaris.com There will be no further questions. The remainder of the procedure should take 5 to 10 minutes. Building /var/yp/solaris.com/ypservers... Running /var/yp /Makefile... updated passwd updated group updated hosts updated ipnodes updated ethers updated networks updated rpc updated services updated protocols updated netgroup updated bootparams updated publickey updated netid /usr/sbin/makedbm /etc/netmasks /var/yp/`domainname`/netmasks.byaddr; updated netmasks updated timezone updated auto.master updated auto.home updated ageing updated auth_attr updated exec_attr updated prof_attr updated user_attr updated audit_user sunfire1 has been set up as a yp master server with errors. Please remember to figure out what went wrong, and fix it. If there are running slave yp servers, run yppush now for any data bases which have been changed. If there are no running slaves, run ypinit on those hosts which are to be slave servers.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 166

bash-3.00# cp /etc/nsswitch.nis /etc/nsswitch.conf bash-3.00# svcadm enable nis/server bash-3.00# svcs -a | grep nis disabled 12:09:17 svc:/network/rpc/nisplus:default disabled 12:30:54 svc:/network/nis/client:default online 12:26:46 svc:/network/nis/xfr:default online 12:26:46 svc:/network/nis/update:default online 12:26:46 svc:/network/nis/passwd:default online 12:30:21 svc:/network/nis/server:default bash-3.00#

Configuring Slave Server: bash-3.00# hostname sunfire2 bash-3.00# ypinit -c In order for NIS to operate sucessfully, we have to construct a list of the NIS servers. Please continue to add the names for YP servers in order of preference, one per line. When you are done with the list, type a <control D> or a return on a line by itself. next host to add: sunfire1 next host to add: ^D The current list of yp servers looks like this: sunfire1 Is this correct? [y/n: y] bash-3.00# svcadm enable nis/client bash-3.00# svcs -a|grep nis disabled 9:49:38 svc:/network/rpc/nisplus:default disabled 9:49:38 svc:/network/nis/server:default disabled 9:49:38 svc:/network/nis/passwd:default disabled 9:49:38 svc:/network/nis/xfr:default disabled 9:49:39 svc:/network/nis/update:default online 10:28:28 svc:/network/nis/client:default bash-3.00# ypinit -s sunfire1

Installing the YP database will require that you answer a few questions. Questions will all be asked at the beginning of the procedure. Do you want this procedure to quit on non-fatal errors? [y/n: n] OK, please remember to go back and redo manually whatever fails. If you don't, some part of the system (perhaps the yp itself) won't work. The yp domain directory is /var/yp/solaris.com There will be no further questions. The remainder of the procedure should take a few minutes, to copy the data bases from sunfire1. sunfire2's nis data base has been set up bash-3.00# svcs -a|grep nis disabled 9:49:38 svc:/network/rpc/nisplus:default disabled 9:49:38 svc:/network/nis/passwd:default disabled 9:49:38 svc:/network/nis/xfr:default disabled 9:49:39 svc:/network/nis/update:default online 10:28:28 svc:/network/nis/client:default
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 167

online 10:28:58 svc:/network/nis/server:default bash-3.00# ypwhich sunfire1

Configuring Client: bash-3.00# hostname sunfire3 bash-3.00# ypinit -c In order for NIS to operate sucessfully, we have to construct a list of the NIS servers. Please continue to add the names for YP servers in order of preference, one per line. When you are done with the list, type a <control D> or a return on a line by itself. next host to add: sunfire1 next host to add: sunfire2 next host to add: ^D The current list of yp servers looks like this: sunfire1 sunfire2 Is this correct? [y/n: y] bash-3.00# svcadm enable nis/client bash-3.00# svcs -a|grep nis disabled 9:46:37 svc:/network/rpc/nisplus:default disabled 9:46:37 svc:/network/nis/server:default disabled 9:46:37 svc:/network/nis/passwd:default disabled 9:46:37 svc:/network/nis/update:default disabled 9:46:37 svc:/network/nis/xfr:default online 10:33:11 svc:/network/nis/client:default bash-3.00# ypwhich sunfire1

Client side service: To create a automount facility for the users home directories on demand, through indirect mapping Edit the file /etc/auto_master #+auto_master . . . . /export/home home-indirect :wq!

Now create a file /etc/home-indirect

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 168

Note: This file will NOT be present by default, has to be created (can be with any name, but make sure that the file name is entered to the file auto-master). Contents to the file: # vi /etc/home-indirect * sunfire1:/export/home/& :wq! Note: Here sunfire1 is the name of the NIS Master Server.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 169

Jumpstart RARP - Reverse Address Resolution Protocol ARP - Address Resolution Protocol Custom Jumpstart: 1. Requires up-front work 2. The most efficient way to centralize and automate the operating system installation at large enterprise 3. A way to install groups of similar system automatically and indentically.

Jumpstart: 1. Automatically install the Solaris software on SPARC based system just by inserting the Solaris CD and powering on the system. 2. For new sparc systems shipped from Sun Mircrosystems, this is the default method of installing the operating system.

Commands: # ./setup_install_server Sets up an install server to provide the OS to the client during the jumpstart installation. This command is also used to setup a boot only server when -b option is specified. # ./add_to_install_server A script that copies additional packages within a product tree on the Solaris 10 software and Solaris 10 languages CD's to the local disk on an existing install server. #./add_install_client A command that adds network installation information about a system to an install or boot server's /etc files so that the system can install over the network. # ./rm_install_client Removes jumpstart clients that were previously setup for network installation #./check Validates the information in the rules file. Components of Jumpstart server: 1. Boot & Client identification service: These services are provided by a networked boot server and provide the information that a jumpstart client needs to boot using the network. 2. Installation services: These are provided by a networked install server, which provides an image of the Solaris OS environment the jumpstart client uses as its source of data to install. 3. Configuartion services: These are provided by networked configuration server and provide information that a jumpstart client uses to partition disks and create file systems, add/remove Solaris packages and perform other configuration task.

The Boot Server:


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 170

1. Also called the Start-up server, is where the client system access the startup files. 2. When a client is first turned on, it does not have an OS installed or an IP address assigned, therfore, when the client is first started, the boot server provides this information. 3. The boot server running the RARP daemon, in.rarpd, looks up the Ehternet addresss in the /etc/ethers files, checks for corresponding name in its /etc/hosts file, and passes the IPaddress back to the client. Important files which boot server will lookup: /etc/ethers /etc/bootparams /etc/dfs/dfstab /etc/hosts /tftpboot

/etc/ethers: 1. When the jumpstart client boots, it has no IP address; so it broadcasts its Ehternet address to the network using RARP. 2. Boot server receives this request and attempts to match the client's ethernet address with an entry in the local /etc/ethers file. 3. If a match is found, the client name is matched to an entry in the /etc/hosts file. In response to the RARP request from the client, the boot server sends the IP addrss from the /etc/hosts file back to the client. The client continues the boot process using the assigned IP address. 4. An entry for the jumpstart client must be created by editing the /etc/ethers file or by using the add_install_client script.

/etc/bootparams: 1. Contains entries that network clients use for booting. 2. Jumpstart clients retrive the information from this file by issusing requests to server running rpc.bootparamd program.

/tftpboot: 1. When booting over the network, the jumpstart client's boot PROM makes a RARP request, and when it receives a reply the PROM broadcasts a TFTP request to fetch the inetboot file from any server that responds & executes it. The Install server: 1. The boot server and the install server typically the same system. 2. The install server is a networked system that provides Solaris 10 DVD/CD images from which we can install Solaris 10 on another system on the network. The Configuration server: 1. The server that contains a jumpstart configuration directory is called a configuration server. It is usually the same system as the install and boot server, although it can be completely different server. 2. The configuration directory on the configuration server should be owned by root and should have permissions set to 755 (by default).
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 171

3. The configuration directory has rules, rules.ok, class file, the check script and the optional begin and install scripts.

Begin and Finish scripts: 1. A begin script is a user-defined BOURNE shell script, located in the Jumpstart configuration directory on the configuration server, specifies within the rules file, that performs tasks before the Solaris software is installed on the system. 2. Output from the begin script goes to /var/sadm/system/logs/begin.log 3. Begin script should be owned by root with default permission. 4. Finish scripts /var/sadm/system/logs/finish.logs

Procedure to initiate the jumpstart configuration: Installation Service: 1. Create a slice with at least 5 Gb of space for holding the OS image. Here, in our eg we had created a slice (c0d1s5) with 6 Gb. 2. Create the file system for the created slice. # newfs /dev/rdsk/c0d1s5 3. Create a mount point and mount the slice. # mkdir /jump_image # mount /dev/dsk/c0d1s5 /jump_image Note: The slice can also be mounted as permanently, by editing the file /etc/vfstab. 4. Now, mount the cdrom/dvd (OS) either mannauly or using volume management. # /etc/init.d/volmgt start 5. Move to the location # cd /cdrom/Solaris_10/Tools 6. Run the following script from that location. # ./setup_install_server /jump_image This command will do the following functions: a. Check for the mount point, /jump_image b. check for the available space c. Copy the OS image from the CD/DVD to the hard disk drive

Identification Service: WTD? - What to do? 1. Create a dir /jump_image/config Note: It can be with any name. 2. Create a directory in name of the jumpstart client under the above created directory. /jump_image/config/client1 [Optional]
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 172

3. Cretae a file 'sysidcfg' Note: File name should be sysidcfg 4. Share the directory. HTD - How to do? 1. # mkdir /jump_image/config 2. # mkdir /jump_image/config/client1 3. # cd /jump_image/config/client1 4. # vi sysidcfg Edit the file with the following contents: network_interface=Primary { hostname=client1 netmask=255.255.255.0 protocol-ipv6=no default_route=none } name_service=none system_locale=en_US timezone=Asia/Calcutta timeserver=localhost root_password=<copy_and_paste_from_the_/etc/shadow_of_the_server> :wq! 5. # cat >> /etc/dfs/dfstab share -F nfs -o ro /jump_image/config/client1 crtl+d 6. # shareall 7. # svcadm enable nfs/server 8. # share Only to check whether the resources are shared properly.

Configuration server: How the installation proceeds in jumpstart clients Provides information about a. Installation type b. System type c. Disk partitions or file system d. Cluster selection e. Software package addition/deletion

WTD: 1. Create a profile under /jump_image/config/client1 directory in any name. Note: Profile file is also known as CLASS file. 2. Create rules file to choose the right profile for the client in the same directory. e. Run the check script to get rules.ok file
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 173

HTD: 1. # vi /jump_image/config/client1/profile edit the file with the following contents: install_type system_type partitioning filesys filesys cluster package :wq! Note: partitioning explicit It means the manual layout. package SUNWman delete will not install the package SUNWman In the case of X86 client fdisk all solaris all 2. # vi /jump_image/config/client1/rules edit the file with following contents #hostname hostname :wq! 3. # cd /cdrom/Solaris_10/Misc/jumpstart_sample 4. # cp check /jump_image/config/client1 Copy the file check from DVD to the above specified location 5. # cd /jump_image/config/client1 6. # ./check It will verify the rules file. If the syntax is correct it creates the rules.ok file. <jumpstart_client> <pre_script> <profile_name> <post_script> client1 profile initial_install standalone explicit c0t0d0s0 c0t0d0s1 SUNWCall SUNWman

7000 1000 delete

/ swap

Boot server: 1. # vi /etc/ethers edit the file with client's mac address and it's proposed hostname. for eg 8:0:20:a9:bc:36 :wq! 2. # vi /etc/inet/hosts edit the file with proposed ipaddress and proposed hostname of the client. eg:
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

client1

Sun Solaris 10 Operating System

Page 174

192.168.1.123client1 :wq! 3. # cd /cdrom/Solaris_10/Tools # ./add_install_client -C <js_server_name_or_ip:profile> -P <js_server_name:sysidcfg-path> <client_name> <platform_group> eg: # ./add_install_client -C 192.168.1.51:/jump_image/config/client1 -P 192.168.1.51:/jump_image/config/client1 client1 sun4u

On client side at Sun machine: OK boot net - install

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 175

Zone Administration Zone Types: 1. Global zone 2. Non-global zone

Global zones: 1. Has 2 functions 2. Is both the default zone for the system and the zone used for system-wide administrative control. 3. Is the only zone from which a non-global zone can be configured, installed, managed, or uninstalled. 4. Only global zone is bootable from the system hardware. 5. Administration of the system infrastructure, such as physical devices, routing, or dynamic reconfiguration, is ONLY possible in the global zone. 6. Contains a complete installation of the Solaris system software packages. 7. Provides a complete database containing information about all installed components. It also holds configuration information specific to the global zone only, such as the global zone hostname and the file system table. 8. Is the only zone that is aware of all devices and all file systems. 9. Always has the name global. Note: 1. Each zone is also given a unique numeric identifier, which is assigned by the system when the zone is booted. 2. The global zone is always mapped to zone id 0. 3. The system assigns non-zero IDz to non-global zones when they reboot. The number can change when the zone reboots. 4. Non-global zones: 1. Can also contain Solaris software packages shared from the global zone and additional installed software packages not shared from the global zone. 2. Is not aware of the existence of any other zones. It CANNOT install, manage or uninstall itself or any other zones. Zone daemons: 1. Uses 2 daemons to control zone operation. a. zoneadm b. zsched Note: The zoneadm daemon is the primary process for managing the zones virtual platform. There is one zoneadm process running for each active (ready, running or shutting down) zone on the system. Unless the zoneadmd daemon is already running, it is automatically started by the zoneadm command.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 176

Zoneadm: Responsible for: 1. Managing zone booting and shutting down 2. Allocating the zone ID and starting the zsched system process 3. Setting zone-wide resource control (rctl) 4. Preparing the zones devices as specified in the zone configuration 5. Plumbing virtual network interfaces 6. Mounting loopback and conventional file systems

Zsched: Every active zone has associated kernel process, zsched. The zsched process enables the zones subsystem to keep track of per-zone kernel threads. Kernel threads doing work on behalf of the zone are owned by zsched.

Zone file system: There are 2 models for installing root file systems in non-global zones. a. Sparse zone b. Whole root zone Sparse zone: 1. Installs minimal number of files from the global zone when a non-global zone is installed. 2. Only certain root packages are installed in the non-global zone. These include a subset of the required root packages that are normally installed in the global zone, as well as any additional root packaged that the global administrator might have selected. Note: Any files that need to be shared between a non-global zone and the global zone can be mounted as read-only loopback file systems. By default /lib, /usr, /platform and /sbin are mounted in this manner. Once a zone is installed it is no longer dependent on the global zone unless a file system is mounted using a loopback file system. A non-global zone CANNOT be a nfs server.

Whole root zone; 1. All of the required and any selected optional Solaris packages are installed into the private file systems of the zone. 2. Provides the maximum flexibility. 3. Advantages of this model include the capability for global zone administrators to customize their zones file system layout. Zone states: Undefined: The zones configuration has not been completed and committed to stable storage. This state also occurs when a zones configuration has been deleted.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 177

Configured: Zones configuration is complete and committed to stable storage. However, those elements of the zones application environment that must be specified after initial boot are not yet present. Incomplete: This is a transitional state. During an install or uninstall operation, zoneadm sets the state of the target zone to incomplete. Upon successful completion of the operation, the state is set to the correct state. However, a zone that is unable to complete the install process will stop in this state. Installed: During this state, the zones configuration is instantiated on the system. The zoneadm command is used to verify that the configuration can be successfully used on the designated Solaris system. Packages are installed under the zones root path. In this state, the zone has no associated virtual platform. Ready: In this state, the virtual platform for the zone is established. The kernel created the zsched process, network interfaces are plumbed, file systems are mounted, and devices are configured. A unique zone ID is assigned by the system. At this stage, no processes associated with the zone have been started. Running: In this state. The user processes associated with the zone application environment are running. The zone enters the running state as soon as the first user process associated with the application environment is created. Shutting: Down and down- These states are transitional states that are visible while the zone is being halted. However, a zone that is unable to shut down for any reason will stop in one of these states.

Allocating file system space: 1. About 100 Mb of disk space per non-global zone is required when the global zone has been installed with all of the standard Solaris packages. 2. By default, any additional packages installed in the global zone also populate the nonglobal zones. The amount of disk space required must be increased accordingly. The directory location in the non-global zone for these additional packages is specified through the inerhit-pkg-dir resource. 3. An additional 40 Mb of RAM per zones are suggested, but not required on a machine with sufficient swap space.

Usage of # zonecfg command: 1. 2. 3. 4. 5. 6. Create or delete a zone configuration Set properties for resources added to a configuration Query or verify a configuration Commit to a configuration Revert to a previous configuration Exit from a zonecfg session.

Usaage of # zoneadm command; 1. Verify a zones configuration 2. Install a zone 3. Boot a zone
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 178

4. 5. 6. 7. 8.

Reboot a zone Display information about a running zone Move a zone Uninstall a zone Remove a zone using the zonecfg command

In nut shell: Before configuring the zones: Create the zone using zonecfg -z (zonename) command [undefined state] 1. Create the zone path dir manually and the permission should be 700 for that directory 2. Configure the zone using zonecfg command[configured] 3. Install a zone after configuration to change the state to installed[during installationincomplete] from configured 4. Boot the zone after installing it[running state-before this state it goes to ready state where all the n/w interfaces are plumbed, file systems are mounted , devices are configured, unique zone id is assigned to the system].At this ready state no processes associated with this zone is started 5. The state goes to running state where all the processes are started.

Output: Zone configuration steps: bash-3.00# zonecfg -z zones1 zones1: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zones1> create zonecfg:zones1> set zonepath=/etc/zones/zonepractice zonecfg:zones1> set autoboot=true zonecfg:zones1> add fs zonecfg:zones1:fs> set dir=/mnt/zones zonecfg:zones1:fs> set special=c1t0d0s4 zonecfg:zones1:fs> set raw=/dev/rdsk/c1t0d0s4 zonecfg:zones1:fs> set type=ufs zonecfg:zones1:fs> end zonecfg:zones1> add net zonecfg:zones1:net> set physical=eri0 zonecfg:zones1:net> set address=10.2.3.5 zonecfg:zones1:net> end zonecfg:zones1> add attr zonecfg:zones1:attr> set name=zones zonecfg:zones1:attr> set type=string zonecfg:zones1:attr> set value=uint zonecfg:zones1:attr> end zonecfg:zones1> add inherit-pkg-dir zonecfg:zones1:inherit-pkg-dir> set dir=/opt/sfw zonecfg:zones1:inherit-pkg-dir> end zonecfg:zones1> add rctl zonecfg:zones1:rctl> set name=zone.cpu-shares zonecfg:zones1:rctl> add value(priv=privileged,limit=10,action=none) zonecfg:zones1:rctl> end zonecfg:zones1:verify zonecfg:zones1:commit zonecfg:zones1:exit
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 179

Output: To find zone configuration information:

bash-3.00# zonecfg -z zones1 info zonename: zones1 zonepath: /etc/zones/zonepractice brand: native autoboot: true bootargs: pool: limitpriv: scheduling-class: ip-type: shared [cpu-shares: 10] inherit-pkg-dir: dir: /lib inherit-pkg-dir: dir: /platform inherit-pkg-dir: dir: /sbin inherit-pkg-dir: dir: /usr inherit-pkg-dir: dir: /opt/sfw fs: dir: /mnt/zones special: c1t0d0s4 raw: /dev/rdsk/c1t0d0s4 type: ufs options: [] net: address: 10.2.3.5 physical: eri0 defrouter not specified attr: name: zones type: string value: uint rctl: name: zone.cpu-shares value: (priv=privileged,limit=10,action=none) bash-3.00# zonecfg -z zones1 info|more zonename: zones1 zonepath: /etc/zones/zonepractice brand: native autoboot: true bootargs: pool: limitpriv: scheduling-class: ip-type: shared [cpu-shares: 10] inherit-pkg-dir: dir: /lib inherit-pkg-dir:
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 180

dir: /platform inherit-pkg-dir: dir: /sbin inherit-pkg-dir: dir: /usr inherit-pkg-dir: dir: /opt/sfw fs: dir: /mnt/zones special: c1t0d0s4 raw: /dev/rdsk/c1t0d0s4 type: ufs options: [] net: address: 10.2.3.5 physical: eri0 defrouter not specified attr: name: zones type: string value: uint rctl: name: zone.cpu-shares value: (priv=privileged,limit=10,action=none)

Output: To know the configured zone status: # zoneadm list -cp 0:global:running:/::native:shared -:zones1:configured:/etc/zones/zonepractice::native:shared bash-3.00#zoneadm -z zones1 install

bash-3.00#zoneadm -z zones1 boot bash-3.00# zoneadm list -cp 0:global:running:/::native:shared 1:zones1:running:/etc/zones/zonepractice:f84ec383-bfe3-c890-8a7ff74970d40c96:native:shared bash-3.00# zlogin -C zones1 [Connected to zone 'zones1' console]

To halt a zone:

# zoneadm -z zones1 halt

To uninstall a zone: # zoneadm -z zones1 uninstall

To delete a zone: # zonecfg -z zones1 delete

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 181

ZFS ZFS has been designed to be robust, scalable and simple to administer.

ZFS pool storage features: ZFS eliminates the volume managerment altogethe. Instead of forcing us to create virtualized volumes, ZFSaggregates devices into a storage pool. The storage pool describes the physical characteristics of the storage (device layout, data redundancy, and so on,) and acts as arbitrary data store from which the file systems can be created. File systems grow automatically within the space allocated to the storage pool. ZFS is a transactional file system, which means that the file system state is always consistent on disk. With a transactional file system, data is managed using coy on write semantics. ZFS supports storage pools with varying levels of data redundancy, including mirroring and a variation on RAID-5. When a bad data block is detected, ZFS fetches the correct data from another replicated copy, and repairs the bad data, replacing it with the good copy. The file system itself if 128-bit, allowing for 256 quadrillion zettabytes of storage. Directories ca have upto 2 to the power of 48 (256 trillion) entires, and no limit exists on the number of file systems or number of files that can be contained within a file system. A snapshot is a read-only copy of a file system or volume. Snapshots can be created quickly and easily. Intially, snapshots consume no additional space within the pool. Clone A file system whose initial contents are identical to the contents of a snapshot. ZFS component Naming requirements: Each ZFS component must be named according to the following rules; 1. Empty components are not allowed. 2. Each component can only contain alphanumeric characters in addition to the following 4 special characters: a. Undrerscore (_) b. Hypen (-) c. Colon (: ) d. Perion (.) 3. Pool names must begin with a letter, expect that the beginning sequence c(0-9) is not allowed (this is because of the physical naming convention). In addition, pool names that begin with mirror, raidz, or spare are not allowed as these name are reserved. 4. Dataset names must begin with an alphanumeric character. ZFS Hardware and Software requirements and recommendations: 1. A SPARC or X86 system that is running the Solaris 10 6/06 release or later release. 2. The minimum disk size is 128 Mbytes. The minimum amount of disk space required for a storage pool is approximately 64 Mb. 3. The minimum amount of memory recommended to install a Solaris system is 512 Mb. However, for good ZFS performance, at least 1 Gb or more of memory is recommended. 4. Whilst creating a mirrored disk configuration, multiple contorllers are recommended.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 182

ZFS Steps: zpool disk2 zpool zpool zpool zpool zpool zpool zpool zpool create <poolname> <type of pool(mirror/raidz)> <slice1 slice2 .../disk1 ...> add remove attach detach destroy list status replace

zfs zfs zfs zfs zfs zfs zfs zfs zfs zfs zfs zfs

create destroy snapshot rollback clone list set get mount unmount share unshare

Output: Creating a zpool: bash-3.00# zpool create testpool c2d0s7 bash-3.00# zpool list NAME SIZE USED AVAIL testpool 2G 77.5K 2.00G bash-3.00# df -h Filesystem size used /dev/dsk/c1d0s0 20G 10G /devices 0K 0K ctfs 0K 0K proc 0K 0K mnttab 0K 0K swap 3.3G 728K objfs 0K 0K /usr/lib/libc/libc_hwcap2.so.1 20G 10G fd 0K 0K swap 3.3G 48K swap 3.3G 32K testpool 2.0G 24K

CAP 0%

HEALTH ONLINE

ALTROOT -

avail capacity 9.3G 53% 0K 0% 0K 0% 0K 0% 0K 0% 3.3G 1% 0K 0% 9.3G 0K 3.3G 3.3G 2.0G 53% 0% 1% 1% 1%

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /lib/libc.so.1 /dev/fd /tmp /var/run /testpool

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 183

Output: Creating a directory under a zpool: bash-3.00# zfs create testpool/homedir bash-3.00# df -h Filesystem size used avail capacity /dev/dsk/c1d0s0 20G 10G 9.3G 53% /devices 0K 0K 0K 0% ctfs 0K 0K 0K 0% proc 0K 0K 0K 0% mnttab 0K 0K 0K 0% swap 3.3G 728K 3.3G 1% objfs 0K 0K 0K 0% /usr/lib/libc/libc_hwcap2.so.1 20G 10G 9.3G 53% fd 0K 0K 0K 0% swap 3.3G 48K 3.3G 1% swap 3.3G 32K 3.3G 1% testpool 2.0G 25K 2.0G 1% testpool/homedir 2.0G 24K 2.0G 1% bash-3.00# mkfile 100m testpool/homedir/newfile bash-3.00# df -h Filesystem size used avail capacity /dev/dsk/c1d0s0 20G 10G 9.1G 54% /devices 0K 0K 0K 0% ctfs 0K 0K 0K 0% proc 0K 0K 0K 0% mnttab 0K 0K 0K 0% swap 3.1G 728K 3.1G 1% objfs 0K 0K 0K 0% /usr/lib/libc/libc_hwcap2.so.1 20G 10G 9.1G 54% fd 0K 0K 0K 0% swap 3.1G 48K 3.1G 1% swap 3.1G 32K 3.1G 1% testpool 2.0G 25K 1.9G 1% testpool/homedir 2.0G 100M 1.9G 5% Mirror: bash-3.00# zpool create testmirrorpool mirror c2d0s3 c2d0s4 bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT testmirrorpool 4.97G 52.5K 4.97G 0% ONLINE testpool 2G 100M 1.90G 4% ONLINE bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1d0s0 20G 10G 9.1G 54% / /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 3.1G 736K 3.1G 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object /usr/lib/libc/libc_hwcap2.so.1 20G 10G 9.1G 54% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 3.1G 48K 3.1G 1% /tmp
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /lib/libc.so.1 /dev/fd /tmp /var/run /testpool /testpool/homedir

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /lib/libc.so.1 /dev/fd /tmp /var/run /testpool /testpool/homedir

Sun Solaris 10 Operating System

Page 184

swap testpool testpool/homedir testmirrorpool

3.1G 2.0G 2.0G 4.9G

32K 25K 100M 24K

3.1G 1.9G 1.9G 4.9G

1% 1% 5% 1%

/var/run /testpool /testpool/homedir /testmirrorpool

bash-3.00# cat /etc/mnttab #device device #to mount to fsck #

mount point

FS type

fsck pass

mount mount at boot options

testpool /testpool zfs rw,devices,setuid,exec,atime,dev=2d50002 125 8087961 testpool/homedir /testpool/homedir zfs rw,devices,setuid,exec,atime,dev=2d 50003 1258088096 testmirrorpool /testmirrorpool zfs rw,devices,setuid,exec,atime,dev=2d50004 125 8089634

DESTROYING A POOL: bash-3.00# zpool destroy testmirrorpool bash-3.00# zpool list NAME SIZE USED AVAIL testpool 2G 100M 1.90G

CAP 4%

HEALTH ONLINE

ALTROOT -

MANAGING ZFS PROPERTIES: bash-3.00# zfs get all testpool/homedir NAME PROPERTY VALUE testpool/homedir type filesystem testpool/homedir creation Sat Nov 14 11:34 2009 testpool/homedir used 24.5K testpool/homedir available 4.89G testpool/homedir referenced 24.5K testpool/homedir compressratio 1.00x testpool/homedir mounted yes testpool/homedir quota none testpool/homedir reservation none testpool/homedir recordsize 128K testpool/homedir mountpoint /testpool/homedir testpool/homedir sharenfs off testpool/homedir checksum on testpool/homedir compression off testpool/homedir atime on testpool/homedir devices on testpool/homedir exec on testpool/homedir setuid on testpool/homedir readonly off testpool/homedir zoned off testpool/homedir snapdir hidden testpool/homedir aclmode groupmask testpool/homedir aclinherit secure SOURCE default default default default default default default default default default default default default default default default

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 185

bash-3.00# zfs set quota=500m testpool/homedir bash-3.00# zfs set compression=on testpool/homedir bash-3.00# zfs set mounted=no testpool/homedir cannot set mounted property: read only property bash-3.00# zfs get all testpool/homedir NAME PROPERTY VALUE testpool/homedir type filesystem testpool/homedir creation Sat Nov 14 11:34 2009 testpool/homedir used 24.5K testpool/homedir available 500M testpool/homedir referenced 24.5K testpool/homedir compressratio 1.00x testpool/homedir mounted yes testpool/homedir quota 500M testpool/homedir reservation none testpool/homedir recordsize 128K testpool/homedir mountpoint /testpool/homedir testpool/homedir sharenfs off testpool/homedir checksum on testpool/homedir compression on testpool/homedir atime on testpool/homedir devices on testpool/homedir exec on testpool/homedir setuid on testpool/homedir readonly off testpool/homedir zoned off testpool/homedir snapdir hidden testpool/homedir aclmode groupmask testpool/homedir aclinherit secure

SOURCE local default default default default default local default default default default default default default default default

INHERITING ZFS PROPERTIES: bash-3.00# zfs get -r compression testpool NAME PROPERTY VALUE testpool compression off testpool/homedir compression on testpool/homedir/nesteddir compression on bash-3.00# zfs inherit compression testpool/homedir bash-3.00# zfs get -r compression testpool NAME PROPERTY VALUE testpool compression off testpool/homedir compression off testpool/homedir/nesteddir compression on bash-3.00# zfs inherit -r compression testpool/homedir bash-3.00# zfs get -r compression testpool NAME PROPERTY VALUE testpool compression off testpool/homedir compression off testpool/homedir/nesteddir compression off
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

SOURCE default local local

SOURCE default default local

SOURCE default default default

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 186

QUERYING ZFS PROPERTIES: bash-3.00# zfs get checksum testpool/homedir NAME PROPERTY VALUE testpool/homedir checksum on bash-3.00# zfs get all testpool/homedir NAME PROPERTY VALUE testpool/homedir type filesystem testpool/homedir creation Sat Nov 14 11:34 2009 testpool/homedir used 50K testpool/homedir available 500M testpool/homedir referenced 25.5K testpool/homedir compressratio 1.00x testpool/homedir mounted yes testpool/homedir quota 500M testpool/homedir reservation none testpool/homedir recordsize 128K testpool/homedir mountpoint /testpool/homedir testpool/homedir sharenfs off testpool/homedir checksum on testpool/homedir compression off testpool/homedir atime on testpool/homedir devices on testpool/homedir exec on testpool/homedir setuid on testpool/homedir readonly off testpool/homedir zoned off testpool/homedir snapdir hidden testpool/homedir aclmode groupmask testpool/homedir aclinherit secure bash-3.00# zfs get -s local all testpool/homedir NAME PROPERTY VALUE testpool/homedir quota 500M SOURCE default

SOURCE local default default default default default default default default default default default default default default default

SOURCE local

RAID-Z POOL: bash-3.00# zpool create testraid5pool raidz c2d0s3 c2d0s4 c2d0s5 bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT testpool 2G 100M 1.90G 4% ONLINE testraid5pool 14.9G 89K 14.9G 0% ONLINE bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1d0s0 20G 10G 9.1G 54% / /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 3.1G 736K 3.1G 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object /usr/lib/libc/libc_hwcap2.so.1 20G 10G 9.1G 54% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 3.1G 48K 3.1G 1% /tmp
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 187

swap testpool testpool/homedir testraid5pool

3.1G 2.0G 2.0G 9.8G

32K 25K 100M 32K

3.1G 1.9G 1.9G 9.8G

1% 1% 5% 1%

/var/run /testpool /testpool/homedir /testraid5pool

DOUBLE PARITY RAID-Z POOL: bash-3.00# zpool create doubleparityraid5pool raidz2 c2d0s3 c2d0s4 c2d0s5 bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT doubleparityraid5pool 14.9G 158K 14.9G 0% ONLINE testpool 2G 100M 1.90G 4% ONLINE bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1d0s0 20G 10G 9.1G 54% / /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 3.1G 736K 3.1G 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object /usr/lib/libc/libc_hwcap2.so.1 20G 10G 9.1G 54% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 3.1G 48K 3.1G 1% /tmp swap 3.1G 32K 3.1G 1% /var/run testpool 2.0G 25K 1.9G 1% /testpool testpool/homedir 2.0G 100M 1.9G 5% /testpool/homedir doubleparityraid5pool 4.9G 24K 4.9G 1% /doubleparityraid5pool

DRY RUN OF STORAGE POOL CREATION: bash-3.00# zpool create -n testmirrorpool mirror c2d0s3 c2d0s4 would create 'testmirrorpool' with the following layout: testmirrorpool mirror c2d0s3 c2d0s4 bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT testpool 2G 100M 1.90G 4% ONLINE bash-3.00# df / (/dev/dsk/c1d0s0 ):19485132 blocks 2318425 files /devices (/devices ): 0 blocks 0 files /system/contract (ctfs ): 0 blocks 2147483612 files /proc (proc ): 0 blocks 16285 files /etc/mnttab (mnttab ): 0 blocks 0 files /etc/svc/volatile (swap ): 6598720 blocks 293280 files /system/object (objfs ): 0 blocks 2147483444 files /lib/libc.so.1 (/usr/lib/libc/libc_hwcap2.so.1):19485132 blocks 2318425 files /dev/fd (fd ): 0 blocks 0 files /tmp (swap ): 6598720 blocks 293280 files /var/run (swap ): 6598720 blocks 293280 files
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 188

/testpool /testpool/homedir

(testpool (testpool/homedir

): 3923694 blocks ): 3923694 blocks

3923694 files 3923694 files

Note: Here the n option is used not to create a zpool but just to check if it is possible to create it or not. If it is possible, itll give the above output, else itll give the error which is expected to occur when creating the zpool. LISTING THE POOLS AND ZFS: bash-3.00# zpool list NAME testmirrorpool testpool

SIZE 4.97G 2G

USED 52.5K 100M

AVAIL 4.97G 1.90G

CAP 0% 4%

HEALTH ONLINE ONLINE

ALTROOT -

bash-3.00# zpool list -o name,size,health NAME SIZE HEALTH testmirrorpool 4.97G ONLINE testpool 2G ONLINE bash-3.00# zpool status -x all pools are healthy bash-3.00# zpool status -x testmirrorpool pool 'testmirrorpool' is healthy bash-3.00# zpool status -v pool: testmirrorpool state: ONLINE scrub: none requested config: NAME testmirrorpool mirror c2d0s3 c2d0s4 STATE ONLINE ONLINE ONLINE ONLINE READ WRITE CKSUM 0 0 0 0 0 0 0 0 0 0 0 0

errors: No known data errors pool: testpool state: ONLINE scrub: none requested config: NAME testpool c2d0s7 STATE ONLINE ONLINE READ WRITE CKSUM 0 0 0 0 0 0

errors: No known data errors

bash-3.00# zpool status -v testmirrorpool pool: testmirrorpool state: ONLINE scrub: none requested config:

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 189

NAME

STATE READ WRITE testmirrorpool ONLINE mirror ONLINE c2d0s3 ONLINE c2d0s4 ONLINE

CKSUM 0 0 0 0 0 0 0

0 0 0 0

errors: No known data errors

bash-3.00# zfs list NAME testmirrorpool testpool testpool/homedir bash-3.00# zfs list -H testmirrorpool 75.5K testpool 114K testpool/homedir_old

USED 75.5K 100M 100M

AVAIL 4.89G 1.87G 1.87G

REFER 24.5K 25.5K 100M

MOUNTPOINT /testmirrorpool /testpool /testpool/homedir

4.89G 1.97G 24.5K

24.5K 26.5K 1.97G

/testmirrorpool /testpool 24.5K /testpool/homedir_old

bash-3.00# zfs list -o name,sharenfs,mountpoint NAME SHARENFS MOUNTPOINT testmirrorpool off /testmirrorpool testpool off /testpool testpool/homedir_old off /testpool/homedir_old bash-3.00# zfs create testpool/homedir_old/nesteddir bash-3.00# zfs list testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 52K 1.97G 27.5K /testpool/homedir_old bash-3.00# zfs list -r testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 52K 1.97G 27.5K /testpool/homedir_old testpool/homedir_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old/nesteddir bash-3.00# zfs get -r compression testpool NAME PROPERTY VALUE SOURCE testpool compression off default testpool/homedir compression off default testpool/homedir/nesteddir compression off bash-3.00# zfs set compression=on testpool/homedir/nesteddir bash-3.00# zfs get -r compression testpool NAME PROPERTY VALUE SOURCE testpool compression off default testpool/homedir compression off default testpool/homedir/nesteddir compression on bash-3.00# zfs inherit compression testpool/homedir/nesteddir bash-3.00# zfs get -r compression testpool NAME PROPERTY VALUE SOURCE testpool compression off default testpool/homedir compression off default testpool/homedir/nesteddir compression off REFER MOUNTPOINT testmirrorpool 75.5K 4.89G 24.5K /testmirrorpool testpool 114K 1.97G 26.5K /testpool testpool/homedir_old 24.5K 1.97G 24.5K /testpool/homedir_old
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

default

local

default

Sun Solaris 10 Operating System

Page 190

bash-3.00# zfs list -t filesystem -o name,used NAME USED testmirrorpool 75.5K testpool 114K testpool/homedir_old 24.5K

DESTROYING A ZFS: bash-3.00# zfs list NAME testmirrorpool testpool testpool/homedir USED 75.5K 100M 100M AVAIL 4.89G 1.87G 1.87G REFER 24.5K 25.5K 100M MOUNTPOINT /testmirrorpool /testpool /testpool/homedir

bash-3.00# ls -l testpool/homedir/ total 4 drwxr-xr-x 2 root root -rw-r--r-1 root root bash-3.00# pwd /testpool/homedir/newdir

2 Nov 13 11:36 newdir 0 Nov 13 11:36 newfile

bash-3.00# zfs destroy testpool/homedir cannot unmount '/testpool/homedir': Device busy bash-3.00# zfs destroy -f testpool/homedir bash-3.00# zfs list NAME testmirrorpool testpool

USED 75.5K 82K

AVAIL 4.89G 1.97G

REFER 24.5K 24.5K

MOUNTPOINT /testmirrorpool /testpool

bash-3.00# zfs create testpool/homedir/nesteddir bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT testmirrorpool 75.5K 4.89G 24.5K /testmirrorpool testpool 144K 1.97G 26.5K /testpool testpool/homedir 49K 1.97G 24.5K /testpool/homedir testpool/homedir/nesteddir 24.5K 1.97G 24.5K /testpool/homedir/nesteddir bash-3.00# zfs destroy testpool/homedir cannot destroy 'testpool/homedir': filesystem has children use '-r' to destroy the following datasets: testpool/homedir/nesteddir bash-3.00# zfs destroy -r testpool/homedir

RENAMING ZFS: bash-3.00# zfs list NAME testmirrorpool testpool testpool/homedir USED 75.5K 114K 24.5K AVAIL 4.89G 1.97G 1.97G REFER 24.5K 26.5K 24.5K MOUNTPOINT /testmirrorpool /testpool /testpool/homedir
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 191

bash-3.00# zfs rename testpool/homedir testpool/homedir_old bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT testmirrorpool 75.5K 4.89G 24.5K /testmirrorpool testpool 114K 1.97G 26.5K /testpool testpool/homedir_old 24.5K 1.97G 24.5K /testpool/homedir_old bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1d0s0 20G 11G 8.6G 56% / /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 3.1G 736K 3.1G 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object /usr/lib/libc/libc_hwcap2.so.1 20G 11G 8.6G 56% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 3.1G 48K 3.1G 1% /tmp swap 3.1G 32K 3.1G 1% /var/run testpool 2.0G 26K 2.0G 1% /testpool testmirrorpool 4.9G 24K 4.9G 1% /testmirrorpool testpool/homedir_old 2.0G 24K 2.0G 1% /testpool/homedir_old

bash-3.00# zfs create testpool/homedir_old/nesteddir bash-3.00# zfs list testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 52K 1.97G 27.5K /testpool/homedir_old bash-3.00# zfs list -r testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 52K 1.97G 27.5K /testpool/homedir_old testpool/homedir_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old/nesteddir

MOUNTING AND UNMOUNTING ZFS FILESYSTEMS: bash-3.00# zfs get mountpoint testpool/homedir NAME PROPERTY VALUE testpool/homedir mountpoint /testpool/homedir bash-3.00# zfs get mounted testpool/homedir NAME PROPERTY VALUE testpool/homedir mounted yes bash-3.00# zfs set mountpoint=/mnt/altloc testpool/homedir bash-3.00# zfs get mountpoint testpool/homedir NAME PROPERTY VALUE testpool/homedir mountpoint /mnt/altloc LEGACY MOUNT POINTS: Legacy filesystems must be managed through mount and umount commands and the /etc/vfstab file. Unlike normal zfs filesystems, zfs doesn't automatically mount legacy filesystems on boot.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

SOURCE default

SOURCE -

SOURCE local

Sun Solaris 10 Operating System

Page 192

bash-3.00# zfs set mountpoint=legacy testpool/additionaldir bash-3.00# mount -F zfs testpool/additionaldir /mnt/legacy bash-3.00# df -h Filesystem size used /dev/dsk/c1d0s0 20G 11G /devices 0K 0K ctfs 0K 0K proc 0K 0K mnttab 0K 0K swap 3.3G 732K objfs 0K 0K /usr/lib/libc/libc_hwcap2.so.1 20G 11G fd 0K 0K swap 3.3G 48K swap 3.3G 32K testpool 4.9G 24K testpool/homedir 500M 25K testpool/homedir/nesteddir 500M 24K testpool/additionaldir 4.9G 24K

avail capacity 8.6G 56% 0K 0% 0K 0% 0K 0% 0K 0% 3.3G 1% 0K 0% 8.6G 0K 3.3G 3.3G 4.9G 500M 500M 4.9G 56% 0% 1% 1% 1% 1% 1% 1%

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /lib/libc.so.1 /dev/fd /tmp /var/run /testpool /mnt/altloc /mnt/altloc/nesteddir /mnt/legacy

MOUNTING ZFS FILESYSTEMS: bash-3.00# umountall bash-3.00# zfs mount bash-3.00# zfs mount -a bash-3.00# zfs mount testpool/homedir testpool/homedir/nesteddir testpool

/mnt/altloc /mnt/altloc/nesteddir /testpool

Note: 1. zfs mount -a command doesn't mount legacy filesystems. 2. To force a mount on top of a non-empty directory, use the option -O 3. To specify the options like ro, rw use the option -o UNMOUNTING ZFS FILESYSTEMS: bash-3.00# zfs mount testpool testpool/homedir testpool/homedir/nesteddir /testpool /testpool/homedir /testpool/homedir/nesteddir

bash-3.00# zfs unmount /testpool/homedir bash-3.00# zfs mount testpool bash-3.00# zfs mount -a
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

/testpool

Sun Solaris 10 Operating System

Page 193

bash-3.00# zfs umount /testpool/homedir bash-3.00# zfs mount testpool bash-3.00# pwd /testpool/homedir bash-3.00# zfs unmount /testpool/homedir cannot unmount '/testpool/homedir': Device busy bash-3.00# zfs unmount -f /testpool/homedir bash-3.00# zfs mount testpool

/testpool

/testpool

Note: The sub command works both the ways - unmount,umount. This is to provide backwards compatibility.

ZFS WEB-BASED MANAGEMENT: bash-3.00# /usr/sbin/smcwebserver start Starting Sun Java(TM) Web Console Version 3.0.2 ... The console is running bash-3.00# /usr/sbin/smcwebserver enable The enable sub command enables the server to run automatically when the system boots.

ZFS SNAPSHOTS: bash-3.00# zfs list -r NAME USED AVAIL REFER MOUNTPOINT testmirrorpool 75.5K 4.89G 24.5K /testmirrorpool testpool 146K 1.97G 26.5K /testpool testpool/homedir_old 52K 1.97G 27.5K /testpool/homedir_old testpool/homedir_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old/nesteddir bash-3.00# zfs snapshot testpool/homedir_old@snap1 bash-3.00# zfs list -t snapshot NAME USED AVAIL testpool/homedir_old@snap1 0

REFER MOUNTPOINT - 27.5K -

bash-3.00# zfs snapshot -r testpool/homedir_old@snap2 bash-3.00# zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old@snap1 0 - 27.5K testpool/homedir_old@snap2 0 - 27.5K testpool/homedir_old/nesteddir@snap2 0 - 24.5K

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 194

bash-3.00# zfs get all testpool/homedir_old@snap1 NAME PROPERTY VALUE SOURCE testpool/homedir_old@snap1 type snapshot testpool/homedir_old@snap1 creation Fri Nov 13 16:26 2009 testpool/homedir_old@snap1 used 0 testpool/homedir_old@snap1 referenced 27.5K testpool/homedir_old@snap1 compressratio 1.00x

PROPERTIES OF SNAPSHOTS: bash-3.00# zfs get all testpool/homedir_old@snap1 NAME PROPERTY VALUE SOURCE testpool/homedir_old@snap1 type snapshot testpool/homedir_old@snap1 creation Fri Nov 13 16:26 2009 testpool/homedir_old@snap1 used 0 testpool/homedir_old@snap1 referenced 27.5K testpool/homedir_old@snap1 compressratio 1.00x bash-3.00# bash-3.00# zfs set compressratio=2.00x testpool/homedir_old@snap1 cannot set compressratio property: read only property bash-3.00# zfs set compression=on testpool/homedir_old@snap1 cannot set compression property for 'testpool/homedir_old@snap1': snapshot properties cannot be modified

RENAMING ZFS SNAPSHOTS: bash-3.00# zfs rename testpool/homedir_old@snap1 additionalpool/homedir@snap3 cannot rename to 'additionalpool/homedir@snap3': snapshots must be part of same dataset bash-3.00# zfs rename testpool/homedir_old@snap1 testpool/homedir_old@snap3 bash-3.00# zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old@snap3 0 - 27.5K testpool/homedir_old@snap2 0 - 27.5K testpool/homedir_old/nesteddir@snap2 0 - 24.5K

DISPLAYING AND ACCESSING ZFS SNAPSHOTS: bash-3.00# ls /testpool/homedir_old/.zfs/snapshot snap2 snap3 bash-3.00# zfs list -r -t snapshot -o name,creation testpool/homedir_old NAME CREATION testpool/homedir_old@snap3 Fri Nov 13 16:26 2009 testpool/homedir_old@snap2 Fri Nov 13 16:31 2009 testpool/homedir_old/nesteddir@snap2 Fri Nov 13 16:31 2009 ROLLING BACK TO A ZFS SNAPSHOT: bash-3.00# zfs rollback testpool/homedir_old@snap3 cannot rollback to 'testpool/homedir_old@snap3': more recent snapshots exist
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 195

use '-r' to force deletion of the following snapshots: testpool/homedir_old@snap2 bash-3.00# zfs rollback -r testpool/homedir_old@snap3 DESTROYING A ZFS SNAPSHOT: bash-3.00# zfs destroy testpool/homedir_old@snap3 cannot destroy 'testpool/homedir_old@snap3': snapshot has dependent clones use '-R' to destroy the following datasets: testpool/additionaldir/testclone bash-3.00# zfs destroy -R testpool/homedir_old@snap3

CREATING ZFS CLONES: bash-3.00# zfs clone testpool/homedir_old@snap3 testpool/additionaldir/testclone bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT additionalpool 104K 4.89G 25.5K /additionalpool additionalpool/homedir 24.5K 4.89G 24.5K /additionalpool/homedir testmirrorpool 75.5K 4.89G 24.5K /testmirrorpool testpool 185K 1.97G 27.5K /testpool testpool/additionaldir 25.5K 1.97G 25.5K /testpool/additionaldir testpool/additionaldir/testclone 0 1.97G 27.5K /testpool/additionaldir/testclone testpool/homedir_old 52K 1.97G 27.5K /testpool/homedir_old testpool/homedir_old@snap3 0 - 27.5K testpool/homedir_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old/nesteddir testpool/homedir_old/nesteddir@snap2 0 - 24.5K SETTING CLONE PROPERTIES: bash-3.00# zfs get all testpool/additionaldir/testclone NAME PROPERTY VALUE SOURCE testpool/additionaldir/testclone type filesystem testpool/additionaldir/testclone creation Fri Nov 13 16:51 2009 testpool/additionaldir/testclone used 22.5K testpool/additionaldir/testclone available 1.97G testpool/additionaldir/testclone referenced 27.5K testpool/additionaldir/testclone compressratio 1.00x testpool/additionaldir/testclone mounted yes testpool/additionaldir/testclone origin testpool/homedir_old@snap3 testpool/additionaldir/testclone quota none default testpool/additionaldir/testclone reservation none default testpool/additionaldir/testclone recordsize 128K default testpool/additionaldir/testclone mountpoint /testpool/additionaldir/testclone default testpool/additionaldir/testclone sharenfs off local testpool/additionaldir/testclone checksum on default
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 196

testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default testpool/additionaldir/testclone default bash-3.00# zfs set sharenfs=on bash-3.00# zfs set quota=500m

compression atime devices exec setuid readonly zoned snapdir aclmode aclinherit

off on on on on off off hidden groupmask secure

testpool/additionaldir/testclone testpool/additionaldir/testclone

bash-3.00# zfs get sharenfs,quota testpool/additionaldir/testclone NAME PROPERTY VALUE SOURCE testpool/additionaldir/testclone sharenfs on local testpool/additionaldir/testclone quota 500M local

REPLACING A ZFS FILESYSTEM WITH A ZFS CLONE: bash-3.00# zfs list -r testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 74.5K 1.97G 27.5K /testpool/homedir_old testpool/homedir_old@snap3 22.5K - 27.5K testpool/homedir_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old/nesteddir testpool/homedir_old/nesteddir@snap2 0 - 24.5K -

bash-3.00# zfs list -r testpool/additionaldir NAME USED AVAIL REFER MOUNTPOINT testpool/additionaldir 48K 1.97G 25.5K /testpool/additionaldir testpool/additionaldir/testclone 22.5K 500M 27.5K /testpool/additionaldir/testclone bash-3.00# zfs promote testpool/additionaldir/testclone bash-3.00# zfs list -r testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 47K 1.97G 27.5K /testpool/homedir_old testpool/homedir_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old/nesteddir testpool/homedir_old/nesteddir@snap2 0 - 24.5K Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 197

bash-3.00# zfs list -r testpool/additionaldir NAME USED AVAIL REFER MOUNTPOINT testpool/additionaldir 75.5K 1.97G 25.5K /testpool/additionaldir testpool/additionaldir/testclone 50K 500M 27.5K /testpool/additionaldir/testclone testpool/additionaldir/testclone@snap3 22.5K - 27.5K bash-3.00# zfs list -r testpool/homedir_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old 50K 500M 27.5K /testpool/homedir_old testpool/homedir_old@snap3 22.5K - 27.5K bash-3.00# zfs list -r testpool/additionaldir NAME USED AVAIL REFER MOUNTPOINT testpool/additionaldir 24.5K 1.97G 24.5K /testpool/additionaldir bash-3.00# zfs list -r testpool/homedir_old_old NAME USED AVAIL REFER MOUNTPOINT testpool/homedir_old_old 47K 1.97G 27.5K /testpool/homedir_old_old testpool/homedir_old_old/nesteddir 24.5K 1.97G 24.5K /testpool/homedir_old_old/nesteddir testpool/homedir_old_old/nesteddir@snap2 0 - 24.5K DESTROYING ZFS CLONE: bash-3.00# zfs destroy /testpool/homedir_old@snap3

The contents of this material is not affiliated with Sun Microsystems or any of it's affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 198

Volume Manager Solaris Volume Manager/Solstice Disk Suite 4.0 Advantages: Provides 3 major functionalities 1. Overcome the disk size limitation by providing for joining of multiple disk slices to form a bigger volume. 2. Fault tolerance by allowing mirroring of data from one disk to another and keeping parity information in Raid-5. 3. Performance enhancements by allowing spreading of the data.

Disk suite packages: 1. Format of the package is datastream. 2. Packages can manually added by executing the command # pkgadd. 3. SUNWmd - Solstice Disk Suite 4. SUNWmdg - Solstice Disk Suite Tool 5. SUNWmdn - Solstice Disk Suite log daemon

Terminalogy: A. Metadevice: 1. A virtual device composed of several physical devices-slices/disks. 2. Provide increased capacity, higher availability & better performance. 3. Standard metadevice name begins with "d" and is followed by a number. for eg: dnn d10 i. By default 128 unique metadevices in the range between 0 and 127 can be created. ii. Additional metadevices can be added by updating a file /kernel/drv/md.conf. But it may degrade the performance of the system. 4. Metadevice names are located in /dev/md/dsk and /dev/md/rdsk

B. State database/Meta database/md/Replica: 1. Provides non-volatile storage necessary to keep track of configuration & status information for all metadevices, meta mirrors. 2. Also keep track of error conditions that have occured. 3. When the state database is updated each replica is modified once at a time. 4. Needs a dedicated disk slice 5. Has to be created before the logical devices are created. 6. Minimum 3 databases have to be created. 7. N/2 replica is required for the running system. 8. N/2+1 replica is required, when the system reboots. 9. Size of 1 replica is 4Mb.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 199

Note: 512 bytes = 1 sector 1 block = 1 sector 1 block = 1/2 kb 32 block = 16kb 64 block = 32kb 128 block = 64kb By default interlace = 64kb

RAID-0: Concatenation and Stripping: 1. Joining of 2 or more disk slices to add up the disk space. 2. Serial in nature. ie., sequential data operation are performed serially on first disk then the second disk and so on... 3. Due to serial in nature new slices can be added up without having to take the backup of entire concatenated volume. 4. The address space is contigueous-datas will be stored volume by volume. 5. No fault tolerance. 6. Size of the volume = Sum of the all physicall components in that volume

Note: We can use a concatenated/stripped metadevice for any file system with the exception of / (root), swap, /usr, /var, /opt or any file system accessed during a Solaris upgrade or install.

Stripping: 1. Spreading of data over multiple disk drives mainly to enhance the performance by distributing data. 2. Data is divided into equal sized chunks. By default 16kb. Chunks=interlace 3. Interlace value tells disk suite how much data is placed on a component before moving to the next component of the stripe. 4. Because the data is spread across a stripe, we gain increased performabce as read/write are spread across multiple disk. 5. Size of the volume = N * smallest size of the physical component in that volume 6. No falut tolerance

Raid-1 Mirroring: 1. Write performance is slow. 2. Provides fault tolerance 3. Provides data retundancy by simultaneously writing data on to two sub-mirrors. Note: a. Meta mirror is a special type of meta device made up of one or more other meta devices. Each meta device within a meta mirror is called a sub-mirror. b. Meta mirror can be defined by using metainit. i. additional sub-mirrors can be added at later stage without bringing the system down or disrupting the read and write to existing meta mirror. ii. "metatach" used, to which attaches a sub-mirror to a meta mirror.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 200

iii. When attached, all the data from another sub-mirror in the metamirror is automatically written to the newly attached sub-mirror. This is called "resyncing". iv. Once metattach is performed, the sub-mirror remain attached even when the system is rebooted.

Raid-5: 1. Provides fault tolerance 2. data retundancy 3. uses less space when compared with mirroring 4. data is divided into stripes and the parity is calculated from the data, then they are stored in such a manner parity is distributed or rotated. 5. Size of the volume = (N-1)*smallest physical volume

System files associated with the disk suite: 1. 3 system files 2. a. /etc/lvm/md.tab b. /etc/lvm/md.cf c. /etc/lvm/mddb.cf 3. a. /etc/lvm/md.tab i. used by metainit and metadb commands as a workspace ii. each meta device may have a unique entry iii. used only when creating metadevices, hot spares/database replicas iv. not automatically updated by disk suite utilities v. have little or no correspondence with actual meta devices, hot spare or replicas. vi. Input file used by metainit, metadb,metahs vii. The output from this file is similar to that displayed when # metastat -p viii. # metainit -a => update this file

3.b. /etc/lvm/md.cf i. automatically updated whenever the configuration is changed ii. basically a disaster recovery file and should never be edited. iii. the md.cf file does not get updated when hot sparing occurs. iv. should never be used blindly after a disaster. Be sure to examine the file first. Output: bash-3.00# cat /etc/lvm/md.cf # metadevice configuration file # do not hand edit d100 1 1 c1d0s4

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 201

3.c. /etc/lvm/mddb.cf i. Created whenever the 'metadb' command is run and is used by command 'metainit' to find locations of the meta device state database. ii. never edit this file iii. each meta device state database replica has a unique entry in the file. Output: bash-3.00# cat /etc/lvm/mddb.cf #metadevice database location file do not hand edit #driver minor_t daddr_t device id checksum cmdk 7 16 id1,cmdk@ASEAGATE_ST32500NSSUN250G_0732B4B31T=5QE4B31T/h -4269 cmdk 7 8208 id1,cmdk@ASEAGATE_ST32500NSSUN250G_0732B4B31T=5QE4B31T/h -12461 cmdk 7 16400 id1,cmdk@ASEAGATE_ST32500NSSUN250G_0732B4B31T=5QE4B31T/h -20653

4. /kernel/drv/md.conf a. used by the metadisk driver, when it is initially loaded. b. the only modified field in the file is "nmd" nmd = reprsesnts the number of meta devices supported by the driver c. If the filed is modified, perform reconfiguration boot to build meta devices. (OK boot -r) d. If "nmd" is lowered, any meta device existing between the old number and the new number MAY NOT PERSISTENT. e. default:128 f. supports upto 1024 g. if larger number of meta devices are added, performance degradation will happen. h. if larger metadevices are added, replica/state database has to be increased.

Hot spares: 1. Disk suite's hot spare facility automatically replaces failed sub-mirror/Raid components, provided that a spare component is available and reserved. 2. Are temporary fixes, used until failed components are either repaired or replaced. Hot spare pool: 1. Is a collection of slices reserved by Disk suite to be automatically substituted in case of a slice failure in either a sub-mirror or Raid-5 meta device. 2. May be allocated, relocated or reassigned at any time unless a slice in that hot spare pool is being used to replace damaged slice of its associated meta devices.

Operations performed on meta device: 1. mount the meta device in a directory 2. unmount the meta device 3. copy the files to the meta device 4. read and write the files from and to the meta device 5. ufsdump & ufsrestore the meta device

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 202

Commands used in svm: 1. # metarecover recover soft partition information. scans a specified component to look for soft partition configuration information & to regenerated the configuration. 2. # metareplace enable/replace components of sub-mirrors/Raid-5 meta devices 3. # metaroot setup system fils for / (root). edit the file /etc/system and /etc/vfstab 4. # metastat display status for meta devices or hot spare pool 5. # metasync handle meta device resync during reboot. 6. # metattach # metdetach attach/detach a meta device 7. # metainit configure the meta device 8. # metaparam modify the parameters of the meta devices 9. # growfs non-destructively expand a UFS file system 10. # metaclear delete active meta devices and hot spare spools 11. # metadb create & delete replicas of the meta device state database

12. # metahs manage hot spares and hot spare spools

To create a replica/meta state database/metadb: Remember: 1. Before creating a replica, make sure the existence of the dedicated slice to the replica. 2. we can create a slice with 50mb or 100mb. 3. No file system is required in that slice. 4. Once the slice is dedicated for the replica, it can't be deleted unless all the metadevices are removed. 5. We cannot remove a single replica from the slice. All the replicas available in the slice can be deleted.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 203

# metadb -afc3 c0d1s7 here metadb = is the command to create the replicas -a = to add the replica to the slice c0d1s7 -f = since we are creating the replica for the first time -c = specify the count of the replica. Note: 1. Minimum requirement is 3 replica. # metadb # metadb -i will display the information about the existing replica and its status. # metadb -d c0d1s5 will delete all the replicas created at the slice c0d1s5. # metadb -d -f c0d1s7 will forcefully delete all the replicas in the slice c0d1s7. This is done when the last, least replica is going to be removed. Note: Before deleting the last replica, make sure no meta device is existing. Outputs: bash-3.00# metadb -afc6 c1d0s7 bash-3.00# metadb flags first blk a u 16 a u 8208 a u 16400 a u 24592 a u 32784 a u 40976

block count 8192 8192 8192 8192 8192 8192

/dev/dsk/c1d0s7 /dev/dsk/c1d0s7 /dev/dsk/c1d0s7 /dev/dsk/c1d0s7 /dev/dsk/c1d0s7 /dev/dsk/c1d0s7

How to create a meta devices: # metainit <name_of_meta_device> <no_of_stripe> <no_slice> <physical_component>

Eg: 1. # metainit d0 1 1 c0d1s4 here metainit = to create a meta device d0 = name of the meta device 1 = number of stripes 1 = number of physical components/slices c0d1s4 = is the physical component

2. # metainit d1 1 2 c0t1d0s4 c0t2d0s4 here


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 204

d1 = name of the meta device 1 = number of stripes 2 = number of physcial components c0t1d0s4, c0t2d0s4 = are the physical components so, a meta device d1 is going to have 1 stripe with 2 slices. Note: Make sure that the slices exist before creating a meta device. 3. # metainit d3 3 1 c0t0d0s4 1 c0t2d0s2 2 c0t3d0s1 c0t3d0s3 A B C here d3 = is the name of the meta device 3 = number of stripes here 3 stripes A = first stripe has 1 physical component c0t0d0s4 B = second stripe has 1 physical component c0t2d0s2 Note: A complete hard disk connected to the target t2 is dedicated to the stripe 2. C = third stripe has 2 physical components c0t3d0s1, c0t3d0s3

To remove the meta device: Note: Before clearing the meta device make sure that the meta device is umounted. # metaclear <meta_device_name> eg: # metaclear d0 will remove the meta device d0 To view the status of the meta devices: # metastat # metastat -p will display the status of the meta device

Outputs: Note: To create a metadevice, displaying the meta device status, clearing the meta device bash-3.00# metainit d0 1 1 c1d0s3 d0: Concat/Stripe is setup bash-3.00# metastat d0: Concat/Stripe Size: 2104515 blocks (1.0 GB) Stripe 0: Device Start Block Dbase c1d0s3 0 No

Reloc Yes

Device Relocation Information: Device Reloc Device ID c1d0 Yes id1,cmdk@ASEAGATE_ST32500NSSUN250G_0732B4ES6R=5QE4ES6R bash-3.00# metastat -p d0 1 1 c1d0s3 bash-3.00# metastat -p d10 1 3 c1d0s4 c1d0s5 c1d0s6 -i 32b
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 205

d0 1 1 c1d0s3 bash-3.00# metainit d20 2 2 c2d0s0 c2d0s1 2 c2d0s3 c2d0s4 -i 64b d20: Concat/Stripe is setup bash-3.00# metastat d20: Concat/Stripe Size: 8388608 blocks (4.0 GB) Stripe 0: (interlace: 32 blocks) Device Start Block Dbase Reloc c2d0s0 0 No Yes c2d0s1 0 No Yes Stripe 1: (interlace: 64 blocks) Device Start Block Dbase Reloc c2d0s3 0 No Yes c2d0s4 0 No Yes d10: Concat/Stripe Size: 6297480 blocks (3.0 GB) Stripe 0: (interlace: 32 blocks) Device Start Block Dbase c1d0s4 0 No c1d0s5 0 No c1d0s6 0 No d0: Concat/Stripe Size: 2104515 blocks (1.0 GB) Stripe 0: Device Start Block Dbase c1d0s3 0 No

Reloc Yes Yes Yes

Reloc Yes

Device Relocation Information: Device Reloc Device ID c2d0 Yes id1,cmdk@ASEAGATE_ST32500NSSUN250G_0732B4B3Q1=5QE4B3Q1 c1d0 Yes id1,cmdk@ASEAGATE_ST32500NSSUN250G_0732B4ES6R=5QE4ES6R bash-3.00# newfs /dev/md/rdsk/d0 newfs: construct a new file system /dev/md/rdsk/d0: (y/n)? y Warning: 12286 sector(s) in last cylinder unallocated /dev/md/rdsk/d0: 2104514 sectors in 140 cylinders of 240 tracks, 63 sectors 1027.6MB in 24 cyl groups (6 c/g, 44.30MB/g, 10688 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 90816, 181600, 272384, 363168, 453952, 544736, 635520, 726304, 817088, 1271008, 1361792, 1452576, 1543360, 1634144, 1724928, 1815712, 1906496, 1997280, 2088064

To Mount the metadeivce: bash-3.00# mount /dev/md/dsk/d0 /mnt/meta0

Example entry to mount the meta device perm- by editing the file /etc/vfstab: /dev/md/dsk/d0 - /mnt/meta0 ufs - yes -

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 206

Output: bash-3.00# metastat -p d20 2 2 c2d0s0 c2d0s1 -i 32b \ 2 c2d0s3 c2d0s4 -i 64b d10 1 3 c1d0s4 c1d0s5 c1d0s6 -i 32b d0 1 1 c1d0s3

To clear the meta device: bash-3.00# metaclear d10 d10: Concat/Stripe is cleared bash-3.00# metastat -p d20 2 2 c2d0s0 c2d0s1 -i 32b \ 2 c2d0s3 c2d0s4 -i 64b d0 1 1 c1d0s3

Creating a mirror: 1. A mirror is a meta device composed of one or more sub-mirrors. Sub-mirror: a. Is made up of one or more striped or concatenated meta deices. b. Each meta device within a meta mirror is called a sub mirror. 2. Mirroring data provides us with maximum data availabilty by maintaining multiple copies of our data. 3. The system must contain atleast 3 state database replica before creating mirrors. 4. Any file system including / (root), swap and /usr or any application such as database can use a mirror. 5. An error on a component does not cause the entire mirror to fail. 6. To get maximum protection & performance, place mirrored (mirrors) meta devices on different physical components (disks) & on different disk controllers. Since the primary purpose of mirroring is to maintain availabilty of data, defining mirrored meta devices on the same disk is NOT RECOMMENDED. 7. When mirroring existing file system/data, be sure that the existing data is contained in the sub-mirror. When second sub-mirror is subsequenlty attached, data from the initial sub-mirror is copied on ot the attached sub-mirror.

What to do? 1. Create a simple meta device ( 1 stripe with 1 slice) 2. Create another simple meta device ( 1 stripe with 1 slice) 3. Create a mirror meta device and associate with one meta device (adding first way sub-mirror) 4. Attach another meta device with mirror meta device (adding second sub-mirror) 5. Mount the mirrored meta device 6. Access the mount point. How to do? 1. # metainit d10 1 1 c0t1d0s3 2. # metainit d20 1 1 c0t2d0s3 3. # metainit d30 -m d10
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 207

A B A = main mirror B = sub-mirror Converting d10 into d30 as a mirror. 4. # metattach d30 d20 attaching d20 to d30. d20 is the second sub-mirror. 5. # metastat | grep % will display the sync status. 6. # newfs /dev/md/rdsk/d30 # mkdir /mirror # mount /dev/md/dsk/d30 /mirror # cd /mirror

Note: 1. Sync will happen after attaching to the mirror. 2. Slices has to be with same size & geometry, if not greater than the source size is recommended. How to break the mirror: 1. Deattach the sub-mirror from the mirror which is umounted. 2. Clear the mirror and sub-mirror meta devices. 3. Mount the individual slice, the same data will be avialable in both the physical components. How to do? 1. # metadetach d30 d20 # metadetach<main-mirror> <sub-mirror> will remove d20 from the meta device d30. NOTE: THE EXAMPLE COMMANDS AND 2. # metaclear d20 OUTPUTS WILL DIFFER FOR ALL Clears/removes the meta device d20 REALTED TO SVM 3. # metaclear -r d30 will removes both the meta device d30 and d10. 4. # mkdir /d1 # mkdir /d2 # mount /dev/dsk/c0t1d0s3 /d1 # mount /dev/dsk/c0t2d0s3 /d2 # ls /d1 ; ls /d2 will display the contents of /d1 and /d2 respectively. contents remains same in both the slices and mount point.

Outputs: bash-3.00# metainit d30 1 1 c1d0s4 d30: Concat/Stripe is setup bash-3.00# metainit d40 1 1 c2d0s6 d40: Concat/Stripe is setup bash-3.00# metainit d35 -m d30 d35: Mirror is setup bash-3.00# metattach d35 d40 d35: submirror d40 is attached bash-3.00# metastat | grep % Resync in progress: 45 % done
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

NOTE: THE EXAMPLE COMMANDS AND OUTPUTS WILL DIFFER FOR ALL REALTED TO SVM

Sun Solaris 10 Operating System

Page 208

bash-3.00# metastat | grep % bash-3.00# bash-3.00# metastat d35: Mirror Submirror 0: d30 State: Okay Submirror 1: d40 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 2104515 blocks (1.0 GB) d30: Submirror of d35 State: Okay Size: 2104515 blocks (1.0 GB) Stripe 0: Device Start Block Dbase c1d0s4 0 No

State Reloc Hot Spare Okay Yes

Replacing the failure hard disk drives: 1. If any sub-mirror fails, still data can be accessed using mirror device. 2. Suppose if we remove one disk which contains the 2nd sub-mirror, still we can access the data. 3. But the state of the 2nd sub mirror will be OKAY in the output of 'metastat' command, till we create any new file/modification in the mirror is preformed. After chages only, the state will be chanaged to 'MAINTENANCE'. Replacing the failed disk with different target: # metareplace <mirror_device> <failed_slice> <new_slice> # metareplace d30 c0t1d0s3 c0t3d0s5

Replacing the failed disk in the same target/destination: # metareplace -e d30 c0t1d0s3

Soft partition: 1. Dividing one logical component (meta device) into many soft paritions. It can be laid out over physical disk/slices. # metainit d5 1 1 c0t11d0s6 Consider the size of the c0t11d0s6 size is 10gb. Then the size of the meta device d5 is of 10gb. # metainit d61 -p d5 1g A B C here metainit = to create a soft partition -p = to create a soft partition A d61 = the new meta device going to be created
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 209

B d5 = is the existing meta device with 10gb of sise. C 1g = is the size of the new meta device d61 # metainit d62 -p d5 1g

# metaclear d61 Removes the soft partition d61 only. # metaclear -p d5 Will remove all soft partitions from d5.

Soft partition is a means of dividing a disk or volume into as many partitions as needed, overcoming the current limitation of 7. This is done by creating logical partitions within physical disk slices or logical volumes. Soft partitions differ from hard disk slices created using 'format' command because soft partitions can be non-contiguous, where as a hard disk slices are contiguous. Therefore soft partitions can cause I/O performance degradation. Note: 1. No automatic problem detection is available in SVM. 2. The SVM s/w does not detect problems with state database/replica until there is a change to an existing SVM configuration and an update to the database replicas is required. If in-sufficient state database replicas are available, you'll need to boot to single user mode, and delete/replace enough of the corrupted/missing database replicas to achieve the quoram.

Outputs: soft partitions: d502: Soft Partition Device: d500 State: Okay Size: 204800 blocks (100 MB) Extent Start Block 0 2097216 d500: Concat/Stripe Size: 7143424 blocks (3.4 GB) Stripe 0: (interlace: 32 blocks) Device Start Block Dbase c2t2d0s1 0 No c2t2d0s3 0 No c2t2d0s4 0 No c2t2d0s5 0 No c2t14d0s4 0 No c2t14d0s5 0 No c2t14d0s6 0 No d501: Soft Partition Device: d500 State: Okay Size: 2097152 blocks (1.0 GB) Extent Start Block 0 32
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Block count 204800

State Reloc Hot Spare Okay Yes Okay Yes Okay Yes Okay Yes Okay Yes Okay Yes Okay Yes

Block count 2097152


Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 210

bash-3.00# cat /etc/lvm/md.cf # metadevice configuration file # do not hand edit d5 -m d0 d10 1 d0 1 1 c2t2d0s0 d10 1 1 c2t14d0s0 d1000 -r c2t4d0s1 c2t14d0s1 c2t12d0s1 -k -i 32b d20 -r c2t4d0s0 c2t14d0s3 c2t12d0s0 -k -i 32b d502 -p d500 -o 2097216 -b 204800 d500 1 7 c2t2d0s1 c2t2d0s3 c2t2d0s4 c2t2d0s5 c2t14d0s4 c2t14d0s5 c2t14d0s6 -i 32b d501 -p d500 -o 32 -b 2097152

Raid-5: # metainit <meta_device_name> -r <component1> <component2> <component3> # metainit d100 -r c0t0d0s4 c0t1d0s4 c0t2d0s4 -r = specifies that the configuration is RAID level 5. # metastat | grep %

Outputs: bash# d20 -r c2t4d0s0 c2t14d0s3 c2t12d0s0 # metastat Raid-5: d1000: RAID State: Okay Interlace: 32 blocks Size: 2031616 blocks (992 MB) Original device: Size: 2047296 blocks (999 MB) Device Start Block Dbase c2t4d0s1 330 No c2t14d0s1 330 No c2t12d0s1 330 No

State Reloc Okay Yes Okay Yes Okay Yes

Hot Spare

d20: RAID State: Okay Interlace: 32 blocks Size: 2031616 blocks (992 MB) Original device: Size: 2044288 blocks (998 MB) Device Start Block Dbase c2t4d0s0 330 No c2t14d0s3 330 No c2t12d0s0 330 No bash-3.00# cat /etc/lvm/md.cf # metadevice configuration file # do not hand edit d5 -m d0 d10 1
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

State Reloc Okay Yes Okay Yes Okay Yes

Hot Spare

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 211

d0 1 1 c2t2d0s0 d10 1 1 c2t14d0s0 CC -k -i 32b d20 -r c2t4d0s0 c2t14d0s3 c2t12d0s0 -k -i 32b d502 -p d500 -o 2097216 -b 204800 d500 1 7 c2t2d0s1 c2t2d0s3 c2t2d0s4 c2t2d0s5 c2t14d0s4 c2t14d0s5 c2t14d0s6 -i 32b d501 -p d500 -o 32 -b 2097152

Expanding a file system: Note: 1. Once a file system is expanded it cannot be shrink. 2. Aborting a 'growfs' command may cause temporary loss of free space. The space can be recovered using 'fsck' command after the file system is ummounted using 'umount'. 3. 'growfs' command non-destructively expands a file system upto the size of the file system's physical device or meta device. 4. 'growfs' write locks the file system when expanding a mounted file system. Access times are not kekp while the file system is write-locked. The 'lockfs' command can be used to check the file system losck status and unlock the file system in the unlikely event that 'growfs' aborts without unlocking the file system. 5. We can perform, a. expanding a non-metadevice component b. expanding a mounted file system c. expanding a mounted file system to an existing meta mirror d. expanding an um=nmounted file system e. expanding a mounted file system using stripes. 6. 'growfs' a. attach the disk space b. grow the space 1. # newfs /dev/rdsk/c0t1d0s3 # mkdir /expand # mount /dev/dsk/c0t1d0s4 /expand # metainit -f d100 1 1 c0t1d0s3 # umount /expand # mount /dev/md/dsk/d100 /expand # metattach d100 c0t10d0s6 New slice6 is attached to d100 # growfs -M /expand /dev/md/rdsk/d100 Raw disk is expanded now

Growing a mirror: 1. Attach each individual component to each sub-mirror 2. Grow the mirror # # # # # # # # # # metainit d21 1 1 c0t10d0s3 => 400mb metainit d22 1 1 c0t11d0s3 => 400mb metainit d23 -m d21 => one-way mirror metattach d23 d22 => two-way mirror newfs /dev/md/rdsk/d23 mkdir /mirror mount /dev/md/dsk/d23 /mirror metattach d21 c0t10d0s4 => attaching disk space 400mb to sub-mirror metattach d22 c0t11d0s4 => attaching disk space 400mb to sub-mirror growfs -M /mirror /dev/md/rdsk/d23
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 212

=> mirror will be exapnded to 800mb. # df -h

Growing the RAID-5 device: # metainit d75 -r c0t10d0s3 c0t10d0s4 c0t11d0s3 => each slice with 400mb # newfs /dev/md/rdsk/d75 # mkdir /raid5 # mount /dev/md/dsk/d75 /raid5 # metattach d75 c0t11d0s6 Slice size in 500 mb; but it'll take only 400mb # growfs -M /raid5 /dev/md/rdsk/d75 # df -h Note: The newly attached slcie will have only data. It won't be used for storing parity information. -M = (directory name) The file system to be expanded is mounted on directory name. File system locking will be used.

Outputs: Growing the file system: bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1t0d0s0 9.6G 5.0G 4.5G 53% / /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.1G 1.5M 2.1G 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.1G 80K 2.1G 1% /tmp swap 2.1G 40K 2.1G 1% /var/run /dev/md/dsk/d5 466M 1.1M 419M 1% /mnt/mirror /dev/md/dsk/d50 935M 1.0M 887M 1% /mnt/concat_grow bash-3.00# pwd /mnt/concat_grow bash-3.00# growfs -M /mnt/concat_grow /dev/md/rdsk/d50 /dev/md/rdsk/d50: Unable to find Media type. Proceeding with system determined parameters. /dev/md/rdsk/d50: 3047424 sectors in 93 cylinders of 128 tracks, 256 sectors 1488.0MB in 47 cyl groups (2 c/g, 32.00MB/g, 15040 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 65824, 131616, 197408, 263200, 328992, 394784, 460576, 526368, 592160, 2434336, 2500128, 2565920, 2631712, 2697504, 2763296, 2829088, 2894880, 2960672, 3026464 bash-3.00# pwd /mnt/concat_grow
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 213

Growing the size for raid-5 component while it's mounted, w/o loss of data: bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1t0d0s0 9.6G 5.0G 4.5G 53% / /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.1G 1.5M 2.1G 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.1G 80K 2.1G 1% /tmp swap 2.1G 40K 2.1G 1% /var/run /dev/md/dsk/d5 466M 1.1M 419M 1% /mnt/mirror /dev/md/dsk/d50 1.4G 1.5M 1.3G 1% /mnt/concat_grow /dev/md/dsk/d1000 935M 1.0M 877M 1% /mnt/raid5-2 bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c2t2d0s0 d10 1 1 c2t14d0s0 d1000 -r c2t4d0s1 c2t14d0s1 c2t12d0s1 -k -i 32b d20 -r c2t4d0s0 c2t14d0s3 c2t12d0s0 -k -i 32b d50 3 1 c2t4d0s3 \ 1 c2t4d0s4 \ 1 c2t4d0s5 d502 -p d500 -o 2097216 -b 204800 d500 1 7 c2t2d0s1 c2t2d0s3 c2t2d0s4 c2t2d0s5 c2t14d0s4 c2t14d0s5 c2t14d0s6 -i 32b d501 -p d500 -o 32 -b 2097152 bash-3.00# metattach d1000 c2t11d0s1 d1000: component is attached

bash-3.00# growfs -M /mnt/raid5-2 /dev/md/rdsk/d1000 /dev/md/rdsk/d1000: Unable to find Media type. Proceeding with system determined parameters. /dev/md/rdsk/d1000: 3047424 sectors in 93 cylinders of 128 tracks, 256 sectors 1488.0MB in 47 cyl groups (2 c/g, 32.00MB/g, 15040 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 65824, 131616, 197408, 263200, 328992, 394784, 460576, 526368, 592160, 2434336, 2500128, 2565920, 2631712, 2697504, 2763296, 2829088, 2894880, 2960672, 3026464 bash-3.00# df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1t0d0s0 9.6G 5.0G 4.5G 53% / /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.1G 1.5M 2.1G 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object sharefs 0K 0K 0K 0% /etc/dfs/sharetab
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 214

fd swap swap /dev/md/dsk/d5 /dev/md/dsk/d50 /dev/md/dsk/d1000 bash-3.00# ls aggregation.conf printers.conf coreadm.conf rmmount.conf dacf.conf rpld.conf dumpadm.conf scrollkeeper.conf

0K 2.1G 2.1G 466M 1.4G 1.4G

0K 80K 40K 1.1M 1.5M 1.5M

0K 2.1G 2.1G 419M 1.3G 1.3G

0% 1% 1% 1% 1% 1%

/dev/fd /tmp /var/run /mnt/mirror /mnt/concat_grow /mnt/raid5-2 nscd.conf nsswitch.conf pam.conf power.conf

esd.conf sdp.conf hba.conf syslog.conf ima.conf vold.conf inetd.conf

logadm.conf lost+found mpapi.conf nfssec.conf

Growing the space to a mirror: bash-3.00# df -h Filesystem /dev/dsk/c1t0d0s0 /devices ctfs proc mnttab swap objfs sharefs fd swap swap /dev/md/dsk/d5 /dev/md/dsk/d50 /dev/md/dsk/d1000 size 9.6G 0K 0K 0K 0K 2.1G 0K 0K 0K 2.1G 2.1G 466M 1.4G 1.4G used 5.0G 0K 0K 0K 0K 1.5M 0K 0K 0K 80K 40K 1.1M 1.5M 1.5M avail capacity 4.5G 53% 0K 0% 0K 0% 0K 0% 0K 0% 2.1G 1% 0K 0% 0K 0% 0K 0% 2.1G 1% 2.1G 1% 419M 1% 1.3G 1% 1.3G 1% Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /etc/dfs/sharetab /dev/fd /tmp /var/run /mnt/mirror /mnt/concat_grow /mnt/raid5-2

bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c2t2d0s0 d10 1 1 c2t14d0s0 d1000 -r c2t4d0s1 c2t14d0s1 c2t12d0s1 c2t11d0s1 -k -i 32b -o 3 d20 -r c2t4d0s0 c2t14d0s3 c2t12d0s0 -k -i 32b d50 3 1 c2t4d0s3 \ 1 c2t4d0s4 \ 1 c2t4d0s5 d502 -p d500 -o 2097216 -b 204800 d500 1 7 c2t2d0s1 c2t2d0s3 c2t2d0s4 c2t2d0s5 c2t14d0s4 c2t14d0s5 c2t14d0s6 -i 32b d501 -p d500 -o 32 -b 2097152 bash-3.00# metattach d0 c2t11d0s3 d0: component is attached bash-3.00# metattach d10 c2t11d0s4 d10: component is attached bash-3.00# growfs -M /mnt/mirror /dev/md/rdsk/d5 /dev/md/rdsk/d5: Unable to find Media type. Proceeding with system determined parameters.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 215

/dev/md/rdsk/d5: 2031616 sectors in 62 cylinders of 128 tracks, 256 sectors 992.0MB in 31 cyl groups (2 c/g, 32.00MB/g, 15040 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 65824, 131616, 197408, 263200, 328992, 394784, 460576, 526368, 592160, 1381664, 1447456, 1513248, 1579040, 1644832, 1710624, 1776416, 1842208, 1908000, 1973792 bash-3.00# df -h Filesystem /dev/dsk/c1t0d0s0 /devices ctfs proc mnttab swap objfs sharefs fd swap swap /dev/md/dsk/d5 /dev/md/dsk/d50 /dev/md/dsk/d1000

size 9.6G 0K 0K 0K 0K 2.1G 0K 0K 0K 2.1G 2.1G 935M 1.4G 1.4G

used 5.0G 0K 0K 0K 0K 1.5M 0K 0K 0K 80K 40K 1.1M 1.5M 1.5M

avail capacity 4.5G 53% 0K 0% 0K 0% 0K 0% 0K 0% 2.1G 1% 0K 0% 0K 0% 0K 0% 2.1G 1% 2.1G 1% 887M 1% 1.3G 1% 1.3G 1%

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /etc/dfs/sharetab /dev/fd /tmp /var/run /mnt/mirror /mnt/concat_grow /mnt/raid5-2

ROOT MIRRORING: WHAT TO DO? 1. Ensure that the alternate disk has equal geometry & size. 2. Take backup of /etc/system and /etc/vfstab file. 3. Copy VTOC from root (booting) disk to the alternate disk. 4. Ensure that the state database is created. 5. Convert the root slice as a logical component forcefully. 6. Create another metadevice for duplicating root slice. 7. Convert the swap slice as a logical component forcefully. 8. Create another metadevce for duplicating the swap slice. 9. Associaiate first sub-mirror (for root) to mirror root. 10. Associate first sub-mirror (for swap) to mirror swap. 11. Update the system & vfstab file by running 'metaroot' command. 12. Reboot the system. 13. Associate the second sub-mirror to mirror root. 14. Associate the second sub-mirror to mirror swap. 15. Install boot block or grub in the alternate root slice 16. See the physical path for the alternate disk 17 Set alias name in the OK prompt. 18. Set boot sequence in OK prompt.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 216

How to do? 1. # format To create the slices manually. 2. # cp /etc/system /etc/system.orig # cp /etc/vfstab /etc/vfstab.orig 3. # prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t12d0s2 Note: fmthard -> populate lable on the new hard disk drive 4. # metadb -afc3 c0t8d0s7 c0t10d0s7 c0t12d0s7 (if the replicas are existing, this step can be avoided) 5. # metainit -f d5 1 1 c0t8d0s0 Converting forcefully the root slice as a metadevice 6. # metainit d10 1 1 c0t12d0s0 Creating another metadevice for root 7. # metainit -f d25 1 1 c0t8d0s1 Converting forcefull the swap slice as a metadevice 8. # metainit d30 1 1 c0t12d0s1 Creating another metadevice for swap 9. # metainit d15 -m d5 Associating d5 with d15 Here d15 = main mirror for root 10. # metainit d35 -m d25 Associate d35 with d25 Here d35 = main mirror for swap 11. # metaroot d15 a. 'metaroot' edits the file /etc/system and /etc/vfstab so that the system may be booted with the root filesystem on a meta device. b. 'metaroot' may also be used to edit the files so that the system may be booted with root file system on a conventional disk device. c. Observe the changes to the files /etc/vfstab and /etc/system. 12. # init 6 Note: Make sure the sync is completed before rebooting the system by executing the command # metastat | grep % 13. # metattach d15 d10 For root adding sub-mirror 14. # metattach d35 d30 For swap adding sub-mirror 15. # cd /usr/platform/`uname -m`/lib/fs/ufs # installboot bootblk /dev/rdsk/c0t12d0s0 Installing the boot block to the SPARC machine
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 217

# installgrub -fm /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s0 Installing the grub in the X86 machine. 16. # ls -l /dev/dsk/c0t12d0s0 Will display the physical path of the logical device. Pls make a note of the physical path. 17. OK nvalias <alias_name> <physical_path> 18. OK setenv boot-device <root_disk_alias_name> <alternate_root_disk_alias_name>

BREAKING THE MIRROR: # metadetach d120 d100 # metaroot c0t0d0s0 c0t0d0s0 = raw disk of source disk which is running with OS. will revert the /etc/system & /etc/vfstab to the default status. # init 6 # metaclear d100 # metaclear -r d120 Raid-5: # metainit <meta_device_name> -r <component1> <component2> <component3> # metainit d100 -r c0t0d0s4 c0t1d0s4 c0t2d0s4 -r = specifies that the configuration is RAID level 5. # metastat | grep %

HOT SPARE: 1. Hot spare faciltiy included with Disk Suite allows automatic replacement of failed submirror/RAID-5 components, provided spare components are avialable & reserved. 2. Because component replacement & resyncing of failed components is automatic. 3. A hot spare is a component that is running (but not being used) which can be substituted for a broken component in a sub-mirror of two or three way meta mirror or RAID-5 device. Note: 4. Failed components in a one-way meta mirror cannot be replaced by a hot spare. 5. Components designated as hot sapres cannot be used in sub-mirrors or another meta device in the 'md.tab' file. They must remian ready for immediate use in the even of a component failure.

Hot spare states: 1. Has 3 states a. Available b. In-use c. Broken a. Available: 'Available' hot spares are running and ready to accept data, but are not currently being written to or read from.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 218

b. In-use: 'In-use' hot spares are currenlty being written to and read from. c. Broken: 1. 'Broken' hot spares are out of the service. 2. A hot spare is placed in the broken state when an I/O error occurs. 2. The number of hot spare pools is limited to 1000.

Defining Hot spare: 1. Hot spare pools are named as 'hspnnn' where 'nnn' is a number in the range 000-999 2. A metadevice cannot be configured as a hot spare. 3. Once the hot spare pools are defined and associated with a sub-mirror, the hot spares are "availabe" for use. If a component failure occurs, disk-suite searches through the list of hot spares in the assinged pool and selects the first 'available" compoenet that is equal or greated in disk capacity. 4. If a hot spare of adequate size is found, the hot spare state changes to "in-use" and a resync operation is automatically performed. The resync operation brings the hot spare into sync with other sub-mirror or RAID-5 components. 5. If a component of adequate size is "not found" in the list of host spare, the sub-mirror that failed is considered "erred" and the porting of the sub-mirror no longer replicated the data.

Hot spare conditions to avoid: 1. Associating hot spares of the wrong size with sub-mirror. This condition occurs when hot spare pools are defined and associated with a sub-mirror & none of the hot spares in the hot spare pool are equal to or greater than the smallest component in the sub-mirror. 2. Having all the hot spare withing the hot spare pool in use. In this case immediate action is required: a. 2 possible solutions or actions can be taken i. First is to add additional hot spare ii. To repair some of the components that hace been hot spare replaced Note: If all hot spare are in-use and a sub-mirror fails due to errors, that portion of the mirror will no longer be replicated. Manipulating hot spare spools: 1. # metahs = adding hot spares to hot spare pools = deleting hot spares from hot spare pool = replacing hot spares in hot spare pools = enabling hot spare = checking the status of the hot spare Adding a hot spare: Creating a hot spare spool: 1. # metainit hsp000 c0t2d0s5 Creates a hot spare device with the name 'hsp000' 2. # metainit <hot_spare_pool_name> <component1> <component2> # metainit hsp001 c0t1d0s4 c0t11d0s4 (or) # metahs -a hsp001 c0t1d0s4 c0t11d0s4
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 219

-a = to add a hot spare -i = to obtain the information

Deleting hot spare: 1. Hot spares can be deleted from any or all the hot spare pools to which they have been associated. 2. When a hot spare is delted from a hot spare pool, the position of the remianinig hot spares changes to reflect the new position. For eg, if the second of 3 hot spares in a hot spare spool is deleted, the 3rd hot spare moves to the seocnd position. 3. # metahs -d hsp000 c0t11d0s4 Removes the slice from the hot spare pool -d = to delete 4. Removing hot spare pool: Note: Before removing the hot spare pool, remove all the hot spare fromthe pools using 'metahs' with -d options and provide hot spare name. # metahs -d <pool_name> <spare_name> -d = deletes only the spare # metahs -d <hsp_name> To delete the hot spare pool Replacing hot spare: Note: 1. Hot spares that are in the 'In-use' state cannot be replaced by other hot spare. 2. The order of hot spares in the hot spare pools is NOT CHANGED when replacemebt occurs. 3. # metahs -r <hsp_pool_name> <old_slice> <new_slice> # metahs -r hsp000 c0t10d0s4 c0t11d0s4 c0t11d0s4 replaces c0t10d0s4 Associting the hot spare pool with sub-mirror/Raid-5 metadevice: 1. # metaparam modifies the parameters of the meta devices. # metaparam -h <hot_spare_pool_name> <sub-mirror/raid-5> # metaparam -h hsp000 d101 # metaparam -h hsp000 d102

Note: Where d101, d102 sub-mirrors of d103 mirror. where -h = specifies the hot spare spool to be used by a meta device Disassociating the hot spare pool with sub-mirror/raid-5 metadevice: # metaparam -h none <sub-mirror/raid-5 meta device> # metaparam -h none d101 # metaparam -h none d102 where, 'none' specifies the meta decie is disassociated with the hot spare pool associated to it.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 220

# # # # # #

metahs -d hsp000 c0t2d0s5 c0t2d0s6 metahs -d hsp000 metaclear d100 metadetach d15 d12 metaclear d12 metaclear -r d15

To view the status fo hot spare pool: # metahs -i Note: Suppose the failed disk is going to be repalced to free up hot spare. # metadevadm updates the meta device information -u = obtain the device ID associated with the disk specifier. This option is used when a disk drive has had its device ID changed during a firmware upgrade or due to changing the controller of a storage. -v = execution in verbose mode. Has not effect when used with -u option. verbose is default. # metadevadm -v -u <hot_spare_component> Updating the device infomation. # metadevadm -v -u c0t11d0s4 # metareplace -e d103 c0t10d0s3 To replace in the same location 1. Now hot spare will be available 2. Stuatus of the spare disk will change from 'inuse' to 'available'

Outputs: bash-3.00# metahs -a hsp001 c0t9d0s0 c0t9d0s1 c0t9d0s3 c0t9d0s4 hsp001: Hotspares are added bash-3.00# metahs -i hsp001: 4 hot spares Device Status Length Reloc c0t9d0s0 Available 1027216 blocks Yes c0t9d0s1 Available 1027216 blocks Yes c0t9d0s3 Available 1027216 blocks Yes c0t9d0s4 Available 1027216 blocks Yes Device Relocation Information: Device Reloc Device ID c0t9d0 Yes id1,sd@SFUJITSU_MAG3182L_SUN18G_01534930____ bash-3.00# bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c0t8d0s0 d10 1 1 c0t10d0s0 d15 1 1 c0t12d0s0 hsp001 c0t9d0s0 c0t9d0s1 c0t9d0s3 c0t9d0s4 hsp001: 4 hot spares Device Status Length Reloc
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 221

c0t9d0s0 Available 1027216 blocks Yes c0t9d0s1 Available 1027216 blocks Yes c0t9d0s3 Available 1027216 blocks Yes c0t9d0s4 Available 1027216 blocks Yes bash-3.00# metahs -a hsp001 c0t9d0s5 hsp001: Hotspare is added bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c0t8d0s0 d10 1 1 c0t10d0s0 d15 1 1 c0t12d0s0 hsp001 c0t9d0s0 c0t9d0s1 c0t9d0s3 c0t9d0s4 c0t9d0s5 bash-3.00# metahs -d hsp001 c0t9d0s5 hsp001: Hotspare is deleted bash-3.00# metahs -i hsp001: 4 hot spares Device Status Length Reloc c0t9d0s0 Available 1027216 blocks Yes c0t9d0s1 Available 1027216 blocks Yes c0t9d0s3 Available 1027216 blocks Yes c0t9d0s4 Available 1027216 blocks Yes Device Relocation Information: Device Reloc Device ID c0t9d0 Yes id1,sd@SFUJITSU_MAG3182L_SUN18G_01534930_ bash-3.00# metahs -r hsp001 c0t9d0s3 c0t9d0s5 hsp001: Hotspare c0t9d0s3 is replaced with c0t9d0s5 bash-3.00# metahs -i hsp001: 4 hot spares Device Status Length Reloc c0t9d0s0 Available 1027216 blocks Yes c0t9d0s1 Available 1027216 blocks Yes c0t9d0s5 Available 1027216 blocks Yes c0t9d0s4 Available 1027216 blocks Yes Device Relocation Information: Device Reloc Device ID c0t9d0 Yes id1,sd@SFUJITSU_MAG3182L_SUN18G_01534930____ bash-3.00# metahs -d hsp001 metahs: ent250: hsp001: hotspare pool is busy bash-3.00# metahs -d hsp001 c0t9d0s0 c0t9d0s1 c0t9d0s5 c0t9d0s4 hsp001: Hotspares are deleted bash-3.00# metahs -d hsp001 hsp001: Hotspare pool is cleared bash-3.00# metahs -i metahs: ent250: no hotspare pools found metaparam -h hsp005 d0 bash-3.00# metaparam -h hsp005 d10 bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c0t8d0s0 -h hsp005 d10 1 1 c0t10d0s0 -h hsp005 d15 1 1 c0t12d0s0 hsp005 c0t9d0s0 c0t9d0s1 c0t9d0s3 c0t9d0s4 bash-3.00# metainit d100 -r c0t8d0s1 c0t10d0s1 c0t12d0s1
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 222

d100: RAID is setup bash-3.00# metaparam -h hsp005 d100 bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c0t8d0s0 -h hsp005 d10 1 1 c0t10d0s0 -h hsp005 d100 -r c0t8d0s1 c0t10d0s1 c0t12d0s1 -k -i 32b -h hsp005 d15 1 1 c0t12d0s0 hsp005 c0t9d0s0 c0t9d0s1 c0t9d0s3 c0t9d0s4

bash-3.00# metastat | more d5: Mirror Submirror 0: d0 State: Okay Submirror 1: d10 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 1015808 blocks (496 MB) d0: Submirror of d5 State: Okay Hot spare pool: hsp005 Size: 1015808 blocks (496 MB) Stripe 0: Device Start Block Dbase c0t8d0s0 0 No

State Reloc Hot Spare Okay Yes

d10: Submirror of d5 State: Okay Hot spare pool: hsp005 Size: 1015808 blocks (496 MB) Stripe 0: Device Start Block Dbase c0t10d0s0 0 No

State Reloc Hot Spare Okay Yes

d100: RAID State: Okay Hot spare pool: hsp005 Interlace: 32 blocks Size: 2031616 blocks (992 MB) (Output truncated) bash-3.00# metaparam -h none d100 bash-3.00# metastat -p d5 -m d0 d10 1 d0 1 1 c0t8d0s0 -h hsp005 d10 1 1 c0t10d0s0 -h hsp005 d100 -r c0t8d0s1 c0t10d0s1 c0t12d0s1 -k -i 32b d15 1 1 c0t12d0s0 hsp005 c0t9d0s0 c0t9d0s1 c0t9d0s3 c0t9d0s4

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 223

Output - truncated: # metastat d0: Submirror of d5 State: Resyncing Hot spare pool: hsp005 Size: 1015808 blocks (496 MB) Stripe 0: Device Start Block Dbase c0t8d0s0 0 No

State Reloc Hot Spare Resyncing Yes c0t9d0s1

d10: Submirror of d5 State: Okay Hot spare pool: hsp005 Size: 1015808 blocks (496 MB) Stripe 0: Device Start Block Dbase c0t10d0s0 0 No

State Reloc Hot Spare Okay Yes

Note: SVM Additional Information on SVM: 1. Example entries to the file /etc/lvm/md.tab ## For raid-0 concatenation with stripping d80 1 3 c0t6d0s7 c0t4d0s7 c0t3d0s7

or d80 1 3 /dev/dsk/c0t6d0s7 /dev/dsk/c0t4d0s7 /dev/dsk/c0t3d0s7 ## for raid-1 mirroring d0 1 1 c0t4d0s5 d10 1 1 c0t6d0s5 d5 -m d0

## for raid-5 stripping with parity d100 -r c0t2d0s3 c0t3d0s3 c0t5d0s3

## for hot spare d0 1 1 c0t4d0s5 -h hsp001 d10 1 1 c0t6d0s5 -h hsp001

### for creating replicas mddb01 -c3 c0t0d0s7

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 224

2. To update the file using a command: a. for replica: # metadb -af mddb01 b. for all meta devices: # metainit -a c. Only for a selective meta device # metainit d10

3. To delete the root mirroring: for eg: # metadettach d120 d100 # metaroot c0t0d0s0 (Will change the entries to the file /etc/vfstab and /etc/system) # init 6 # metaclear <clear_the_metadevices>

4. Soft partition: a. Is a means of dividing a disk or volume into as many partitions as needed, over coming the current limitation of eight(7). This is done by creating logical partitions within physical disk slices or logical volumes. b. No automatic problem detection c. the SVM s/w does not detech problems with state database/replica until there is a change to an existing SVM configuration and an update to the database replica is required. If is sufficeint state data base replicas are avialable, you'll need to boot in single user mode, and delete/replace enough of the corrupted/missing database replicas to achive a quoram. d. soft partitionss differ from hard slices creating using 'format' command because soft partitions can be non-contiguous, where as a hard slice is contiguous. Therefore soft partitions can cuase I/O performance degradation.

Outputs: Examples for editing the file /etc/lvm/md.tab CREATING THE MIRROR BY EDITING THE FILE /ETC/LVM/MD.TAB

"/etc/lvm/md.tab" 57 lines, 1453 characters # # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)md.tab 2.5 03/09/11 SMI" # # md.tab # # metainit utility input file. # # The following examples show the format for local metadevices, and a
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 225

# similar example for a shared metadevice, where appropiate. The shared # metadevices are in the diskset named "blue": # # Metadevice database entry: # # mddb01 /dev/dsk/c0t2d0s0 /dev/dsk/c0t0d0s0 # # Concatenation of devices: # # d10 2 1 /dev/dsk/c0t2d0s0 1 /dev/dsk/c0t0d0s0 # blue/d10 2 1 /dev/dsk/c2t2d0s0 1 /dev/dsk/c2t0d0s0 # # Stripe of devices: # # d11 1 2 /dev/dsk/c0t2d0s1 /dev/dsk/c0t0d0s1 # blue/d11 1 2 /dev/dsk/c2t2d0s1 /dev/dsk/c2t0d0s1 # # Concatenation of stripes (with a hot spare pool): # # d13 2 2 /dev/dsk/c0t2d0s0 /dev/dsk/c0t0d0s0 \ # 2 /dev/dsk/c0t2d0s1 /dev/dsk/c0t0d0s1 -h hsp001 # blue/d13 2 2 /dev/dsk/c2t2d0s0 /dev/dsk/c2t0d0s0 \ # 2 /dev/dsk/c2t2d0s1 /dev/dsk/c2t0d0s1 -h blue/hsp001 "/etc/lvm/md.tab" 57 lines, 1453 characters # RAID of devices # # d15 -r /dev/dsk/c1t0d0s0 /dev/dsk/c1t1d0s0 \ # /dev/dsk/c1t2d0s0 /dev/dsk/c1t3d0s0 # blue/d15 -r /dev/dsk/c2t0d0s0 /dev/dsk/c2t1d0s0 \ # /dev/dsk/c2t2d0s0 /dev/dsk/c2t3d0s0 # # Hot Spare Pool of devices # # hsp001 /dev/dsk/c1t0d0s0 # blue/hsp001 /dev/dsk/c2t0d0s0 # # 100MB Soft Partition # # d1 -p /dev/dsk/c1t0d0s1 100M # blue/d1 -p /dev/dsk/c2t0d0s1 100M create a raplica mddb01 -c6 c0t8d0s0 creating a metadevice d0 1 1 c0t8d0s3 d10 1 1 c0t9d0s3 ~ "/etc/lvm/md.tab" 61 lines, 1545 characters bash-3.00# metadb -af mddb01 bash-3.00# metainit -a d10: Concat/Stripe is setup d0: Concat/Stripe is setup bash-3.00# metastat d0: Concat/Stripe Size: 1027216 blocks (501 MB) Stripe 0: Device Start Block Dbase
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Reloc
Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 226

c0t8d0s3

No

Yes

d10: Concat/Stripe Size: 1027216 blocks (501 MB) Stripe 0: Device Start Block Dbase c0t9d0s3 0 No

Reloc Yes

Device Relocation Information: Device Reloc Device ID c0t8d0 Yes id1,sd@SSEAGATE_ST318203LSUN18G_LR901376000010210UDS c0t9d0 Yes id1,sd@SSEAGATE_ST318203LSUN18G_LRA609240000W0270ZT6 bash-3.00# vi /etc/lvm/md.cf "/etc/lvm/md.cf" 4 lines, 84 characters # metadevice configuration file # do not hand edit d0 1 1 c0t8d0s3 d10 1 1 c0t9d0s3

Disk Set Diskset feature lets us to set up groups of host machines and disk drives in which all of the hosts in the set are connected to all the drives in the set. Types of diskset: a. Local diskset b. Shared diskset Local Diskset: 1. Each host in a disk set must have a local disk set. 2. Local disk set for a host consists of all drives which are not part of a shared diskset. 3. The host's local metadevice configuration is contained within this local diskset in the local metadevice state database/replica.

Shared Diskset: 1. Is a grouping of 2 hosts and disk drives in which all the drives are accessible by both hosts. Condition: Disk suite requires that the device name be indentical on each host in the disk set. 2. There is one meta device state database per shared diskset.

Note: 1. Drives shared diskset must not be in any ohter diskset. 2. None of the partitions on any of the drives in a diskset can be mounted on, swapped on or part of a local metadevice. 3. All the drives in a shared diskset must be accessible by both hosts in the diskset. 4. Metadevices & hotspare pools in any diskset must consists of drives within that dataset. Like wise, metadevices & host spare pools in the local diskset must be made up of drives from within the local diskset.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 227

Naming convention: 1. Metadevices within the local diskset use the standard disk suite naming conventions. 2. Metadevices within the shared diskset use the following conventions. /dev/md/setname/(r)dsk/dnumber (usually 0 to 127) Eg: /dev/md/dataset/(r)dsk/d10 3. Hotspare: setname/hsp000 As usual, 0-999 Note: -s = Options is used iwth the standard disk suite commands to create, remove and administer metadevices/hotspare pools. If -s option is NOT used, the command affects only the local diskset.

Defining disksets: NOTE: 1. Before administering the diskset, make sure, a. The installation of the disk suite software on each host b. Each host must have local database replicas setup. 2. All disk that we plan to share between hosts in the diskset must be connected to each host ans must have the same name on the each host. 3. 2-basic operations involved in defining disksets. a. Adding hosts (adding the first host defines the disk set) b. Adding drives Syn: # metaset -s <set_name> -a -h <first_owner_host> <second_host> Eg: # metaset -s dataset -a -h node1 node2 Where -a = to add -h = to specify the host NOTE: 1. Adding the first host create the diskset. 2. The last host cannot be deleted untill all of the drives within the set have been deleted. 3. A host name is not accecpted if all the drives within the diskset cannot be found on each specified host. IN addition, a drive is not accepted if it cannot be found on all the hosts in the diskset. # metaset - Displays the status of the diskset

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 228

Adding drives to the diskset: Syn: # metaset -s <disk_set_name> -a <disks> Eg: # metaset -s dataset -a c2t1d0 c2t2d0 c2t3d0 c2t4d0 NOTE: 1. A drive name is not accepted if it cannot be found on all hosts specified as part of the disk set. # metaset Now we can observe the difference since disk are added to the diskset. First host (here node1 is the owner of the diskset dataset). 2. Drives are repartitioned when they are added to the diskset, only if slice7 is not setup properly. A small portion of each drive is reserved in slice7 for use by disksuite software. 3. The disk suite software tries to balance a reasonable number of replicas across all drives in a diskset. 4. Each drive in the diskset is probed once every second to determine that is still reserved.

Administering disksets: 1. Reserved or reserving a diskset 2. Releasing a diskset Reserving a diskset: 1. Before a host can use drives in a diskset, the host must reserve the diskset. 2. a. Safely: 'metaset' checks to see if another host currenlty has the set reserved. If another host has the diskset reserved the other host will not be allowed to reserve the set. Syn: # metaset -s <disk_set_name> -t Eg: # metaset -s dataset -t

b. Forcefully: Will not check wiht the other hosts Syn: # metaset -s <disk_set_name> -t -f Eg: # metaset -s dataset -t -f

Releasing a diskset: 1. When a diskset is released, it cannot be accessed by the host. Syn: # metaset -s <disk_set_name> -r Eg: # metaset -s dataset -r
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 229

# metaset Observe the changes

Removing hosts & drives from disksets: NOTE: 1. When drives are removed from/added to the diskset, disksuite balances the metadevices state database replicas across the remianing drives. Syn: # metaset -s <disk_set_name> -d <disks> Eg: # metaset -s dataset -d c2t3d0 2. -f = Option must be used when deleting the last drive in a set, since this drive would implicitly contain the last state database replica. 3. The last host can be removed from a diskset only after all drives in the diskset have been removed. Removing the last host from the diskset destroys the diskset. Eg: # metaset -s dataset -d -h node2 Here, the diskset will be removed from the host node2) # metaset Observe the changes

Adding drives or hosts to the diskset: # metaset -s dataset -a c2t5d0 To add the drives # metaset -s dataset -a -h node2 To add hosts

NOTE: Disk suite, a maximum of 2 hosts per diskset are supported.

The contents of this material is not affiliated with Sun Microsystems or any of it's affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 230

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 231

VERITAS VOLUME MANAGER STORAGE FOUNDATION SPECIALIST FOR UNIX 250-250 (Offered by Symantec) Sun Microsystems offers Certification as Sun Certified Veritas Volume Administrator

Comparison of Solaris Volume Manager Software & Veritas Volume Manager

Sun Microsystems, discourage the use of Veritas on the system disk (root disk/boot disk. Veritas do not, by default, correspond to partitions. In the situation, irrespective of the cause, where the system no longer boots, the sysem administrator must be able to gain access to the file system on the system disk without the drives of the volume management software. This is guaranteed to be possible when each volume corresponds to a partition in the volume tableof contents (VTOC) of the system disk. Solaris Volume Manager volumes can be accessed even when booted from CD-ROM. This inturn eliminates the need of breaking off a mirrror dring upgrades, thus reducing downtime and complexity of such an operation. SVM software reservers the correspomdence between the volumes defined in its state database, and the disk partitions defined in the disk lable (VTOC), at all times; disaster recovery is always possible by s standard method, without extra complecations. Its easy to grow /var using the VxVM graphical tool. This can be done by anyone at any time, to solve a disk space problem. However, this breaks the volume-partition relation as the /var volume in now a concatenation of two (not necessarily contiguous) sub-disk. When a disk breaks, the replacement disk is initialized. Slices 3 and 4 become the VxVM private and public region, subdisks are allocated to be mirrored with the surviving disk. Partitions may be created by VxVM software for these subdisks. There are 2 drawbacks to using SVM software in combinations with VxVM software: 1. Cost 2. SVM software requires that a majority of the state databases be found at boot time (the quorum rule). When all data disks are under VxVM software, only two disks may be left under SVM software. If one of these disks breaks, there is no state database quorum and the system will not boot without manual intervention. NOTE: The intervention consists of removing the inaccessible state database copies (using the metadb d command) and rebooting. In the 2-disk configuration, the quorum rule in /etc/system can disable. The system will then will boot unattended, even with one disk. Is storage management software used to manage volumes, to manage data.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 232

How data are stored? Hard disks are formatted and information are stored using 2 methods. 1. Physical storage layout 1. Logical storage layout VxVM uses both the physical objects and virtual objects to handle the storage management.

PHYSICAL DISK / PHYSICAL OBJECT: are hardware with block and raw OS device interfaces that are used to store the data.

VIRTUAL OBJECTS: 1. When one or more physical disks are brought under the control of veritas, it creates virtual objects called VOLUME, on those physical disks. 2. Volumes and their physical components are called virtual objects or VxVM objects. NOTE: VxVM control is accomplished only of VxVM takes control of the physical disk and the disk is not under the control of another storage manager such as SVM. Before the disk can be brought under VxVM control, the disk must be accessible through the operating system device interface. VxVM is layered on top of the OS interface services and is dependent upon how the OS access physical disks. VxVM is dependent upon the OS for the following functionality: 1. 2. OS disk devices Device handles

Virtual Data Storage: Volume Manager creates a virtual layer of data storage. 1. 2. 3. 4. 5. Virtual storage object that is visible to users and application is called a VOLUME. A volume is a virtual object, created by VxVM that stores the data. Made up of space from one or more physical disks on which the data is physically stored. Volume manager volume appears to applications to be physical disk partitions. All users and applications access volumes as contiguous address space using special device files in a manner similar to accessing a disk partition. Volumes have block & character device nodes in the /dev tree. For eg: /dev/vx/( r ) dsk/..

6.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 233

VOLUME MANAGER CONTROL: When we place a disk under VxVM control, a CDS disk layout is used, which ensures that the disk is accessible on different platforms, regardless of platforms on which disk was initialized.

Comparing CDS & Sliced disks CDS 1. Private region (meta data) and public region (user data) are created on a single partition. 2. Suitable for moving between different operating system. 3. Not suitable for boot partitions. SLICED DISKS 1. Private region & public region are created on separate partitions. For eg at 3 and 4 2. Not suitable for moving between the different operating system. 3. Suitable for boot partitions.

Note: 1. CDS (Common Disk Layout) disks have specific disk layout requirement that enable a comman disk layout across different platforms, and these requirements are not compatible with the particular platform specific requirement of boot devices. ( CDS requires a Vertias Storage Foundation License) 2. And therefore, when placing a boot disk under volume. manager control, we must use a SLICED DISK layout Private Region: 1. Is similar to metadb or replica in Solaris Volume Manager Software. 2. Will be created at the time of initialization of disk to VxVM control. 3. Adding the disk to disk group, the media name, disk access name, the disk name and the disk configurations all are written to the private region. LOGICAL OBJECTS: 1. vmdisk 2. disk group 3. sub dis 4. plex 5. volume PHYSICAL OBJECTS: 1. Controllers 2. Disks

VMDISK: 1. When a disk is brought under the control of VxVM that disk is called VMDISK. 2. Can bring the disk under VxVM by 2 methods. a. Initialization: 1. Initialize the disk as vmdisk 2. The entire data on the disk will be overwritten, i.e., the data in the disk will be destroyed.
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 234

b. Encapsulation: 1. When a disk is brought under the control of VxVM with encapsulation, all the data (partition) in the disk will be preserved. 3. Upto 31 characters.

DISK GROUP: 1. Is a collectionn of voulme manager disks that have been put together into a logical grouping. 2. Grouping of disk is for management purpose, such as to hold the data for a spefic application or set of applications. 3. Voulme managerobjects CANNOT span disk groups. For eg: volumes SUB-DISKS, PLEXES and disk must be derived from the same disk group. Can create additional disk group as necessary. 4. Disk group ease the use of devices in a high availability environment, because a disk group and its components can be moved as a unit from the host machine to another. SUB-DISKS: 1. Volume manager disk can be divided into one or more sub-disks. 2. Is a collection of contiguous blocks that represent a specific portion of a volume manager disk, which is mapped to a specific regions of physical disk. 3. Is a subsection of a disk's public region. 4. Is the smallest unit of storage in volume manager. 5. Conceptually, a sub-disk is similar to a partition. 6. Max size of a sub-disk is the size of the vxdisk. 7. Can create 4096 sub-disks/vmdisk. 8. Sub-disk cannot be shared among two plexes.

PLEX: 1. Voulume manager uses sub-disks to build virtual objects called PLEXES. 2. Is a structured or ordered collection on sub-disks from one or more vmdisk. 3. Cannot be shared by 2 volumes. 4. Maximum number of plexes per volumes is 32 5. Between 2 plexes of same volume mirroring occurs by default. 6. Can have minimum one sub-disk and maximum of 4096 sub-disks 7. 3 types of plexes a. Complete plex: holds a complete copy of a volume b. Log plex: dedicated to logging c. Sparse plex: 1. which is not a compelete copy of the 2. Sparse plexes are not used in newer versions fo voulme manager. 8. Can organixe data on sub-disks to form a plex by using the following a. Concatenation b. Striping c. Mirroring d. Striping with parity

volume

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 235

VOLUME: 1. Is a collection of plexes 2. Is a virtual storage device that is used by applications in a manner smimilar to physical disk. Due to its virtua in nature a volume is not restricted by the physical disk size constraints that apply to physical disk. 3. Volume can be as large as the total sum of avialable unreesrved free physical disk space 4. Minimum of plex in a volume is 1. Maximum of plexes in a volume is 32. 5. Size of the volume is the size of the least plex. 6. Maximum size of a volume is a size of the disk group.

DAEMONS: 1. vxconfigd - main configuration daemon of VxVM responsible for maintaining the vmdisk & disk group information 2. vxreload - responsible for hot relocation 3. vxsus - requires open VEA (Veritas Enterprise Adminstrator) 4. vxnotify - responsible for notifying device object failure 5. vxoid - provides I/O operations

PACKAGE NAME: 1. 2. 3. 4. 5. 6. 7. 8. 9. VRTSvlic - licensing utilities VRTSVxVM - VxVM binaries VRTSob - VEA service VRTSfspro - File system service provider VRTSfsman VRTSvxman - manual pages VRTSobgui - VEA graphical user interface VRTSVmpro - Diks management service provider VRTSvxfs - VXFS software and manual pages.

TO SET THE ENVIRONMENT VARIABLES (Ater installation of the VxVM) Edit the file /etc/profile PATH=$PATH:/opt/VRTS/bin:/etc/vx/bin MANPATH=$MANPATH:/opt/VRTS/man export PATH MANPATH :wq!

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 236

Outputs:

bash-3.00# . profile bash-3.00# echo $PATH /usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ucb:/opt/VRTS/bin:/etc/vx/b in bash-3.00# echo $MANPATH /usr/dt/man:/usr/man:/usr/openwin/share/man:/opt/VRTS/man

NOTE: Most commands are located in 1. /etc/vx/bin 2. /usr/sbin 3. /usr/lib/VxVM/bin

INSTALLING THE VERITAS PRODUCTS: 1. Can install by running the script from the cdrom 2. Can install the required package manually by # pkgadd command. NOTE: While adding the package manually please ensure the following; 1. Ensure the packages are installed in the correct order 2. Always install VRTSvlic first 3. Always install the VRTSVxVM package before other VxVM packages. 4. Documentation and manual pages are optional 5. After installing the package, using OS specific commands, run vxinstall to configure VxVM for the first time. # vxinstall -> to install license key. Verifying package installation: # pkginfo -l VRTSVxVM

vxinstall: 1. Is an interactive program that guides through the initial VxVM configuration 2. The main steps in vxinstall process are a. entering the license key b. select the naming method 1. Enclosure based naming 2. Traditional naming 3. If desired, set up a system-wide default disk group

Output:
bash-3.00# vxinstall VxVM uses license keys to control access. If you have a SPARCstorage Array (SSA) controller or a Sun Enterprise Network Array (SENA) controller attached to your system, then VxVM will grant you a limited use license automatically. The SSA and/or SENA license grants you unrestricted use of disks attached to an SSA or SENA controller, but disallows striping, RAID-5, and DMP on non-SSA and non-SENA disks. If you are not running an SSA or SENA controller, then you must obtain a license key to operate. Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 237

Licensing information: System host ID: 832d10ed Host type: SUNW,Sun-Fire-280R SPARCstorage Array or Sun Enterprise Network Array: No arrays found Some licenses are already installed. [y,n,q,?] (default: y) y Do you wish to review them

Symantec License Manager vxlicrep utility version 3.02.16.0 Copyright (C) 1996-2006 Symantec Corporation. All rights reserved. Creating a report on all VERITAS products installed on this system -----------------***********************----------------License Key Product Name Serial Number License Type OEM ID Editions Product (output truncated...) bash-3.00# vxlicrep | more Symantec License Manager vxlicrep utility version 3.02.16.0 Copyright (C) 1996-2006 Symantec Corporation. All rights reserved. Creating a report on all VERITAS products installed on this system -----------------***********************----------------License Key Product Name Serial Number License Type OEM ID Editions Product = = = = = = iezu-wdp9-dw6w-yzo4-w2z7-pp8o-ppz VERITAS Storage Foundation Standard HA 2447 PERMANENT 2006 YES = = = = = = iezu-wdp9-dw6w-yzo4-w2z7-pp8o-ppz VERITAS Storage Foundation Standard HA 2447 PERMANENT 2006 YES

(output truncated...)

bash-3.00# vxinstall VxVM uses license keys to control access. If you have a SPARCstorage Array (SSA) controller or a Sun Enterprise Network Array (SENA) controller attached to your system, then VxVM will grant you a limited use license automatically. The SSA and/or SENA license grants you unrestricted use of disks attached to an SSA or SENA controller, but disallows striping, RAID-5, and DMP on non-SSA and non-SENA disks. If you are not running an SSA or SENA controller, then you must obtain a license key to operate. Licensing information: System host ID: 832d10ed Host type: SUNW,Sun-Fire-280R SPARCstorage Array or Sun Enterprise Network Array: No arrays found Some licenses are already installed. [y,n,q,?] (default: y) n Do you wish to review them

Do you wish to enter another license key [y,n,q,?] (default: n) n Do you want to use enclosure based names for all disks ? [y,n,q,?] (default: n) y Starting Starting Starting Starting the the the the relocation daemon, vxrelocd. cache deamon, vxcached. diskgroup config backup daemon, vxconfigbackupd. dg monitoring daemon for rlinks with STORAGE protocol, vxvvrsecdgd. Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 238

Do you want to setup a system wide default disk group? [y,n,q,?] (default: y) y Which disk group [<group>,list,q,?] list NAME STATE ID

Which disk group [<group>,list,q,?] newdg The installation is successfully completed. bash-3.00# vxlicrep -s Symantec License Manager vxlicrep utility version 3.02.16.0 Copyright (C) 1996-2006 Symantec Corporation. All rights reserved. Creating a report on all VERITAS products installed on this system License Key Product Name License Type = iezu-wdp9-dw6w-yzo4-w2z7-pp8o-ppz = VERITAS Storage Foundation Standard HA = PERMANENT

License Key Product Name License Type

= = VERITAS Volume Manager = PERMANENT

License Key Product Name License Type

= = VERITAS File System = PERMANENT

License Key Product Name License Type

= BZZE-9NR3-OPRV-ROEO-4A8P-DPPW-XCPP-PPP = VERITAS Volume Manager = PERMANENT

License Key Product Name License Type

= 3EZU-3YK6-92TM-XJ6P-PZCN-PRDP-Z = VERITAS File System = PERMANENT

License Key Product Name License Type

= PZZH-PCWG-CTFZ-I2YC-NPZK-P6 = VERITAS Cluster Server = PERMANENT

Enclosure based naming: a. os independent b. Is based on the enclosure c. can be customized to make names meaningful Traditional based naming: a. operating system dependent b. based on physical connectivity information Solaris: /dev/(r)dsk/c0t0d0s2 SELECTING & NAMING SHCEME: We can select the naming scheme 1. When we run VxVM installation scripts 2. Anytime by using the # vxdiskadm option - " change the disk naming scheme " Note: This operation requires the VxVM configuration daemon, 'vxconfigd' to be stopped and restarted
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 239

If we choose enclosure based naming 1. Disks are displayed in 3 categories 2. Enclosure: a. Supported by RAID disk arrays are displayed in enclosurename_# -> format b. Disks: Supported JBOD (Just Bunch Of Disks) disk arrays are displayed with the prefix Disk_ c. Others: Disks that do not return a path independent identifier to VxVM displayed in the traditional os based format

Output: To Change the naming scheme:


Select disk devices to add: [<pattern-list>,all,list,q,?] list DEVICE Disk_0 Disk_1 Disk_2 Disk_3 Disk_4 Disk_5 DISK GROUP STATUS online invalid online invalid online online online invalid online

Select disk devices to add: [<pattern-list>,all,list,q,?] q

After choosing the option 20: Change the disk naming scheme Select disk devices to add: [<pattern-list>,all,list,q,?] list

DEVICE c1t2d0 c1t9d0 c1t10d0 c1t11d0 c1t12d0 c2t0d0

DISK -

GROUP STATUS online online online online invalid online invalid online invalid

Select disk devices to add: [<pattern-list>,all,list,q,?]

VXVM user interfaces: 1. Supports 3 user interfaces a. VEA A GUI based, that provides access through, icons, menus, wizards and dialog boxes. b. CLI - UNIX utilities that invoked from the command line c. vxdiskadm - a menu driven, text based interface also invoked from the command line Output: # vxdiskadm Volume Manager Support Operations Menu: VolumeManager/Disk 1 2 3 4 Add or initialize one or more disks Encapsulate one or more disks Remove a disk Remove a disk for replacement
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 240

5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 list

Replace a failed or removed disk Mirror volumes on a disk Move volumes from a disk Enable access to (import) a disk group Remove access to (deport) a disk group Enable (online) a disk device Disable (offline) a disk device Mark a disk as a spare for a disk group Turn off the spare flag on a disk Unrelocate subdisks back to a disk Exclude a disk from hot-relocation use Make a disk available for hot-relocation use Prevent multipathing/Suppress devices from VxVM's view Allow multipathing/Unsuppress devices from VxVM's view List currently suppressed/non-multipathed devices Change the disk naming scheme Get the newly connected/zoned disks in VxVM view Change/Display the default disk layouts Mark a disk as allocator-reserved for a disk group Turn off the allocator-reserved flag on a disk List disk information

? ?? q

Display help about menu Display help about the menuing system Exit from menus

Select an operation to perform:

NOTE: vxdiskadm only provides access to certain disk and disk group management functions.

COMMANDS: 1. # vxdiskadm - used to add or initialize one or more disks, encapsulate one or more disks, remove disk, remove a disk for replacement, replace a failed or removed disk, more volumes from a disk, enable access (import) to a disk group, remoce access (deport) to a disk group, enable (online) a disk device, disable (offline) a disk device, mark a disk as a spare for a disk group, turnoff the spare flag on a diks , list disk informations. 2. # vxassist - Utility used to create volume, add mirrors & logs to existing volumes, exten & shrink the existing volumes, provides the migration of data from a specified set of disks & provides facilities for the online backup of existing volumes.

SYNTAX: # vxassist <option> <keyword> <volume_name> [attributes] OPTIONS: -g => to specify the disk group -b -> background option -d => file containing defaults for vxassist if not specified, /etc/default/vxassist is used.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 241

KEYWORD: make, mirror, growto, growby, shirkby, shrinkto, snapshot, snapstart, snapwait ATTRIBUTES: Specifies volume layout, sik controller to include, excluede etc., 3. # vxdisk - to see the parameters of disks 4. # vxdg - to perform disk group operation 5. # vxdisksetup - ti intialize the setup 6. # vxdiskunsetup - to un-intialialize the setup 7. # vxsd - to perform sub-disk operation 8. # vxplex -> to perform plex operation 9. # vxvol -> to perform volume operation 10. # vxprint -> displays the detailed information on existing VxVM objects NOTE: VEA is automatically installed when we run the VxVM installation scripts; we can also install VEA by manually adding the packages.

VOLUME PATH: Block device : /dev/vx/dsk/<dg_name>/<volume_name> Raw device : /dev/vx/rdsk/<dg_name>/<volume_name>

VEA : Viewing commands: 1. Located in /var/adm/vx/veacmdlog 2. Displays a history of taks performed in the current session and in previous sessions. 3. This file is created after the first execution of a task in VEA. MANAGING VEA: 1. The VEA server program is in /opt/VRTSos/bin/vxsvc 2. To confirm that VEA server is running # vxsvc -m 3. To stop and restart the VEA server # /etc/init.d/isisd restart 4. To kill the VEA server process # vxsvc -k 5. To display the VEA version number # vxsvc -v

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 242

Output: bash-3.00# vxsvc -m Current state of server : NOT RUNNING bash-3.00# /etc/init.d/isisd restart Stopping Veritas Enterprise Administrator Service (vxsvc) VEA Server was shutdown successfully The server is not configured. Unable to start the server. Please configure before running. bash-3.00# vxsvc -v 3.3.721.0

Disk configuration stages: 1. Has 3 stages a. Intialize the disk b. Assing the disk to the disk group c. assign disk space to the volumes 2. Intialize the disk: Stage-1: a. This occur after the disk is detected by the OS b. When the disk is initalized, the public & private regions are created, and the volume manager disk header information is written to the private region. c. An initalized disk is placed under VxVM free disk pool. i. The VxVM free disk pool contains disk that have been initialized but have not yet assigned to a ddisk group. 3. Assign disk to the disk group: Stage-2: a. VxVM assigns the disk name to the diks and maps this name to the disk access name. i. a disk name/ disk media name is the logical name assigned to the device by VxVM. ii. VxVM uses this name to identify the disk for volume operations, such as volume creation & mirroring. iii. a disk access record maps the physical location to the logical name and represents the link between the disk media and the disk access name. b. When a disk is added to the diks group, the media name, diks access name, the host name and the disk configuration are all written to the private region of the disk.

4. To create a volume: Stage-3: a. when we create a volume, space in the public region of a disk is assigned ot the volumes.

CREATING A DISK GROUP: 1. To create a disk group, first wer have to add a disk to a disk group 2. can add a single or multiple disk 3. cannot add a disk to more that one disk group 4. default disk mediia names vary with the interface used to add to a disk group, but are conventionally in the format diskgroup##
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 243

such as datadg00, datadg01, datadg02 and os on... 5. disk media names must be unique within a disk group. 6. adding disks to a disk group provides additional storage capacity for creating volumes. adding a disk to a disk group makes the disk space avialble for use in creating VxVM volume.

System wide reserved disk groups: 1. Reserved names a. bootdg b. defaultdg c. nodg a. bootdg: 1. if the boot disk is brought under VxVM control, volume manager assigns bootdg as an alias for the name of the disk group that contains the volume that are used to boot the system. 2. # vxdg bootdg # vxdg defaultdg to display what is set as bootdg or defaultdg 3. # vxdctl defaultdg <disk-group> to set the default disk group after VxVM installation Only to check whether its possible to create the above reserved disk group: Output:
bash-3.00# vxdg VxVM vxdg ERROR bash-3.00# vxdg VxVM vxdg ERROR bash-3.00# vxdg VxVM vxdg ERROR init bootdg bootdg01=c1t2d0 V-5-1-585 Disk group nodg: cannot create: Name is not allowed as a disk group init nodg nodg01=c1t2d0 V-5-1-585 Disk group nodg: cannot create: Name is not allowed as a disk group init defaultdg defaultdg01=c1t2d0 V-5-1-585 Disk group nodg: cannot create: Name is not allowed as a disk group

DISK GROUP: 1. To create a disk group or add disks using vxdiskadm " Add or initialize one or more disks " 2. To initialize: Syn: # vxdisksetup -i >device_tag> [attribute] eg: # vxdisksetup -i Disk_1 { enclosure based naming } # vxdisksetup -i c2t0d0 { traditional based naming } 3. To initilaize the disk group by adding atleast one disk: Syn: # vxdg init <disk_group> <disk_name>=<device_tag> eg: # vxdg init newdg newdg01=Disk1 4. Add more disks to the disk group: Syn: # vxdg -g <disk_group> adddisk <disk_name>=<device_tag> eg: # vxdg -g newdg adddisk newdg02=Disk2

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 244

Output: Creating the disk group at the time of initializing the disk: U Select disk devices to add: [<pattern-list>,all,list,q,?] c1t12d0 Here is the disk selected. Output format: [Device_Name] c1t12d0 Continue operation? [y,n,q,?] (default: y) You can choose to add this disk to an existing disk group, a new disk group, or leave the disk available for use by future add or replacement operations. To create a new disk group, select a disk group name that does not yet exist. To leave the disk available for future use, specify a disk group name of "none". Which disk group [<group>,none,list,q,?] (default: none) newdg Create a new group named newdg? [y,n,q,?] (default: y) Create the disk group as a CDS disk group? [y,n,q,?] (default: y) Use a default disk name for the disk? [y,n,q,?] (default: y) Add disk as a spare disk for newdg? [y,n,q,?] (default: n) Exclude disk from hot-relocation use? [y,n,q,?] (default: n) Add site tag to disk? [y,n,q,?] (default: n) A new disk group will be created named newdg and the selected disks will be added to the disk group with default disk names. c1t12d0 Continue with operation? [y,n,q,?] (default: y) The following disk device has a valid VTOC, but does not appear to have been initialized for the Volume Manager. If there is data on the disk that should NOT be destroyed you should encapsulate the existing disk partitions as volumes instead of adding the disk as a new disk. Output format: [Device_Name] c1t12d0 Encapsulate this device? [y,n,q,?] (default: y) n c1t12d0 Instead of encapsulating, initialize? [y,n,q,?] (default: n) y Initializing device c1t12d0. Enter desired private region length [<privlen>,q,?] (default: 65536) VxVM NOTICE V-5-2-120 Creating a new disk group named newdg containing the disk device c1t12d0 with the name newdg01. Add or initialize other disks? [y,n,q,?] (default: n) n
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 245

Output: To bring the disk under VxVM control without creating a disk group: bash-3.00# vxdisksetup -i c1t11d0 bash-3.00# vxdisk list DEVICE TYPE DISK c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:cdsdisk c1t12d0s2 auto:cdsdisk newdg01 c2t0d0s2 auto:none -

GROUP online newdg -

STATUS online online online online online invalid

Output: To create the disk group using a command: bash-3.00# vxdg init oradg oradg01=c1t11d0 bash-3.00# vxdisk list DEVICE TYPE DISK GROUP c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:cdsdisk oradg01 oradg online c1t12d0s2 auto:cdsdisk newdg01 newdg c2t0d0s2 auto:none -

STATUS online online online online online invalid

Output: Adding a disk to the existing disk group: Adding a disk to a disk group bash-3.00# vxdisk list DEVICE TYPE DISK GROUP c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:cdsdisk oradg01 oradg c1t12d0s2 auto:cdsdisk newdg01 newdg c2t0d0s2 auto:none bash-3.00# vxdg -g oradg adddisk oradg02=c1t10d0 bash-3.00# vxdisk list DEVICE TYPE DISK GROUP c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk oradg02 oradg online c1t11d0s2 auto:cdsdisk oradg01 oradg c1t12d0s2 auto:cdsdisk newdg01 newdg c2t0d0s2 auto:none -

STATUS online online online online online online invalid

STATUS online online online online online invalid

VIEWING DISK INFORMATION: 1.To display basic information about all the disks: # vxdisk -o alldgs list NOTE: In a shared access environment, when displaying disks, we should frequenlty run # vxdctl enable to rescan for the disk changes
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 246

2. To display detailed information for a disk Syn: # vxdisk -g <disk_group> list <disk_name> eg: # vxdisk -g datadg list datadg01

3. To display a summary for all disks # vxdisk -s list 4. To display imported disk groups only: # vxdg list displays the name, sate & id 5. To display all disk groups, including deported disk groups: # vxdisk -o alldgs list 6. To display free space in the disk group # vxdg free for all disk groups that the host can detect # vxdg -g <disk_group> free for specific disk group Output: bash-3.00# vxdg list NAME STATE newdg enabled,cds

ID 1256796117.15.fire1

bash-3.00# vxdisk -o alldgs list DEVICE TYPE DISK c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:none c1t12d0s2 auto:cdsdisk newdg01 c2t0d0s2 auto:none -

GROUP (newdg) (appachedg) newdg -

STATUS online online online online invalid online online invalid

bash-3.00# vxdisk list DEVICE TYPE c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:none c1t12d0s2 auto:cdsdisk c2t0d0s2 auto:none

DISK newdg01 -

GROUP newdg -

STATUS online online online online invalid online online invalid

bash-3.00# vxdg free GROUP DISK newdg newdg01 oradg oradg01

DEVICE c1t12d0s2 c1t11d0s2

TAG c1t12d0 c1t11d0

OFFSET 0 0

LENGTH 8315008 35302480

FLAGS -

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 247

bash-3.00# vxdg -g oradg free DISK DEVICE TAG oradg01 c1t11d0s2 c1t11d0

OFFSET 0

LENGTH 35302480

FLAGS -

CREATING A NON-CDS DISK & DISK GROUP: 1. If we are working with sliced disks & non-CDS disk groups, we can initalize a disk as a sliced disk & create a non-CDS disk group. 2. To initialize a disk as a sliced disk Syn: # vxdisksetup -i <device_tag> format=sliced 3. To intialize a non-cds disk group syn: # vxdg init <diskgroup> <disk_name>=<device_tag> cd =off

EVACUVATING A DISK: Before renaming the disk, we need to evacuvate data from the disk to another disk in the disk group. 1. # vxdiskadm " Move volumes from a disk " 2. Syn: eg: # vxevac -g diskgroup from_disk [to_disk] # vxevac -g datadg datadg02 datadg03

3. To evacuvate to any disk except for datadg03 # vxevac -g datadg datadg02 !datadg03

REMOVING A DISK FROM VXVM: 1. # vxdiskadm " Remove a disk " 2. Syn: # vxdg -g <disk_group> rmdisk <disk_name> Syn: # vxdiskunsetup [-C] <device_tag> eg: # vxdg -g newdg rmdisk newdg02 # vxdiskunsetup -C Disk-02 NOTE: Remove the disk from the disk group & then uninitialize it.

Output: Removing a disk from the disk group: bash-3.00# vxdisk list DEVICE TYPE c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:cdsdisk c1t12d0s2 auto:cdsdisk c2t0d0s2 auto:none

DISK oradg03 oradg02 oradg01 newdg01 -

GROUP oradg oradg oradg newdg -

STATUS online online online online online online invalid

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 248

bash-3.00# vxdg -g oradg rmdisk oradg03 bash-3.00# vxdisk list DEVICE TYPE c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:cdsdisk c1t12d0s2 auto:cdsdisk c2t0d0s2 auto:none

DISK oradg02 oradg01 newdg01 -

GROUP oradg oradg newdg -

STATUS online online online online online online invalid

Output: Removing the disk from the VxVM control: To remove the disk from the veritas control bash-3.00# vxdisk list DEVICE TYPE DISK GROUP c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:cdsdisk c1t10d0s2 auto:cdsdisk oradg02 oradg c1t11d0s2 auto:cdsdisk oradg01 oradg c1t12d0s2 auto:cdsdisk newdg01 newdg c2t0d0s2 auto:none bash-3.00# vxdiskunsetup -C c1t9d0 bash-3.00# vxdisk list DEVICE TYPE c1t2d0s2 auto:cdsdisk c1t9d0s2 auto:none c1t10d0s2 auto:cdsdisk c1t11d0s2 auto:cdsdisk c1t12d0s2 auto:cdsdisk c2t0d0s2 auto:none

STATUS online online online online online online invalid

DISK oradg02 oradg01 newdg01 -

GROUP oradg oradg newdg -

STATUS online online invalid online online online online invalid

RENAMING A DISK: Syn: # vxedit -g <disk_group> rename <old_name> <new_name> eg: # vxedit -g datadg rename datadg01 datadg03

NOTE: 1. New disk name must be unique within the disk group. 2. Renaming a disk does not auomatically rename sub-disks on that disk.

DEPORITNG A DISK GROUP: 1. What is a deported disk group/ a. the disk group and its volumeas are unavailable b. the disks cannot be removed c. the disk group cannot be accessed until it is imported 2. Before deporting a disk group a. unmount the file system b. stop volumes

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 249

3. When we deport a disk group, we can specify a. a new host b. a new disk group name 4. # vxdiskadm " Remove access to (deport) a disk group " 5. Syn: eg: # vxdg deport <disk_group> # vxdg deport newdg

6. To deport & rename a disk group syn: # vxdg -n <new_name> deport <old_name> eg: # vxdg -n newdg deport olddg 7. To deport a disk group & specify a new host syn: # vxdg -h <host-name> deport <disk-group> eg: # vxdg -h fire1 deport newdg

IMPORITNG A DISK GROUP: 1. Importing a disk group re-enables access to the disk group When we import a disk group, we can a. specify a new disk group name b. clear host locks c. import as temportary d. force on import 2. # vxdiskadm " Enable access to (import) a disk group " 3. Syn: # vxdg import <disk-group> eg: # vxdg import newdg 4. After importing the disk group, start all volumes # vxvol -g newdg startall 5. To import & rename a disk group syn: # vxdg -n <new-name> import <old-name> eg: # vxdg -n newerdg import newdg 6. To import & rename temporarily syn: # vxdg -t -n <new-name> import <old-name> eg: # vxdg -t -n newerdg import newdg 7. To clear import lock, # vxdg -tC -n newerdg import newdg

DESTROY A DISK GROUP: 1. Means that the disk group nolinger exists 2. Retuns all disks to the free disk pool 3. Is the only method for freeing the last disk in the disk group 4. Syn: # vxdg destroy <disk-group> eg: # vsdg destroy olddg
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 250

Output: bash-3.00# vxdg destroy newdg bash-3.00# vxdg list NAME STATE ID oradg enabled,cds

1256796536.19.fire1

DISK GROUP VERSIONING: 1. All disk groups have a version number based on the VxVM release 2. Each disk group version supports a set of features. we must upgrade old disk group versions in order to use new features NOTE: We cannot upgrade to a specific version using VEA. We can only upgrade to the current version. To upgrade to specific version, we have to use 3. To display the disk group version, # vxdg list newdg 4. To upgrade the disk group version syn: # vxdg [-T version] upgrade <disk-group> eg: # vxdg -T 40 upgrade datadg 5. To create a version 50 disk group # vxdg -T 50 init newdg newdg01=disk01

TO CREATE A VXFS:

# mkfs -F vxfs /dev/vx/rdsk/datadg/shivavol NOTE: If we edit the file /etc/default/fs

Output: bash-3.00# cat /etc/default/fs LOCAL=vxfs

Then there is no need to specify the file system while creating the file system. bash-3.00# mkfs -F vxfs /dev/vx/rdsk/newdg/newvol1 version 7 layout 2097152 sectors, 1048576 blocks of size 1024, log size 16384 blocks largefiles supported

NOTE: It's recommended to create the file system to # mkfs command


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 251

To MOUNT: # mount -F vxfs /dev/vx/dsk/datadg/shivavol /check # fstyp /dev/vx/dsk/datadg/shivavol used to know the file system type Output: bash-3.00# mount -F vxfs /dev/vx/dsk/newdg/newvol1 /mnt/newdg/volume_1 bash-3.00# tail -1 /etc/mnttab /dev/vx/dsk/newdg/newvol1 /mnt/newdg/volume_1 vxfs rw,suid,delaylog,largefiles,ioerror=mwdisable,dev=4449858 # prtvtoc /dev/vx/dsk/datadg/shivavol Note: # prtvtoc -pv | grep bootpath shows the physical device path of the booted OS.

1256798149

ADMINISTERING SUBDISKS: 1. Creating the subdiks 2. Viewing the subdisk information 3. Associating the subdisk with the plex 4. Dissociating the subdisk from the plex 5. Deleting the subdisk

Creating subdisk: Output:


bash-3.00# vxmake -g datadg sd datadg01-01 datadg01,0,8000 bash-3.00# vxprint -g datadg -st SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE sd datadg01-01 datadg01 0 8000 c1t12d0 ENA

MODE MODE MODE

bash-3.00# vxprint -g datadg -st SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE sd datadg01-01 -

DISKOFFS LENGTH NVOLLAYR LENGTH DISKOFFS LENGTH 8000

[COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE c1t12d0

MODE MODE MODE ENA

datadg01 0

bash-3.00# vxmake -g oradg sd oradg02-05 oradg01,6291456,2g bash-3.00# vxprint -g oradg -st SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE sd sd sd sd oradg02-01 oradg02-02 oradg02-04 oradg02-05

DISKOFFS LENGTH NVOLLAYR LENGTH DISKOFFS LENGTH

[COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE 0 c1t10d0 c1t11d0 c1t11d0 c1t11d0 ENA

MODE MODE MODE ENA ENA ENA

vol1-01 oradg02 0 4194304 oradg01 0 2097152 oradg01 2097152 4194304 oradg01 6291456 4194304 -

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 252

Viewing the subdisk information: Output:


bash-3.00# vxprint -st Disk group: oradg SD NAME SV NAME SC NAME sd oradg02-01 PLEX PLEX PLEX vol1-01 DISK VOLNAME CACHE oradg02 0 DISKOFFS LENGTH NVOLLAYR LENGTH DISKOFFS LENGTH 4194304 0 [COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE c1t10d0 ENA MODE MODE MODE

Disk group: newdg SD NAME SV NAME SC NAME sd newdg01-01 PLEX PLEX PLEX newvol1-01 DISK VOLNAME CACHE DISKOFFS LENGTH NVOLLAYR LENGTH DISKOFFS LENGTH 2097152 0 [COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE c1t9d0 ENA MODE MODE MODE

newdg01 0

bash-3.00# vxprint -g newdg -s TY NAME ASSOC KSTATE LENGTH PLOFFS STATE sd newdg01-01 newvol1-01 ENABLED 2097152 0 -

TUTIL0 -

PUTIL0

bash-3.00# vxprint -g newdg -l newdg01-01 Subdisk: newdg01-01 info: disk=newdg01 offset=0 len=2097152 assoc: vol=newvol1 plex=newvol1-01 (offset=0) flags: enabled device: device=c1t9d0s2 path=/dev/vx/dmp/c1t9d0s2 diskdev=272/26

Associating the subdisk to the plex: Output: Case-1:


bash-3.00# vxmake -g oradg plex oradgvol01-01 sd=oradg02-02,oradg02-04 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE pl oradgvol01-01 pl vol1-01 vol1 DISABLED ENABLED ACTIVE 6291456 4194304 CONCAT CONCAT RW RW

Case-2:
bash-3.00# vxsd -g oradg assoc oradgvol01-01 oradg02-05 oradg02-06 bash-3.00# vxprint -g oradg -st SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE sd sd sd sd sd oradg02-01 oradg02-02 oradg02-04 oradg02-05 oradg02-06 vol1-01 oradg02 oradgvol01-01 oradg01 oradgvol01-01 oradg01 oradgvol01-01 oradg01 oradgvol01-01 oradg02

DISKOFFS LENGTH NVOLLAYR LENGTH DISKOFFS LENGTH

[COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE

MODE MODE MODE

0 4194304 0 c1t10d0 ENA 0 2097152 0 c1t11d0 ENA 2097152 4194304 2097152 c1t11d0 ENA 6291456 4194304 6291456 c1t11d0 ENA 10485760 2097152 10485760 c1t10d0 ENA

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 253

Deleting/the subdisk: Output:


bash-3.00# vxedit -g datadg rm datadg01-01 bash-3.00# vxsd -g oradg -o rm dis oradg02-06 bash-3.00# vxprint -g oradg -st SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE sd sd sd sd oradg02-01 oradg02-02 oradg02-04 oradg02-05 vol1-01 oradg02 oradgvol01-01 oradg01 oradgvol01-01 oradg01 oradgvol01-01 oradg01

DISKOFFS LENGTH NVOLLAYR LENGTH DISKOFFS LENGTH 0 0 2097152 6291456 4194304 2097152 4194304 4194304

[COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE 0 0 2097152 6291456 c1t10d0 c1t11d0 c1t11d0 c1t11d0

MODE MODE MODE ENA ENA ENA ENA

bash-3.00# vxsd -g oradg dis oradg02-05 bash-3.00# vxprint -g oradg -st SD NAME PLEX DISK DISKOFFS LENGTH SV NAME PLEX VOLNAME NVOLLAYR LENGTH SC NAME PLEX CACHE DISKOFFS LENGTH sd sd sd sd oradg02-01 oradg02-02 oradg02-04 oradg02-05 vol1-01 oradg02 oradgvol01-01 oradg01 oradgvol01-01 oradg01 oradg01 0 0 2097152 6291456 4194304 2097152 4194304 4194304

[COL/]OFF DEVICE [COL/]OFF AM/NM [COL/]OFF DEVICE 0 0 2097152 c1t10d0 c1t11d0 c1t11d0 c1t11d0

MODE MODE MODE ENA ENA ENA EN

ADMINSTERING PLEX: 1. 2. 3. 4. 5. Creating the plex Viewing the plexormation Associating the plexh the volume Dissociating the plex from the volume Deleting the plex

Creating a plex: Output:


bash-3.00# vxmake -g oradg plex oradgvol1-01 sd=oradg02-04,oradg02-05 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE pl oradgvol1-01 pl oradgvol01-01 pl vol1-01 vol1

STATE

LENGTH

LAYOUT

NCOL/WID MODE

DISABLED 8388608 CONCAT RW DISABLED 2097152 CONCAT ENABLED ACTIVE 4194304 CONCAT -

RW RW

Viewing plex information:


bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE LENGTH LAYOUT CONCAT CONCAT CONCAT NCOL/WID MODE RW RW RW

pl oradgvol1-01 DISABLED 8388608 pl oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 pl vol1-01 vol1 ENABLED ACTIVE 4194304 bash-3.00# vxplex -g oradg att oradgvolume oradgvol1-01 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE LENGTH pl oradgvol1-01 oradgvolume DISABLED EMPTY 8388608

LAYOUT CONCAT

NCOL/WID MODE RW

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 254

pl oradgvol01-01 oradgvolume DISABLED EMPTY pl vol1-01 vol1 ENABLED ACTIVE

2097152 4194304

CONCAT CONCAT

RW RW

bash-3.00# vxprint -g oradg -l oradgvol01-01 Plex: oradgvol01-01 info: len=2097152 type: layout=CONCAT state: state= kernel=DISABLED io=read-write assoc: vol=(dissoc) sd=oradg02-02 flags:

Associating plex to volume: Output:

Case-1:

bash-3.00# vxplex -g oradg att oradgvolume oradgvol1-01 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE

STATE

LENGTH

LAYOUT

NCOL/WID MODE RW RW RW

pl oradgvol1-01 oradgvolume DISABLED EMPTY 8388608 CONCAT pl oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT pl vol1-01 vol1 ENABLED ACTIVE 4194304 CONCAT -

Case-2:
bash-3.00# vxmake -g oradg -U fsgen vol oradgvolume plex=oradgvol01-01 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE pl oradgvol1-01 DISABLED pl oradgvol01-01 oradgvolume DISABLED EMPTY pl vol1-01 vol1 ENABLED ACTIVE 8388608 2097152 4194304 CONCAT CONCAT CONCAT RW RW RW

bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE

STATE

LENGTH

LAYOUT

NCOL/WID MODE RW RW RW

pl oradgvol1-01 oradgvolume DISABLED EMPTY 8388608 CONCAT pl oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT pl vol1-01 vol1 ENABLED ACTIVE 4194304 CONCAT -

Dissociating/Deleting the plex: Output: Case-1:


bash-3.00# vxplex -g oradg det oradgvol1-01 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE pl oradgvol1-01 oradgvolume DETACHED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY pl vol1-01 vol1 ENABLED ACTIVE Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

LENGTH 8388608 2097152 4194304

LAYOUT CONCAT CONCAT CONCAT

NCOL/WID MODE RW RW RW

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 255

Case-2:
bash-3.00# vxplex -g oradg -o rm dis oradgvol1-01 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE LENGTH pl oradgvol01-01 oradgvolume DISABLED EMPTY pl vol1-01 vol1 ENABLED ACTIVE 2097152 4194304

LAYOUT CONCAT CONCAT

NCOL/WID MODE RW RW

TO DISPLAY VM OBJECTS STATUS: 1. # vxprint 2. # vxtask list displays the % progress, task id 3. # vxtask monitor <id> continuously displays the % of the progress

Note: 1. As for VxVM commands the default size unit is "s" - representing the sector 2. Add suffix such as a. k - kilo byte b. m - mega byte c. g - giga byte 19. # vxprint [-g disk-group] -l subdisk displays all information for sub-disks in the disk group specified eg: # vxprint -g nmydg -l mydg02-01

20. # vxprint -hvt to display the volume, plex & sub-disk record information for all volumes in the system

ADMINSTERING THE VOLUME: INITIALIZING & STARTING A VOLUME: 1. # vxvol [-g diskgroup] start volume to initialize & start a volume 2. # vxvol [-g diksgroup] init enable volume can be used to enable the volume without initializing 3. # vxvol [-g diskgroup] init active volume to restore data on the volume from a backup before using the command to make the volume fully active 4. If we want to zero out the contents of the entire volume # vxvol [-g diskgroup] init zero volume

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 256

CREATING A VOLUME: Before creating a volume, initialize disk & assign them to disk groups 1. Striped volume requires minimum 2 disks

2. Mirrored volume requires minimum one hard disk for each plex. A mirror cannot be on the same disk that the other plexes are using. 3. Raid-5: Minimum 3 disks are required

To create a volume: # vxassist g <disk-group> make volume-name length [attributes] 2. To display volume attributes

# vxassist g <disk-group> help showattrs CONCATENATED VOLUME: 1. To create a concatenated volume

#vxassist g datadg make datavol 10g datadg - disk group name datavol volume name 10g volume size

2.

If an /etc/default/vxassist file exists with a different layout

# vxassist g datadg make datavol 10g layout=nostripe

3.

To create a concatenated volume on specific disks

# vxassist g datadg make datavol 10g datadg02 datadg03 datadg02, datadg03 disk media name

Output: Concatenated volume:


bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v v v oradgvolume oradgvolume-01 vol1 STATE LENGTH 2097152 4194304 4194304 READPOL ROUND SELECT SELECT PREFPLEX UTYPE fsgen fsgen fsgen

DISABLED EMPTY ENABLED ACTIVE ENABLED ACTIVE

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 257

bash-3.00# vxassist -g oradg make oradgvolme-02 1g oradg03 bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v oradgvolme-02 v oradgvolume v oradgvolume-01 v vol1 -

STATE

LENGTH

READPOL

PREFPLEX UTYPE fsgen -

ENABLED ACTIVE 2097152 SELECT DISABLED EMPTY 2097152 ROUND ENABLED ACTIVE 4194304 SELECT ENABLED ACTIVE 4194304 SELECT

fsgen fsgen fsgen

bash-3.00# vxprint -g oradg -l oradgvolme-02 Volume: oradgvolme-02 info: len=2097152 type: usetype=fsgen state: state=ACTIVE kernel=ENABLED cdsrecovery=0/0 (clean) assoc: plexes=oradgvolme-02-01 exports=(none) policies: read=SELECT (round-robin) exceptions=GEN_DET_SPARSE flags: closed writeback siteconsistent logging: type=REGION loglen=0 serial=0/0 mapalign=0 maplen=0 (disabled) apprecov: seqno=0/0 recovery: mode=default recov_id=0 device: minor=25003 bdev=273/25003 cdev=273/25003 path=/dev/vx/dsk/oradg/oradgvolme-02 perms: user=root group=root mode=0600 guid: {19294dba-1dd2-11b2-be03-0003ba2d10ed}

bash-3.00# vxprint -g oradg -hvt V NAME RVG/VSET/CO KSTATE PL NAME VOLUME KSTATE SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE DC NAME PARENTVOL LOGVOL SP NAME SNAPVOL DCO EX NAME ASSOC VC

STATE STATE DISKOFFS NVOLLAYR DISKOFFS

LENGTH LENGTH LENGTH LENGTH LENGTH

READPOL LAYOUT [COL/]OFF [COL/]OFF [COL/]OFF

PREFPLEX NCOL/WID DEVICE AM/NM DEVICE

UTYPE MODE MODE MODE MODE

PERMS

MODE

STATE fsgen RW ENA fsgen RW ENA fsgen RW ENA fsgen RW ENA

v oradgvolme-02 ENABLED ACTIVE 2097152 SELECT pl oradgvolme-02-01 oradgvolme-02 ENABLED ACTIVE 2097152 CONCAT sd oradg03-02 oradgvolme-02-01 oradg03 4194304 2097152 0 v oradgvolume DISABLED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY sd oradg02-02 oradgvol01-01 oradg01 0 2097152 2097152 2097152 ROUND CONCAT 0

c1t12d0 c1t11d0

v oradgvolume-01 ENABLED ACTIVE 4194304 SELECT pl oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 4194304 CONCAT sd oradg03-01 oradgvolume-01-01 oradg03 0 4194304 0 c1t12d0 v vol1 pl vol1-01 sd oradg02-01 vol1 vol1-01 ENABLED ENABLED oradg02 ACTIVE ACTIVE 0 4194304 4194304 4194304 SELECT CONCAT 0 c1t10d0

STRIPED VOLUME: 1. To create a striped volume

# vxassist g <disk-group> make <volume-name> length layout=stripe ncol=n stripeunit=size [disks]

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 258

Example: # vxassist g acctdg make payvol 26 layout=stripe ncol=3 !acctdg04 # vxassist g acctdg make export 2g layout=stripe ncol=3 stripeunit=64k acctg01 acctdg02 acctg03 Output: Striped volume:
bash-3.00# vxassist -g oradg make oradgvolume-03 1g layout=stripe bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v v v v v oradgvolme-02 oradgvolume oradgvolume-01 oradgvolume-03 vol1 ENABLED DISABLED ENABLED ENABLED ENABLED ACTIVE EMPTY ACTIVE ACTIVE ACTIVE 2097152 2097152 4194304 2097152 4194304 SELECT ROUND SELECT SELECT SELECT fsgen fsgen fsgen oradgvolume-03-01 fsgen fsgen

bash-3.00# vxassist -g oradg make oradgvolume-04 1g oradg01 oradg02 layout=stripe bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v v v v v v oradgvolme-02 oradgvolume oradgvolume-01 oradgvolume-03 oradgvolume-04 vol1 ENABLED DISABLED ENABLED ENABLED ENABLED ENABLED

STATE ACTIVE EMPTY ACTIVE ACTIVE ACTIVE ACTIVE

LENGTH 2097152 2097152 4194304 2097152 2097152 4194304

READPOL SELECT ROUND SELECT SELECT SELECT SELECT

PREFPLEX UTYPE fsgen fsgen fsgen oradgvolume-03-01 fsgen oradgvolume-04-01 fsgen fsgen

bash-3.00# vxassist -g oradg make oradgvolume-01 1g layout=stripe ncol=3 \!oradg03

RAID-5: 1. To create a Raid-5 volume

# vxassist g <disk-group> make <volume-name> length layout=raid5 ncol=n stripeunit=size [disks] a. b. default ncol=3 default stripe unit =16k

c. log is created by default. Therefore, we need atleast one or more disk than the number of coloumns.

Example: # vxassist g acctdg make payvol 10g layout=raid5

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 259

Output: Raid -5:


bash-3.00# vxassist -g oradg make oradgvolume-03 1g layout=raid5 bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v oradgvolume v oradgvolume-01 v oradgvolume-02 v oradgvolume-03 -

STATE

LENGTH

READPOL

PREFPLEX UTYPE fsgen oradgvolume-01-01 fsgen oradgvolume-02-01 fsgen raid5

DISABLED EMPTY 2097152 ROUND ENABLED ACTIVE 2097152 SELECT ENABLED ACTIVE 1024000 SELECT ENABLED ACTIVE 2097216 RAID -

bash-3.00# vxprint -g oradg -hvt V NAME RVG/VSET/CO KSTATE PL NAME VOLUME KSTATE SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE DC NAME PARENTVOL LOGVOL SP NAME SNAPVOL DCO EX NAME ASSOC VC

STATE STATE DISKOFFS NVOLLAYR DISKOFFS

LENGTH LENGTH LENGTH LENGTH LENGTH

READPOL LAYOUT [COL/]OFF [COL/]OFF [COL/]OFF

PREFPLEX NCOL/WID DEVICE AM/NM DEVICE

UTYPE MODE MODE MODE MODE

PERMS 2097152 2097152 2097152 ROUND CONCAT 0

MODE

STATE fsgen RW ENA

v oradgvolume DISABLED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY sd oradg02-02 oradgvol01-01 oradg01 0 v pl sd sd sd v pl sd sd sd v pl sd sd sd sd pl sd

c1t11d0

oradgvolume-01 ENABLED ACTIVE 2097152 SELECT oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 2097408 STRIPE oradg03-01 oradgvolume-01-01 oradg03 0 699136 0/0 oradg01-01 oradgvolume-01-01 oradg01 2097152 699136 1/0 oradg02-01 oradgvolume-01-01 oradg02 15704064 699136 2/0 oradgvolume-02 ENABLED ACTIVE 1024000 SELECT oradgvolume-02-01 oradgvolume-02 ENABLED ACTIVE 1024512 STRIPE oradg03-02 oradgvolume-02-01 oradg03 699136 341504 0/0 oradg01-02 oradgvolume-02-01 oradg01 2796288 341504 1/0 oradg02-03 oradgvolume-02-01 oradg02 16403200 341504 2/0 oradgvolume-03 ENABLED ACTIVE 2097216 RAID oradgvolume-03-01 oradgvolume-03 ENABLED ACTIVE 2097216 RAID oradg05-01 oradgvolume-03-01 oradg05 0 699072 0/0 oradg04-01 oradgvolume-03-01 oradg04 0 699072 1/0 oradg03-03 oradgvolume-03-01 oradg03 1040640 699072 2/0 oradg01-03 oradgvolume-03-01 oradg01 3137792 699072 3/0 oradgvolume-03-02 oradgvolume-03 ENABLED LOG 3840 CONCAT oradg02-04 oradgvolume-03-02 oradg02 16744704 3840 0

oradgvolume-01-01 fsgen 3/128 RW c1t12d0 ENA c1t11d0 ENA c1t10d0 ENA oradgvolume-02-01 fsgen 3/256 RW c1t12d0 ENA c1t11d0 ENA c1t10d0 ENA 4/32 c1t2d0 c1t9d0 c1t12d0 c1t11d0 c1t10d0 raid5 RW ENA ENA ENA ENA RW ENA

MIRRORED VOLUME: To create a mirrored volume # vxassist g <disk-group> [-b] make <volume-name> length layout=mirror [mirror=number] Example: 1. # vxassist g datadg make datavol 5g layout=mirror

Concatenated mirror
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 260

2.

# vxassist g datadg make datavol 5g layout=stripe,mirror nmirror=3 specifying 3 mirrors

3.

# vxassist g datadg b make datavol 5g layout=stripe,mirror nmirror=3

Output: Mirror:

bash-3.00# vxassist -g oradg make oradgvolume01 500m layout=mirror


bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v oradgvolume DISABLED v oradgvolume01 ENABLED bash-3.00# vxprint -g oradg -hvt V NAME RVG/VSET/CO KSTATE PL NAME VOLUME KSTATE SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE DC NAME PARENTVOL LOGVOL SP NAME SNAPVOL DCO EX NAME ASSOC VC STATE EMPTY ACTIVE STATE STATE DISKOFFS NVOLLAYR DISKOFFS LENGTH 2097152 1024000 LENGTH LENGTH LENGTH LENGTH LENGTH READPOL ROUND SELECT READPOL LAYOUT [COL/]OFF [COL/]OFF [COL/]OFF PREFPLEX UTYPE PREFPLEX NCOL/WID DEVICE AM/NM DEVICE fsgen fsgen UTYPE MODE MODE MODE MODE

PERMS 2097152 2097152 2097152 ROUND CONCAT 0

MODE

STATE fsgen RW ENA fsgen RW ENA RW ENA

v oradgvolume DISABLED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY sd oradg02-02 oradgvol01-01 oradg01 0 v pl sd pl sd

c1t11d0 c1t2d0 c1t9d0

oradgvolume01 ENABLED ACTIVE 1024000 SELECT oradgvolume01-01 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradg05-01 oradgvolume01-01 oradg05 0 1024000 0 oradgvolume01-02 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradg04-01 oradgvolume01-02 oradg04 0 1024000 0

bash-3.00# vxassist -g oradg make oradgvolume02 500m layout=mirror nmirror=3 bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v v v oradgvolume oradgvolume01 oradgvolume02 DISABLED EMPTY ENABLED ACTIVE ENABLED ACTIVE 2097152 1024000 1024000 ROUND SELECT SELECT fsgen fsgen fsgen

bash-3.00# vxprint -g oradg -hvt V NAME RVG/VSET/CO KSTATE PL NAME VOLUME KSTATE SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE DC NAME PARENTVOL LOGVOL SP NAME SNAPVOL DCO EX NAME ASSOC VC

STATE STATE DISKOFFS NVOLLAYR DISKOFFS

LENGTH LENGTH LENGTH LENGTH LENGTH

READPOL LAYOUT [COL/]OFF [COL/]OFF [COL/]OFF

PREFPLEX NCOL/WID DEVICE AM/NM DEVICE

UTYPE MODE MODE MODE MODE

PERMS 2097152 2097152 2097152 ROUND CONCAT 0

MODE

STATE fsgen RW ENA fsgen RW ENA RW ENA

v oradgvolume DISABLED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY sd oradg02-02 oradgvol01-01 oradg01 0 v pl sd pl sd

c1t11d0 c1t2d0 c1t9d0

oradgvolume01 ENABLED ACTIVE 1024000 SELECT oradgvolume01-01 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradg05-01 oradgvolume01-01 oradg05 0 1024000 0 oradgvolume01-02 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradg04-01 oradgvolume01-02 oradg04 0 1024000 0

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 261

v pl sd pl sd pl sd

oradgvolume02 ENABLED ACTIVE 1024000 SELECT oradgvolume02-01 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradg03-01 oradgvolume02-01 oradg03 0 1024000 0 oradgvolume02-02 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradg05-02 oradgvolume02-02 oradg05 1024000 1024000 0 oradgvolume02-03 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradg04-02 oradgvolume02-03 oradg04 1024000 1024000 0

c1t12d0 c1t2d0 c1t9d0

fsgen RW ENA RW ENA RW ENA

bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE

STATE

LENGTH

LAYOUT

NCOL/WID MODE RW RW RW RW RW RW

pl oradgvolume01-01 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume01-02 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume02-01 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume02-02 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume02-03 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT pl oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT -

bash-3.00# vxassist -g oradg make oradgvolume03 200m layout=stripe,mirror bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v oradgvolume DISABLED v oradgvolume01 ENABLED v oradgvolume02 ENABLED v oradgvolume03 ENABLED bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE pl pl pl pl pl pl pl pl EMPTY ACTIVE ACTIVE ACTIVE STATE 2097152 1024000 1024000 409600 LENGTH ROUND SELECT SELECT SELECT LAYOUT fsgen fsgen fsgen fsgen

NCOL/WID MODE 2/128 2/128 RW RW RW RW RW RW RW RW

oradgvolume01-01 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradgvolume01-02 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradgvolume02-01 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradgvolume02-02 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradgvolume02-03 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradgvolume03-01 oradgvolume03 ENABLED ACTIVE 409600 STRIPE oradgvolume03-02 oradgvolume03 ENABLED ACTIVE 409600 STRIPE oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT

bash-3.00# vxassist -g oradg make oradgvolume04 200m layout=mirror,stripe bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v oradgvolume DISABLED v oradgvolume01 ENABLED v oradgvolume02 ENABLED v oradgvolume03 ENABLED v oradgvolume04 ENABLED bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE pl pl pl pl pl pl pl pl pl pl EMPTY ACTIVE ACTIVE ACTIVE ACTIVE STATE 2097152 1024000 1024000 409600 409600 LENGTH ROUND SELECT SELECT SELECT SELECT LAYOUT fsgen fsgen fsgen fsgen fsgen

NCOL/WID MODE 2/128 2/128 2/128 2/128 RW RW RW RW RW RW RW RW RW RW

oradgvolume01-01 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradgvolume01-02 oradgvolume01 ENABLED ACTIVE 1024000 CONCAT oradgvolume02-01 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradgvolume02-02 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradgvolume02-03 oradgvolume02 ENABLED ACTIVE 1024000 CONCAT oradgvolume03-01 oradgvolume03 ENABLED ACTIVE 409600 STRIPE oradgvolume03-02 oradgvolume03 ENABLED ACTIVE 409600 STRIPE oradgvolume04-01 oradgvolume04 ENABLED ACTIVE 409600 STRIPE oradgvolume04-02 oradgvolume04 ENABLED ACTIVE 409600 STRIPE oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 262

MIRRORED VOLUME WITH LOG: 1.To create a mirrored volume with log # vxassist g diskgroup [-b] make <volume-name> length layout=mirror logtype-drl [nlog=n]

a. b.

logtype = drl (Dirty Log Region) enables drl nlog = n creates nlogs & is used when we want more than one log plex to be created

2.

To create a concatenated volume that is mirrored & logged

# vxassist g datadg make datavol 5m layout=mirror logtype=drl

ESTIMATING THE VOLUME SIZE: To determine largest possible size for a volume # vxassist g <disk-group> maximize attributes

Ex: # vxassist g datadg maxsize layout=raid5 Maximum volume size:376832 (184 mb)

To determine how much a volume can expand # vxassist g <disk-group> maxgrow volume

Ex: # vxassist g datadg maxgrow datavol Volume datavol can be extended by 366592 to 1677312 (819mb)

DISPLAYING VOULME INFORMATION: # vxprint g <disk-group> [options]


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 263

# vxprint g datadg ht | more Options: -ht, -vpsd, -r, -l, -A, -a

REMOVING A VOLUME: 1. When a volume is removed, the space used by the volume is freed and can be used elsewhere (We should only remove a volume, if we are sure that we we do not need the data in the volume) NOTE: 1. 2. A volume must be closed before it can be removed Must manually edit the OS-specific file system table

(/etc/vfstab) in order to remove the entry for the file system and avoid errors at boot time. 2. Unmount the file system before removing the volume

Syn: # vxassist g <disk-group> remove volume volme-name Ex: # vxassist g datadg remove volume datavol

Syn: # vxedit g <disk-group> -rf rm volume-name Ex: # vxedit g datadg rf rm datavol

Output: Removing the volume:


bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v v v v v v oradgvolme-02 oradgvolume oradgvolume-01 oradgvolume-03 oradgvolume-04 vol1 ENABLED DISABLED ENABLED ENABLED ENABLED ENABLED STATE ACTIVE EMPTY ACTIVE ACTIVE ACTIVE ACTIVE LENGTH 2097152 2097152 4194304 2097152 2097152 4194304 READPOL SELECT ROUND SELECT SELECT SELECT SELECT PREFPLEX UTYPE fsgen fsgen fsgen oradgvolume-03-01 fsgen oradgvolume-04-01 fsgen fsgen

bash-3.00# bash-3.00# bash-3.00# bash-3.00# bash-3.00#

vxassist vxassist vxassist vxassist vxassist

-g -g -g -g -g

oradg oradg oradg oradg oradg

remove remove remove remove remove

volume volume volume volume volume

vol1 oradgvolme-02 oradgvolume-01 oradgvolume-03 oradgvolume-04 Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 264

bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v oradgvolume -

STATE

LENGTH 2097152

READPOL ROUND

PREFPLEX UTYPE fsgen

DISABLED EMPTY

bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE

STATE

LENGTH

READPOL

PREFPLEX UTYPE

v oradgvolume DISABLED EMPTY 2097152 ROUND fsgen bash-3.00# vxassist -g oradg make oradgvolume-01 1g layout=stripe ncol=3 bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v v oradgvolume oradgvolume-01 DISABLED EMPTY ENABLED ACTIVE 2097152 2097152 ROUND SELECT fsgen oradgvolume-01-01 fsgen

bash-3.00# vxprint -g oradg -hvt V NAME RVG/VSET/CO KSTATE PL NAME VOLUME KSTATE SD NAME PLEX DISK SV NAME PLEX VOLNAME SC NAME PLEX CACHE DC NAME PARENTVOL LOGVOL SP NAME SNAPVOL DCO EX NAME ASSOC VC

STATE STATE DISKOFFS NVOLLAYR DISKOFFS

LENGTH LENGTH LENGTH LENGTH LENGTH

READPOL LAYOUT [COL/]OFF [COL/]OFF [COL/]OFF

PREFPLEX NCOL/WID DEVICE AM/NM DEVICE

UTYPE MODE MODE MODE MODE

PERMS 2097152 2097152 2097152 ROUND CONCAT 0

MODE

STATE fsgen RW ENA

v oradgvolume DISABLED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY sd oradg02-02 oradgvol01-01 oradg01 0 v pl sd sd sd

c1t11d0

oradgvolume-01 ENABLED ACTIVE 2097152 SELECT oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 2097408 STRIPE oradg03-01 oradgvolume-01-01 oradg03 0 699136 0/0 oradg01-01 oradgvolume-01-01 oradg01 2097152 699136 1/0 oradg02-01 oradgvolume-01-01 oradg02 15704064 699136 2/0

oradgvolume-01-01 fsgen 3/128 RW c1t12d0 ENA c1t11d0 ENA c1t10d0 ENA

bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v v v v v oradgvolume oradgvolume01 oradgvolume02 oradgvolume03 oradgvolume04 DISABLED ENABLED ENABLED ENABLED ENABLED

STATE EMPTY ACTIVE ACTIVE ACTIVE ACTIVE

LENGTH 2097152 1024000 1024000 409600 409600

READPOL ROUND SELECT SELECT SELECT SELECT

PREFPLEX UTYPE fsgen fsgen fsgen fsgen fsgen

bash-3.00# vxedit -g oradg -rf rm oradgvolume01 bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE v v v v oradgvolume oradgvolume02 oradgvolume03 oradgvolume04 DISABLED ENABLED ENABLED ENABLED

STATE EMPTY ACTIVE ACTIVE ACTIVE

LENGTH 2097152 1024000 409600 409600

READPOL ROUND SELECT SELECT SELECT

PREFPLEX UTYPE fsgen fsgen fsgen fsgen

bash-3.00# vxassist -g oradg make oradgvolume-02 500m layout=stripe ncol=3 stripeunit=128k bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v v v oradgvolume oradgvolume-01 oradgvolume-02 DISABLED EMPTY ENABLED ACTIVE ENABLED ACTIVE 2097152 2097152 1024000 ROUND SELECT SELECT fsgen oradgvolume-01-01 fsgen oradgvolume-02-01 fsgen

bash-3.00# vxprint -g oradg -hvt Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 265

V PL SD SV SC DC SP EX

NAME NAME NAME NAME NAME NAME NAME NAME

RVG/VSET/CO VOLUME PLEX PLEX PLEX PARENTVOL SNAPVOL ASSOC

KSTATE KSTATE DISK VOLNAME CACHE LOGVOL DCO VC

STATE STATE DISKOFFS NVOLLAYR DISKOFFS

LENGTH LENGTH LENGTH LENGTH LENGTH

READPOL LAYOUT [COL/]OFF [COL/]OFF [COL/]OFF

PREFPLEX NCOL/WID DEVICE AM/NM DEVICE

UTYPE MODE MODE MODE MODE

PERMS 2097152 2097152 2097152 ROUND CONCAT 0

MODE

STATE fsgen RW ENA

v oradgvolume DISABLED EMPTY pl oradgvol01-01 oradgvolume DISABLED EMPTY sd oradg02-02 oradgvol01-01 oradg01 0 v pl sd sd sd v pl sd sd sd

c1t11d0

oradgvolume-01 ENABLED ACTIVE 2097152 SELECT oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 2097408 STRIPE oradg03-01 oradgvolume-01-01 oradg03 0 699136 0/0 oradg01-01 oradgvolume-01-01 oradg01 2097152 699136 1/0 oradg02-01 oradgvolume-01-01 oradg02 15704064 699136 2/0 oradgvolume-02 ENABLED ACTIVE 1024000 SELECT oradgvolume-02-01 oradgvolume-02 ENABLED ACTIVE 1024512 STRIPE oradg03-02 oradgvolume-02-01 oradg03 699136 341504 0/0 oradg01-02 oradgvolume-02-01 oradg01 2796288 341504 1/0 oradg02-03 oradgvolume-02-01 oradg02 16403200 341504 2/0

oradgvolume-01-01 fsgen 3/128 RW c1t12d0 ENA c1t11d0 ENA c1t10d0 ENA oradgvolume-02-01 fsgen 3/256 RW c1t12d0 ENA c1t11d0 ENA c1t10d0

CONFIGURING THE VOLUMES: ADMINISTERING MIRRORS: Adding a mirror to a volume: 1. Can add a mirror to an existing concatenated/Striped volume.

Only concatenated/striped volumes can be mirrored. 2. 3. 4. By default, a mirror is created with the same plex layout as the original volume. A mirrored volume requires at least 2 disks in the same disk group. Synchronization of the new plex is required.

NOTE: 1. Cannot add a mirror to a disk that is already being used by the volume. Syn: # vxassist g <disk-group> mirror volume [layout=layout-type] [disk-name] Ex: # vxassist g datadg mirror datavol

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 266

REMOVING A MIRROR: Why to remove a mirror? a. b. Removing a mirror frees the space occupied by that mirror To reduce the number of mirrors in a volume in order to reduce I/O to the volume.

Syn: # vxassist g <disk-group> remove mirror volume [!]dm-name Ex: # vxassist g datadg remove mirror datavol ! datadg02 To remove the plex that contains a sub-disk from the disk datadg02. NOTE: To remove the plex that contains a sub-disk froma specific disk [!] is used. # vxassist g datadg remove mirror datavol datadg0 To remove the plex that uses any disk expect datadg02 We can also used the vxplex and vxedit commands in combination to remove the mirror. # vxplex g <disk-group> dis plex-name # vxedit g <disk-group> -rf plex-name

Dirtly Region Logging for mirrored volumes 1. 2. Logs keep track of changed regions If the system fails, only the changed regions of volume must be recovered

Output:

bash-3.00# vxassist -g oradg make oradgvolume-02 500m layout=mirror nmirror=4 bash-3.00# vxprint -g oradg -vt V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE v v v oradgvolume oradgvolume-01 oradgvolume-02 DISABLED EMPTY ENABLED ACTIVE ENABLED ACTIVE 2097152 2048000 1024000 ROUND SELECT SELECT fsgen fsgen fsgen

bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE

STATE

LENGTH

LAYOUT

NCOL/WID MODE RW RW RW RW RW RW

pl oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 2048000 CONCAT pl oradgvolume-02-01 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume-02-02 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume-02-03 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume-02-04 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT -

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 267

bash-3.00# vxassist -g oradg remove mirror oradgvolume-02 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE

STATE

LENGTH

LAYOUT

NCOL/WID MODE RW RW RW RW RW

pl oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 2048000 CONCAT pl oradgvolume-02-01 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume-02-03 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvolume-02-04 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT pl oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT bash-3.00# vxassist -g oradg remove mirror oradgvolume-02 bash-3.00# vxprint -g oradg -pt PL NAME VOLUME KSTATE STATE LENGTH LAYOUT pl pl pl pl

NCOL/WID MODE RW RW RW RW

oradgvolume-01-01 oradgvolume-01 ENABLED ACTIVE 2048000 CONCAT oradgvolume-02-01 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT oradgvolume-02-04 oradgvolume-02 ENABLED ACTIVE 1024000 CONCAT oradgvol01-01 oradgvolume DISABLED EMPTY 2097152 CONCAT -

bash-3.00# vxassist -g oradg remove mirror oradgvolume-02 \!oradg03

ADDING / REMOVING THE LOG: Syn: # vxassist g <disk-group> addlog volume [logtype=drl] [nlog=n] [attributes]

1.

To add a dirty regions log to an existing mirrored volume.

# vxassist g datadg addlog datavol logtype=drl

2.

To add a Raid-5 log to a Raid-5 volume, no log type is needed

# vxassist g acctdg addlog payvol

3.

To remove a log from a volume

# vxassist g diskgroup remove log [nlog=n] volume

RECONFIGURING VOLUME ONLINE: REMOVING A VOLUME: To resize a volume, a. b. specify a desired new volume size add to or subtract form the current volume size

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 268

Expanding a volume provides more space to users: 1. 2. Disk space must be available VXVM assign disk space, or can specify disks

Shrinking a volume enable to use space elsewhere. VXVM returns space to the free space pool.

If volume is resized, its file system must also be resized, a. b. c. vxfs can be expanded or reduced while mounted ufs can be expanded but not reduced ensure that the data manager application supports resizing.sss

RESIZING A VOLUME: 1. Can expand and shrink a mounted veritas files system but unmounted veritas file system cannot be changed. 2. A mounted or unmounted ufs can only be expanded. syn:# vxresize [-b] fstype -g <disk-group> volume [+/-] new-length for ex: Original volume size : 10 mb 1. # 2. # 3. # 4. # vxresize vxresize vxresize vxresize -g -g -g -g mydg mydg mydg mydg myvol myvol myvol myvol 50m +10m 40m -10m

Output: Resizing: bash-3.00# vxresize -g oradg oradgvolume04 +100m bash-3.00# df -F vxfs -h Filesystem size used avail capacity /dev/vx/dsk/oradg/oradgvolume04 300M 2.2M 279M 1%

Mounted on /mnt/volume04

bash-3.00# vxresize -g oradg oradgvolume04 +300m bash-3.00# df -F vxfs -h Filesystem size used avail capacity /dev/vx/dsk/oradg/oradgvolume04 600M 2.2M 560M 1%
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Mounted on /mnt/volume04

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 269

bash-3.00# vxresize -g oradg oradgvolume04 -300m bash-3.00# df -F vxfs -h Filesystem size used avail capacity /dev/vx/dsk/oradg/oradgvolume04 300M 2.2M 279M 1%

Mounted on /mnt/volume04

bash-3.00# vxresize -g oradg oradgvolume04 700m bash-3.00# df -F vxfs -h Filesystem size used avail capacity /dev/vx/dsk/oradg/oradgvolume04 700M 2.3M 654M 1% bash-3.00# vxresize -g oradg oradgvolume04 500m bash-3.00# df -F vxfs -h Filesystem size used avail capacity /dev/vx/dsk/oradg/oradgvolume04 500M 2.2M 467M 1%

Mounted on /mnt/volume04

Mounted on /mnt/volume04

Resizing a volume using vxassist: syn: # vxassist -g <disk-group> [growto|growby|shrinkby| shrinkto] volume-size For example: Original volume size: 20mb 1. # 2. # 3. # 4. # vxassist vxassist vxassist vxassist -g -g -g -g datadg datadg datadg datadg growto datavol 40m growby datavol 10m shrinkto datavol 30m shrinkby datavol 10m

Resizing a file system using fsadm: syn: # fsadm [fs-type] [-b new-size] [-r raw-dev] mount-point examle: Expand the file system/datavol from 512000 sectors to 1024000 sectors 1. verify the free space on the underlying device: # vxdg -g datadg free 2. Expand the volume using vxassist # vxassist -g datadg growto myvol 1024000 3. Expand the file system using fsadm #fsadm -F vxfs -b 1024000 -r /dev/vx/rdsk/datadg/datavol /datavol 4. Verify that the file system was resized by using dg: # df -k /datavol
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 270

Resizing a dyanmic LUN: 1. If we resize a LUN in the hardware, we should resizse the VxVM disk corresponding to that LUN. 2. Disk headers and other VxVM structures are updated to reflect the new size. 3. Intended for devices that are part of an imported disk group syn: # vxassist [-f] -g <disk-group> resize {access-name|media-name} length=attribute eg: vxassist -g datadg resize datadg01 length=8GB

What is encapsulation? 1. A process that converts existing partions on a specified disk to volumes. If any partitions cntain file systems, /etc/vfstab entires are modified so that the file system are mounted on volumes instead. (or) 2. Encapsulation is the process of converting partitions into volumes to bring those partitions under VxVM control. 3. Encapsulation converts existing partitions into volumes, which provides continued access to the data on the disk after a reboot. After a disk has been encapsulated, the disk is handl;ed in the same way as an initialized disk. NOTE: 1. Encapsulation - preseves the data on the disk 2. Initialization - Destroys the data on the disk Requirements: 1. One free partition for private & public region 2. S2 slice that represents the full disk 3. 2048 sectors free at beginning or end of disk for private region.

What is rootability? 1. Rootability is the process of encapsulating the root file system, swap device and other file system on the boot disk under VxVM contol. 2. Volume manager converts existing partitions of the boot disk into volume manager volumes. 3. The system can then mount the standard boot disk file system from volumes instead of disk partitions. 4. When encapsulating the boot disk, the private regions can be created form the swap area, which reduces swap area by the size of the private region. The private region is created at the begining of the swap area, and the swap partition begins one cylinder from its original location. 5, requirements are the same as for the data disk encapsulation, but the private regions is created at the swap space. Why encapsulate the boot disk? Shuld encapsulate the boot disk only if we plan to mirror the boot disk.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 271

Benefits of mirroring the boot disk: 1. Enables high availability 2. Fixes bad blocks automatically. If the boot disk has bad blocks, thn volumemanager reads the blocks from the other disk and copes it back to the bad block to fix it. 3. Improves performance

Limitations of boot disk encapsulation: 1. Encapsulating the boot disk adds steps to OS upgrades. 2. A system cannot boot from a boot disk that spans multiple devices. 3. We should never grow or change the layout of the boot disk volumes. These volumes map to physical underlying partition on disk and must be contiguous. File system requirements: For root, usr, var and opt volumes: 1. use ufs file systems (VXFS is not avialable until later in the boot process) 2. use contiguous disk space. (Volumes cannot use striped, raid-5 concatenated mirrored or striped mirrored layouts) 3. Do not use drl (dirty log region) on system volumes. For swap, 1. The first swap volume must be contiguous and therefore cannot use striped or layerd layouts. 2. Other swap voulumes can be non-contiguous and can use any layout. However there is an implied 2gb limit of usable swap space per device for 32 bit operating system.

Before encapsulating the boot disk: 1. When we place the boot disk under volume manager control, volume manager sets bootdg to the appropriate disk group. 2. Set the eeprom variable # eeprom use-nvramrc? true This enable volume manager to take advantage of boot disk aliases to identify the mirror of the boot disk if a replacemebt is required. If this variable is assigned as false, we must determine which disks are bootable. With VXVM 4.0 # vxdiskadm "Encapsulate one or more disks" Note: Sliced disk format. The boot disk cannot be a CDS disk # /etc/vx/bin/vxencap -g diskgroup access-name After boot disk encapsulation; View OS specific files to better understand the encapsulation process. /etc/system /etc/vfstab VTOC NOTE: VTOC tag no 14 - used for private region tag no 15 - used of public region Creating an alternate boot disk
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 272

Alternated boot disk : Requirements: 1. An alternated boot disk is a mirror of the entire boot disk. An alternate boot disk presevers the boot blocka in the case the intitial boot disk fails. 2. Creatng an alternated boot disk requires, a. the boot disk be encapsulated by VXVM b. Another diks be available with enough disk space to contian all of the boot disk partitions c. Can use only the disks in the boot disk group. 3. The root mirror places the private region at the beinning of the disk, The remaining partitions are placed after the private region. 1. To mirror the root volume only: # vxrootmir alternate-disk 2. To mirror all other un-mirrored, concatenated volumes on the boot disk to the alternate disk: # vxmirror boot-disk alternate-disk 3. To mirror other volumes to the boot disk or other disks: # vxassist mirror homevol alternate-disk 4. To setup system boot information on a VxVM disk # vxbootsetup

Boot from an alternate mirror: To boot the system using an alternate boot disk after failure of the primary boot disk, 1. Set the eeprom variabl OK setenv use-nvramrc? true OK reset This above variable must be set to true to enable the use of alternate boot disks. 2. Check for available boot-disk aliases OK devalias {output displays the name of the boot disk and available mirrors} vx-rootdisk Vx-diskname 3. Boot from an available boot disk alias OK boot vx-diskname

Unencapuslating a boot disk: 1. To unencapsulate a boot disk, use vxunroot Requirements: Remove all but one plex of rootvol, swapvol, usr, var, opt and home. 2. Use vxunroot when we need to a. Boot from physical system partitions b.Chnge the size or location of private region on the boot disk c. upgrade both the os and VxVM Note: Do not use vxunroot if we aer only upgrading VxVM packages, including the VEA package. 1. Ensure that the boot disk volumes, volumes only have one plex each.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 273

# vxprint -hvt rootvol swapvol usr var 2. If boot disk volumes have more than one plex each, remove the unnecessary plexes. # vxplex -o rm dis plex-name 3. Run the untility # vxunroot VXVM ROOT MIRRORING: 1. When root mirroring is implemented, make sure that encapsulation is selected. choose option: 2 # cp /etc/system /system.orig # cp /etc/vfstab /vfstab.orig # vxdiskadm Select option : 2 " Add one or mode disk for encapsulation Select the system disk: c0t0d0

2. Then restart the system Note: a. 2 times reboot will happen. now veritas will take the control of root file system b. new slice name changed in /etc/vfstab as rootvol, swapvol c. no need to install boot block # vxdiskadm # vxprint # vxassist mirror rootvol # vxassist mirror swapvol # vxprint # vxassist mirror usr # vxprint # vxassist mirror var # vxprint not, targer 0 is removed # vxprint # init 6 OK boot disk1 Now, insert the new disk in the target 0 # vxdiskadm
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 274

Select the option:5 (if not detected) Select the option:2, then again option5

BREAKING THE MIRROR: Only mirrored volume has to be removed # vxplex -o rm dis rootvol-02 dis-disassociate # vxplex -o rm dis swapvol-02

how to revert the /etc/system & /etc/vfstab # /etc/vx/bin/vxunroot

HOT RELOCATON The system automatically reacts to i/o failures on redundant VxVM objects and restores redundancy to those objects relocating affected sub-diks. NOTE: Sub-diks are relocated to disks designated as spare disks or to free space in the disk group.

1. vxrelocd detects the disks failure 2. root (admin) is notified 3. sub-diks are relocated to a spare 4.volume recovery is attempted.

Note: Trouble shooting: bash-3.00# vxconfigd -k bash-3.00# vxiod set 10 bash-3.00# vxconfigd -m disable VxVM vxconfigd ERROR V-5-1-7840 cannot open /dev/vx/config: Device is already open bash-3.00# vxdctl init bash-3.00# vxdctl enable bash-3.00# vxdctl mode mode: enabled

MOUNT FILE SYSTEM AT BOOT: To mount the file system automatically at boot time, edit the OS-specific file system table file to add any entry for the file system. Specific information such as
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 275

1. 2. 3. 4. 5. 6. 7.

Device to mount - /dev/vx/dsk/datadg/datavol Device to fsck - /dev/vx/rdsk/datadg/datavol Mount point - /data File system type vxfs fsck pass 1 Mount at boor Yes Mount options - -

Reference on # vxassist Introduction : vxassist utility in Veritas Volume Manager is used to create volumes, add mirrors and logs to existing volumes, extend and shrink existing volumes, provides for the migration of data from a specified set of disks, and provides facilities for the on-line backup of existing volumes. The default behavior of vxassist is to create volumes in the rootdg diskgroup if diskgroup is not specified . The default length is taken as number of blocks but this can be specified in Kilobytes or Megabytes or Gigabytes.

Using # vxassist we can perform the following: 1. Creating a Volume 1.1 Creating a Concatenated Volume 1.2 Creating a Striped Volume 1.3 Creating a RAID-5 Volume 2. Extending a Volume 2.1 Extending a volume up to certain length, 2.2 Extending by a Given Length 3. Shrinking a Volume 3.1 Shrinking to a Given Length 3.2 Shrinking by a Given Length 4. Removing a Volume 5. Mirroring a Volume 5.1 Creating & Mirroring a New Volume 5.2 Mirroring an Existing Volume 5.3 Mirroring All Volumes 6. Removing a Mirror 7. Adding a RAID-5 Log 8. Adding a DRL Log 9. Removing a RAID-5 Log 10.Preparing a Volume for Online Backup 11.Displaying Volume Configuration Information 12.Next Steps

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 276

vxassist command syntax : vxassist <option> <Keyword> volume_name [attributes] Commonly used options are given below (See man vxassist for complete list of supported options) -g for specifying diskgroups -b for background operation -d file containing defaults for vxassist if not specified /etc/default/vxassist is used Keywords used are make , mirror , move , growto ,growby ,shrintto ,shirnkby ,snapstart , snapshot ,snapwait Attributes specify volumes layout disks controllar to include exclude etc Device Nodes : Default rootdg disk group. Block Device Node /dev/vx/dsk/volume_name Raw Device Node /dev/vx/rdsk/volume_name Other DiskGroups Block Device Node /dev/vx/dsk/diskgroup_name/volume_name Raw Device Node /dev/vx/rdsk/diskgroup_name/volume_name

1. Creating a Volume : 1.1 Creating a Concatenated Volume By default, vxassist creates a concatenated volume using the space available on a disk or on the number of disks in a diskgroup if the volume size specified is more then the one available on a single disk. Disks can be specified from a diskgroup for a volume group but if not mentioned available disks are selected by the volume manager. Command syntax : vxassist make volume_name volume_length To create a new volume appvol of 100 MB in the default disk group rootdg with available disks: #vxassist make appvol 100m To create the volume appvol of 100MB on disk03 #vxassist make appvol 100m disk03

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 277

1.2 Creating a Striped Volume A striped volume contains at least one plex that consists of two or more subdisks located on two or more physical disks. Command Syntax : vxassist make volume_name length layout=stripe To create a striped volume appvol2 with the default stripe unit size on the default number of disks #vxassist make appvol2 100m layout=stripe To create a striped volume appvol2 100MB striped volume on three specific disks. #vxassist make appvol2 100m layout=stripe disk04 disk05 disk06 1.3 Creating a RAID-5 Volume A RAID-5 volume contains a RAID-5 plex that consists of two or more subdisks located on two or more physical disks. Only one RAID-5 plex can exist per volume. A RAID-5 volume may also contain one or more RAID-5 log plexes, which are used to log information about data and parity being written to the volume. Command Syntax : vxassist make volume_name length layout=raid5 To create the RAID-5 volume appvol4 with the default stripe unit size on the default number of disks with RAID-5 log, #vxassist make appvol4 100m layout=raid5. 2. Extending a Volume Caution : If you plan to use volume size change (grow or shrink ) on a volume with data make sure you have the good backup of the volume available before carrying out such operation . 2.1 Extending a volume up to certain length, Command syntax vxassist growto volume_name length To extend vol3 upto 8000 sectors, type: #vxassist growto vol3 8000 2.2 Extending by a Given Length
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 278

Command Syntax vxassist growby volume_name length To extend volapp by 1000 sectors, type: #vxassist growby volapp 1000 3. Shrinking a Volume Caution - Do not shrink a volume below the size of the file system. If you have a VxFS file system, you can shrink the file system and then shrink the volume. If you do not shrink the file system first, you risk unrecoverable data loss. Always make sure you have a good backup of the data volume to be shirnked. 3.1 Shrinking to a Given Length Shrink a volume to a specific length as follows: vxassist shrinkto volume_name length Make sure you do not shrink the volume below the current size of the file system or database using the volume. This command can be safely used on empty volumes. To shrink volcat to 1300 sectors, type: #vxassist shrinkto volcat 1300 3.2 Shrinking by a Given Length Shrink a volume by a specific length as follows: vxassist shrinkby volume_name length To shrink volcat by 8000 sectors, type: #vxassist shrinkby volapp2 8000 4. Removing a Volume Removing a volume requires removing all references to the volumes to be removed like unmounting the volume if mounted and removing its reference from /etc/vfstab . An active volume has to be stopped first to stop all the activities to the volume only then it can be removed Stopping Volume : Command Syntax
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 279

vxvol stop volume_name To stop appvol1 #vxvol stop appvol1 Removing Volume Command Syntax vxedit -rf rm volume_name To remove the volume appvol1 #vxedit -rf rm appvol11 5. Mirroring a Volume Mirroring allow data to be written simultaneously to two disks so that in case of failure of one disk data is available from the other mirrored disk. Boot disks can be mirriored to provide alternate booting disk . 5.1 Creating & Mirroring a New Volume Command Syntax : vxassist make volume_name length layout=mirror To create the mirrored volume, appvol22 of 100mb #vxassist make appvol22 100m layout=mirror To create a volume with Dirty Region Logging enabled #vxassist make volume_name length layout=mirror,log 5.2 Mirroring an Existing Volume Command syntax vxassist mirror volume_name Creating a mirror of volume vol44: #vxassist mirror vol44 5.3 Mirroring All Volumes To mirror all existing volumes to available disk space
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 280

/etc/vx/bin/vxmirror -a 6. Removing a Mirror Removing a mirror involves first dissociating the plex from its volume and then removing the plex and any associated subdisks completely.The last valid mirror plex associated with a volume cannot be removed. Dissociate and remove the plex from its volume as follows: vxplex -o rm dis plex_name vxprint -h shows the volume and associated plexes : Disk group: rootdg TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 v volm fsgen ENABLED 10240 - ACTIVE - - pl volm-01 volm ENABLED 10240 - ACTIVE - - sd disk0102 volm-01 - 10240 0 - - - pl volm-02 volm ENABLED 10240 - ACTIVE - - sd disk02-03 volm02 - 10240 0 - - To disassociate and remove volmir-02 from volmir, type: #vxplex -o rm dis volm-02 The output of vxprint -h for volm now shows volume volm with only one plex:: Disk group: rootdg TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 v volm fsgen ENABLED 10240 - ACTIVE - - pl volm-01 volmir ENABLED 10240 - ACTIVE - - sd disk0102 volmir-01 - 10240 0 - - 7. Adding a RAID-5 Log A RAID-5 log maintains a copy of the data and parity being written to the volume at any given time. If a system failure occurs, VxVM can replay the RAID-5 log to resynchronize the volume. This copies the data and parity that was being written at the time of failure from the log to the appropriate areas of the RAID-5 volume. RAID-5 log plexes are used to log information about data and parity being written to the raid volume. A log plex is created for the volume by default when a raid volume is created but additional ones can be added by following command . vxassist addlog name_of_raid5_vol 8. Adding a DRL Log Dirty region logging (DRL) is used with mirrored volume layouts. DRL keeps track of the regions that have changed due to I/O writes to a mirrored volume. Prior to every write, a bitmap is written to a log to record the area of the disk that is being changed. In case of system failure, DRL uses this information to recover only the portions of the volume that need to be recovered.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 281

To put Dirty Region Logging into effect for a volume, a log subdisk must be added to that volume and the volume must be mirrored. Only one log subdisk can exist per plex. The following example creates a log for the mirrored volume vol03: #vxassist addlog vol03 When vxassist is used to add a log subdisk to a volume, a log plex is also created to contain the log subdisk, by default. Once created, the plex containing a log subdisk can be treated as a regular plex. Data subdisks can be added to the log plex. The log plex and log subdisk can be removed using the same procedures used to remove ordinary plexes and subdisks. 9. Removing a RAID-5 Log Removing a RAID-5 log involves first dissociating the log from its volume and then removing the log and any associated subdisks completely. Dissociate the log from its volume as follows: #vxplex -o rm dis plex_name To identify the log plex, use the command: vxprint -ht raid5_volume_name To disassociate the log plex volrd-02 from volrd, type: #vxplex -o rm dis volrd-02

The output of vxprint -h for volrd now shows: Disk group: rootdg TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 v volrd raid5 ENABLED 32 - ACTIVE - - pl volrd-01 volrd ENABLED 32 - ACTIVE - - sd disk01-02 volrd01 - 32 0 - - - sd disk02-03 volrd-01 - 32 0 - - -

10. Preparing a Volume for Online Backup Volume manager provides an easy way to take backup of the online data by creating an offline snapshot mirror of the volume . The vxassist snapstart operation creates a write-only backup mirror, which is attached to and synchronized with the volume to be backed up and later detached and made offline by vxassist snapshot command . The snapshot volume can be used by backup utilities while the original volume continues to be available for applications and users.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 282

The volume backup method described here does not apply to RAID-5 volumes. Backing up a volume with vxassist involves the following procedure Create a snapshot mirror snapstart starts creating a online snapshot mirror of the volume using the available disk space . The snapshot is completed with vxassist snapshot command when offline snapshot volume is created with a userdefined name . Command Syntax: vxassist snapstart volume_name

To create a snapshot mirror of a volume called vol8, type #vxassist snapstart vol8

Create a snapshot volume Command Syntax vxassist snapshot volume_name new_volume_name To create a snapshot volume of vol8, type: #vxassist snapshot vol8 snapvol8 You can now back up the snapshot volume by whatever means you prefer. To avoid wasting space, you can then remove the snapshot volume, which occupies as much space as the original volume 11 Displaying Volume Configuration Information The vxprint command can be used to display information about how a volume is configured. Display the volume, mirror, and subdisk record information for all volumes as follows: #vxprint -ht

Disk group: rootdg DG NAME DM NAME V NAME PL NAME SD NAME dg rootdg NCONFIG NLOG MINORS GROUP-ID DEVICE TYPE PRIVLEN PUBLEN STATE USETYPE KSTATE STATE LENGTH READPOL VOLUME KSTATE STATE LENGTH LAYOUT PLEX DISK DISKOFFS LENGTH [COL/]OFF 759096729.1025.tweety
Manickam Kamalakkannan

PREFPLEX NCOL/WID MODE DEVICE MODE

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 283

dm disk10 dm disk20

c1t0d0s2 sliced c2t0d0s2 sliced

559 559

1044400 1044400 2288 2288 2288 20480 20480 20480

SELECT CONCAT 0 c0t0d0 SELECT CONCAT 0 c0t1d0

v pubs fsgen ENABLED ACTIVE pl pubs-01 pubs ENABLED ACTIVE sd disk10-01 pubs-01 disk10 0 v vol8 fsgen ENABLED ACTIVE pl vol8-01 vol8 ENABLED ACTIVE sd disk10-02 vol8-0 disk10 2288

RW ENA

RW ENA

where dg is a disk group, dm is a disk, v is a volume, pl is a plex, and sd is a subdisk. The top few lines indicate the headers that match each type of output line that follows. Each volume is listed along with its associated plex(es) and subdisk(s). Display volume-related information for a specific volume as follows: #vxprint -t volume_name To display information about vol8, type: #vxprint -t vol8

The contents of this material is not affiliated with Sun Microsystems or any of it's affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 284

TCP WRAPPERS Is a package developed by Wietse Vernema, who also wrote the SATAN security package. Is an IP packet filtering and network access logging facility for inetd. TCP_wrappers is usually configured to wrap itself around TCP based services defined in inetd.conf. Is used to restrict access to TCP services based on the hostname, IP address, network address etc. TCP wrappers was integrated into Solaris starting in Solaris-9, where both Solaris Secured Shell and inet based services were wrapped. What TCP wrappers does? 1. Provides system administrators a high degree of control over incoming TCP connections. The system is invoked after a remote host connects to our server/machine. It is involved either through a sub-routine library that is linked into the stand alone program stacked up through inetd. 2. Once running, the TCP wrappers system performs the following steps; a. Open the /etc/hosts.allow file Note: 1. /etc/hosts.allow and /etc/hosts.deny file will not exist by default. 2. Both file contains access control rules and actions for each protocol. b. It scans through the files, line by line, until it finds a rule that matches the particular protocol and source host that has connected to the server. c. It executes the actions specified. If appropriate, control is then turned over to the network server. d. If no matching action is found, the file /etc/hosts.deny is opened and sequentially read line by line. If a matching line is found, access is denied and the corresponding action is performed. e. If no match is found in either the /etc/hosts.allow or /etc/hosts.deny file, the connection is allowed by default. To enable TCP wrappers support for inet based services: For eg: # inetadm M tcp_wrappers=true # svcadm refresh inetd # inetadm l telnet | grep tcp_wrapper Default tcp_wrappers=TRUE

Example entries to file /etc/hosts.allow or /etc/hosts.deny: Note: Remember its case sensitive. ALL : ALL ALL : <host_name1, host_name2> in.telnetd : ALL EXCEPT < host_name1, host_name2> ALL EXCEPT in.telnetd : < host_name1, host_name2> ALL : 192.168.10.0/255.255.255.0 Note: 1. Host names can also replaced with IP addresses. 2. /etc/hosts.deny should contain only a single rule ALL:ALL to deny all access by default. Keeping all the rules in a single file simplifies maintenance. Using /etc/hosts.allow, which has priority over /etc/hosts.deny, ensures that if someone else accidently modifies the wrong filem it wont override out rules.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 285

IPF IP Filter 1. All packets coming in are not only filtered as they enter the firewall, also filtered as they exit. 2. Is an integral component of Solaris-10. 3. Configuration file: /etc/ipf/ipf.conf 4. There is one rule per line 5. White space is allowed, and is encouraged to keep the rules readable. 6. Ipf filters by : a. IP address b. Netmask 7. Ipf can be implemented to the machine which is acting as a gateway. 8. Basic Rule Processing: a. Rules are processed from top to bottom, each one appended after another. b. Many packet filters stop comparing packets to rule sets the moment the first match is made; IPF is not one of them. For example, block in all pass in all Here, the reads the first line first. I.e., block in all and then pass in all c. Ipf will go through the entire rule set, making its decision on whether or not to pass or drop the packet based on the last matching rule. There is no cumulative effect. The last matching rules always take place. Before configuring the firewall: 1. Behavior of firewall has to be learnt. 2. An action pass/block 3. A direction in/out (inbound/outbound) Direction keyword relates to the movement of the packet in relation to the system on which the Solaris-10 is running. 4. Criteria which are compared against the packet to determine whether the packet matches the rule. Characteristic or action performed by firewall: 1. Compare the packet against the direction & criteria in the rule. 2. If the packet matches, remember the action specified in the rule. 3. Discard any action remembered previously. 4. If the end of the rule is reached or the matched rule contains the quick keyword, stop matching and perform the action. 5. If no rule match, pass the packet.

Enabling packet filtering with Solaris IP filter: 1. pfile kernel module has to be loaded to the network interface to work with IPfilter utility. 2. pfil is loaded to the network interface when its plumbed. 3. /etc/ipf/pfil.ap Remove comment (#) character from the appropriate lines for the network interface for which filtering is to be configured. 4. Note: Any existing plumbed network interface to which we choose to apply filtering must be unplumbed and plumbed. # autopush f /etc/ipf/pfil.ap Read changes performed on the file.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 286

IP filter services: svc: /network/pfil svc: /network/ipfilter Note: 1. /usr/share/ipfilter/examples Provides some example files on ipf. 2. Be familiar with the function of the ports. In some cases both the server & client uses the same port (for eg: routing protocol) and in other cases server & client uses different ports. For additional information ref: # man ipf.conf 3. # ipf f /etc/ipf/ipf.conf Takes the name of the file containing the new rules as an argument. 4. Options to the ipf command are executed in order in which they are specified on the command line. If a flush option is specified after an add rules option, the new rules will be added, then flushed along with the old rules. To clear the existing rules and load a new updated set, the flush option must be specified first. 5. # ipfstat will not display the rules in order. It displays the OUT rules order first then IN rules in order. 6. # ipmon /var/tmp/test_ipf_log Logging the information to a file 7. # ipmon D /var/tmp/test_ipf_log To make ipmon to run as a daemon. To configure the ipmon command to run as a daemon and to send logging information by using syslogd daemon to /var/adm/iplog file (created by us).

# vi /etc/syslog.conf Edit: local0.notice /var/adm/ipflog :wq! # touch /var/adm/iplog # pkill HUP syslogd # ipmod D s Message Level: 1. local0.error 2. local0.warning 3. local0.notice 4. local0.info

Packets that are logged and are short. Packets blocked by Solaris IP filter firewall Packets passed by Solaris IP filter firewall Packets matching a logged rule, but do not have the action associated With the rule applied. This information tells us that the packets Matches the rule, but has been matched by later rule in /etc/ipf/ipf.conf file subsequently.

# ipfstat 1. How our firewall is performing? 2. How many packets have been passed/blocked? 3. Are they logged or not? 4. How many entries have been made? # ipmon 1. Used to monitor
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 287

2. Tool, capable of watching the packet log 3. Can log to a file or to syslog. 4. Logged information is sent to /dev/ipl devices. # ipmon is used to read the logs from that device. IN Inbound - Inbound traffic is all traffic that enters the firewall on the interface. OUT Outbound - All traffic that leaves on any interface whether locally generated or simply passing through.

Example entries: 1. block pass 2. block block block pass in in in in in in quick from all quick from quick from quick from all 192.168.0.0/16 to any

192.168.0.0./16 172.16.0.0/12 10.0.0.0/8 to

to to any

any any

So here all the private IPs are blocked. 3. Passing/allowing the packets on particular interface: block in quick on bge0 all pass in all Where, in = incoming packets on = on the specified interface This rule will block only the incoming packets coming through the specified interface bge0. Rest is allowed. 4. Using IP address and interface together: block in quick on bge0 from 192.168.0.0/16

to

any

5. Out going packets: pass out quick on block out quick on

bge0 bge0

from 10.0.0.8 from any to

to any

any

6. Logging the information: block in log quick on

bge0

from

10.0.0.0/8

to

any

7. Controlling specific protocols: ICMP Used by # ping command block in log quick on bge0 Note:

proto icmp

from

any

to

any

1. Port based filtering can be applied to the source address or the destination address. 2. Note that the spaces on either side of = (equal) sign are required (port = 23). 8. Filtering ICMP with icmp type: pass in quick on bge0 proto icmp from any to 10.0.0.0/8 icmp_type 0 pass in quick on bge0 proto icmp from any to 10.0.0.0/8 icmp_type 1
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 288

9. Passing/blocking through port: This can be done for both TCP & UDP. block in log quick on bge0 proto block in log quick on bge0 proto block in log quick on bge0 proto block in log quick on bge0 proto

tcp from tcp from tcp from tcp from

any any any any

to 10.0.0.0/8 to 10.0.0.0/8 to 10.0.0.0/8 to 10.0.0.0/8

port = 513 port = 514 port = 23 port = 21

Note: rlogin = 513 , rsh = 514, telnet = 23, rpc/nfs & port map = 111 10. To block both TCP/UDP: block in log quick on nbge0 proto tcp/udp from any to 10.0.0.0/8 port = 111

The contents of this material is not affiliated with Sun Microsystems or any of it's affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 289

REMOTE SYSTEM CONSOLE

Overview of the Sun Remote System Console:

. 1. 2.

Sun RSC is a server management tool that allows us to monitor & control our server over modem lines and over a network. Provides remote system administration for geographically distributed or physically inaccessible systems.

RSC access: From workstation running on Solaris, win 9x or win NT. NOTE: The sever can boot and operate normally when the RSC software is not enabled, and Sun console features continue to be available on standard RS232 ports.

RSC features: 1. Remote system monitoring, error monitoring, including output from power-on self test and OBP diagnostics. 2. Remote server reboot, power on & power off on demand. 3. Ability to monitor the CPU temperature and fan sensors without being near the managed server, even when the server is in offline. 4. To run diagnostic tests from a remote console. 5. Remote event notification of server problems 6. Detailed log of RSC events 7. Remote console functions on both the serial & Ethernet ports

Monitoring tools: Complemented by RSC 1. Solstice SYMON a. Main & popular tools b. Main tool for observing system operation behavior and performance while the server operating system is up and running. 2. SUN VTS 3. Kadb kernel debugger 4. OBP 5. Open Boot Diagnostics OBDiag

RSC use: 1. After installing and configuring SUNRSC s/w on the server & client, we can use OBP commands & set OBP variables that redirect the console output to RSC 2. Part of RSC configuration defines & enables alert mechanisms. a. Alerts provide remote notification of system problems. b. It can be sent to pagers, mails, to any clients that are currently logged into RSC. 3. RSC generate alert messages whenever the following error occurs a. server system resets b. server temperature crosses the lower & higher fault c. sever redundant power supply fails
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 290

4. 5. 6. 7.

8.

d. power outage occurs at the server site, if an un-interruptible power supply is in use and it is configured to send an alert to RSC. e. Sever undergoes a h/w watch dog reset. f. Detects 5 un-successful RSC login attempts within 5 min Each alert message includes sever name & other important details RSC controls whether an alert is sent to mail/pager. It always sent alert to any client currently logged into RSC accounts for that server. If server is running & if tools available - SUN VTS - Solstice SyMON If not running tools may be available through X windows If server is not running & if no tools a. RSC feature to delay the server - Show environmental information - Put the server in debug mode - Control sever firmware behavior - Turn server power off & then on if the server is hung

View logs Displays detailed log of RSC errors, events & RSC command history Displays & reset server console logs

RSC configuration: Can control RSC configuration settings for - Alerts - Ethernet ports - Serial ports - RSC date & time - RSC password - RSC user account 1. supports upto 4 protected password user account for each managed server 2. each with customizable access rights User-permissions: -a administration permission, authorized to change the stat of RSC configuration variables -u user administration permissions, authorized to use commands that add & delete users, change user permissions & change the authorization level of other users. console permission; authorized to connect to the server console Reset/power permission, authorized to reset, power-on & power off the server & reboot RSC.

-c -r

User interface: - Graphical Runs using SUN java (RSC- SUNWrscj) Command line Using standard telnet to RSC ehternet port To the RSC serial port using PPP (Point-to-point protocol)

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 291

Can also be accessed by connectivity on ASCII character terminal directly to the RSC serial port. Note: RSC always sent alert messages to any users that are logged into RSC accounts rsradm utility / RSC interfaces to configure RSC after installation

Installation RSC s/w: SUN RAC s/w is installed as two separate components, 1. Server s/w installed on a SUN enterprise server to enable RSC h/w. 2. Client s/w installed on a Solaris/windows based client work station to provide the RSC graphical user interface Note: RSC java application is installed on a Solaris client machine, it resides in the directory /opt/rsc by default. To run RSC GUI Java application at client, it must have Java Development kit for Solaris version 1.1.6

Packages required: SUNWrsc - the RSC base package for installation on the host machine SUNWrscd - the RSC documentation package SUNWrscj - the RSC GUI package to be installed on any system wanting to display the RSC GUI

These undermentioned models of the Sun Machines are supported by the current RSC version. Enterprise 250 Sun Fire 280R Sun Fire V880 Sun Fire V480 Sun Fire V890 Sun Fire V490

Running the server configuration script: # /usr/platform/uname i/rsc/rsc-config # /ust/platform/uname i/rsc/rscadm <command? For eg: # /usr/platform/uname i/rsc/rscadm usershow Note: # uname i Returns the model of the system

Redirecting the console to RSC: - After RSC s/w is installed & configured, the system console is still available as on any normal SUN machine. - At server perform the following OK diag-output-to rsc OK setenv input-device rsc
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 292

OK setent output-device rsc These commands takes effect after the next server reset

To remove RSC from default console: - OK diag-output-to ttya OK setenv input-device keyboard OK setenv output-device screen - these commands takes effect after the next server reset

Some RSC shell commands: 1. 2. 3. 4. 5. 6. 7. 8. environment displays current environmental information showenvironment - same as environment show network displays the currrent n/w configuration console connects to the server console break puts the server in debug mode version displays version number of RSC firmware & componets showsc same as version without the v option help displays a list of RSC shell commands & brief description of each 9. poweron power on the server 10. poweroff power off the server 11. log history displays the history of all events oggedi the RSC even buffer 12. reset resets the server immediately 13. userperm sets the authorization for a user 14. userpassword set or changes a users password 15. date displays/sets the current time & date 16. set set a configuration variable 17. show displays one/more configuration variable 18. useradd adds an RSC user account 19. userdel deletes an RSC user account 20. usershow show characteristics of an RSC user account

Output: Configuring the rsc software: bash-3.00# /usr/platform/`uname -i`/rsc/rsc-config

Continue with RSC setup (y|n): y Set RSC date/time now (y|n|?) [y]: y Server Hostname [fire1]: fire1 Edit customer info field (y|n|?) [n]: n Enable RSC Ethernet Interface (y|n|s|?) [n]: y RSC IP Mode (config|dhcp|?) [dhcp]: config RSC IP Address []: 100.0.0.120 RSC IP Netmask [255.255.255.0]: 255.0.0.0 RSC IP Gateway []:
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 293

Enable RSC Alerts (y|n|s|?) [n]: y Enable Email Alerts (y|n) [n]: n Enable Pager Alerts (y|n) [n]: n Enable RSC Modem Interface (y|n|s|?) [n]: n Enable RSC Serial Port Interface (y|n|s|?) [n]: n Setup RSC User Account (y|n|?) [y]: y Username []: rscuser User Permissions (c,u,a,r|none|?) [cuar]:

-------------------Verifying Selections --------------------

General Setup ------------Set RSC date now = y Server Hostname = fire1 Set Customer Info = n Is this correct (y|n):y Ethernet Setup -------------IP Mode IP Address IP Netmask IP Gateway

= config = 100.0.0.120 = 255.0.0.0 =

Is this correct (y|n): y

Alert Setup ----------Email Enabled Paging Enabled

= n = n

Is this correct (y|n):y Modem Setup ----------- Modem disabled, ppp disabled Is this correct (y|n): y

Serial Port Setup ----------------- Serial port disabled Is this correct (y|n): y

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 294

User Setup ---------User Name = rscuser User Permissions = cuar Is this correct (y|n): y

This script will now update RSC, continue? (y|n):y Updating flash, this takes a few minutes ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ....................................... . ........................... Download completed successfully Download completed successfully Resetting RSC (takes about 90 seconds): DONE Setting up server to update RSC date on boot: DONE Setting up server hostname: DONE Setting up ethernet interface: DONE Disabling RSC alert engine: DONE Disabling modem interface: DONE Disabling serial port interface: DONE Adding user to RSC: A valid password is between 6 and 8 characters, has at least two alphabetic characters, and at least one numeric or special character. The password must differ from the user's login name and any reverse or circular shift of that login name. Setting User Password Now ... Password: Re-enter Password: rscadm: malformed password A valid password is between 6 and 8 characters, has at least two alphabetic characters, and at least one numeric or special character. The password must differ from the user's login name and any reverse or circular shift of that login name.

Password: Re-enter Password: User has been added to RSC Resetting RSC (takes about 90 seconds): Are you sure you want to reboot RSC (y/n)?

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 295

DONE Setting up RSC date: DONE ******************************* RSC has been successfully setup *******************************

To obtian the help of rscadm command: bash-3.00# /usr/platform/`uname -i`/rsc/rscadm help

USAGE: rscadm <command> [options] For a list of commands, type "rscadm help" rscadm - COMMANDS SUPPORTED

help, date, set, show, resetrsc, download, send_event, modem_setup, useradd, userdel, usershow, userpassword, userperm, shownetwork, loghistory, version rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm rscadm COMMAND DETAILS help => this message date [-s] | [[mmdd]HHMM | mmddHHMM[cc]yy][.SS] => print or set date set <variable> <value> => set variable to value show [variable] => show variable(s) resetrsc [-s] => reset RSC (-s soft reset) download [boot] <file> => program firmware or [boot] monitor send_event [-c] "message" => send message as event (-c CRITICAL) modem_setup => connect to modem port useradd <username> => add RSC user account userdel <username> => delete RSC user account usershow [username] => show user details userpassword <username> => set user password userperm <username> [cuar] => set user permissions shownetwork => show network configuration loghistory => show RSC event log version => show RSC version

bash-3.00# uname -i SUNW,Sun-Fire-280R

For eg: bash-3.00# /usr/platform/`uname -i`/rsc/rscadm version

RSC Version v2.2.3 RSC Bootmon Version: v2.0.0 RSC Firmware Version: v2.2.3

bash-3.00#

/usr/platform/`uname -i`/rsc/rscadm usershow


Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 296

username -------fire280 root shivan rsc

permissions ----------cu-cuar cuar cuar

password -------Assigned Assigned Assigned Assigned

The contents of this material is not affiliated with Sun Microsystems or any of it's affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 297

SUN CLUSTER 3.1 Defining Clustering: 1. Clustering is a general terminology that describes a group of two or more separate servers. 2. Clusters is a collection of 2 or more system that work together as a single, continuous available system to provide applications, system resources and data to users. Cluster general characteristics: 1. Separate server nodes, each booting from its own, non-shared, copy of the operating system. 2. Dedicated h/w interconnects, providing private transport only between the nodes of the same cluster. 3. Multiported storage, providing paths from at least two nodes in the cluster to each physical storage device storing data for the applications running in the cluster.

Sun Cluster is a s/w used to build a cluster environment to provide increased availability and performance. Note: Sun Cluster 3.0 supports 8 Nodes Sun Cluster 3.1 supports 16 Nodes Sun Cluster 3.2 Supports 32 Nodes HA High Availability: 1. Clusters are generally marketed as the only way o provide high availability for the applications that run on them. 2. HA can be defined as the minimization of downtime rather than the complete elimination of downtime. HA standards: Usually phrased with wording such as Provides 5 nines availability. This means 99.999% uptime for the application or about 5 min of downtime per year. One clean server reboot often already exceeds that amount of downtime.

How cluster provide HA? In the case of any single h/w or s/w failure in the cluster, application services and data are recovered automatically 9without human intervention) and quickly (faster than a server reboot). This is done by taking advantage of the existence of redundant servers in the cluster and redundant server storage paths.

Scalability: 1. Clusters also provide an integrated h/w and s/w environment for scalability. 2. Scalability is defined as the ability to increase application performance by supporting multiple instances of applications on different nodes in the cluster.

Sun cluster hardware environment: 1. Cluster nodes with local disk (Unshared disk) 2. Multi host storage (Shared disk) 3. Cluster interconnect (Provides the channel for inter node communication) 4. Public n/w interface (Used by clients system to access data services on the cluster. Usually the primary n/w interface) 5. Removable media configured as global device such as tapes and cdrom.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 298

Note: Recommended to impletement the cluster with same hardware familiy, preferable with same model. Sun cluster software environment: 1. Solaris 10 OS s/w 2. Sun Cluster 3.1 s/w (Separate s/w not from OS cd) 3. Data service application ( Sun Cluster Agent cd) 4. Volume management 9SVM or VXVM0. Is exceptional when, the volume management is on the box. Terminology: Cluster-node: 1. Is a system that runs both Solaris 10 OS s/w and Sun Cluster s/w. 2. Every node in the cluster is aware when another node joins or leaves the cluster.

Cluster interconnect: 1. This connection is established between all cluster nodes and is solely used by cluster nodes for the private and data service communications. 2. This communication path is also known as private n/w. 3. There are 2 variations of interconnect i. Point-to-Point ii. Junction based (In this junction based interconnect, the junction must be switches and not hubs) CCR Cluster Configuration Repository: 1. Its a private, cluster wide, distributed database for storing information about the configuration and star of the cluster. 2. CCR contains the following information: i. Cluster & node name ii. Cluster transport configuration iii. The names of SVM disk set or Vxvm disk group iv. A list of nodes that can master each disk group or disk set v. Operations parameter values for data services vi. Paths to data services call back methods vii. Current cluster status 3. CCR is accessed when error/recovery situations occur or when there has been general cluster status changes, such as node leaving or joining the cluster.

Local devices: 1. These devices are accessible only on a node that is running the service and has a physical connection to the cluster. They are not highly available device. Global device: a. 1.These devices are highly available to any node in a cluster. Suppose if a node fails while providing access to a global device the Sun Cluster s/w switches over to another path to the device and re-directs the access to the path. 2. This access is known as global device access. 3. Provides simultaneous access to the raw (character) device associated with storage devices from nodes, regardless of where the storage is physically attached.

Device ID (Global Naming Scheme): 1. Each device in the cluster environment is assigned an unique id.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 299

2. Access to the global device is possible through the unique device id (DID) assigned by DID driver instead of traditional Solaris DIDs. 3. Eg: /dev/did/(r)dsk/d2s3 4. Its important to note that DIDs themselves are just global naming scheme and not a global access scheme.

Global file system: 1. This feature makes file systems simultaneously available on all nodes, regardless of their physical location. 2. UFS, VxFS, HSFS are supported a. Eg: # mount o global,logging /dev/md/dsk/dataset/d100 /global/nfs

Data Services/Sun Agents: 1. Is a combination of s/w and an application to run without modification in a Sun Cluster configuration. 2. S/w of the data service provides the following operations: 3. Starting and stopping the applications 4. Monitoring the faults in the applications and recovering from these faults. 5. Configuration files define the properties of the resource, which represents the applications to the RGM (Resource Group Manager) Data services (Sun Agents) packages are those, programs which monitor various applications and handle stopping, starting, and migrating them on the cluster. Once the Data Services are installed, they are ready to perform application-specific configuration. Note: Resource groups usually contain a logical host resource (virtual IP address for the resource), a data storage resource, and one or more application resources.

Resource: 1. In the context of cluster, the word resource refers to any element above the layer of the cluster frame work which can be turned on or off and can be monitored in the cluster. 2. Ins a instance (example or first stage of proceeding) of a resource type that is defined cluster wide. NOTE: Data services utilize several types of resources. Application & n/w resources form a basic unit ie., managed by RGM. Resource group: 1. Are collection of resources 2. Are either fail over or scalable iii. Fail over resource group: Is a collection of services that always run together on one node of the cluster at one time and simultaneously fail over or switch over to another node. iv. Scalable resource group: Describes the collection of services that simultaneously sun on one or more nodes.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 300

Resource type: 1. Is a collection of properties that describe an application to the cluster. This collection includes the information about how the application is to be started, stopped and monitored on nodes of the cluster. 2. Eg: 1. The resource type for Sun Cluster HA for nfs is SUNW.nfs 3. The resource type for Sun Cluster HA for apache is SUNW.apache Data service types: 1. Fail over data service 2. Scalable data service 3. Parallel data service Fail over data service: a. Is a process by which the cluster automatically relocates an application from a failed primary node to a designated redundant secondary node. b. Fail over services uses a fail over resource group which is a container for application instance resource & n/w resources. (Logical hostname nothing but n/w resource). c. NOTE: Logical host names are IP addresses that can be configured up on one node and later automatically configured down on the original node and configured up on the another node. Scalable data service: a. This enables applications instances to run on multiple nodes simultaneously. This service uses 2 resource groups. v. Scalable resource group vi. Fail over resource group b. Scalable resource group contains the application resources and the fail over resource group contains n/w resources, 9shared addresses) on which the scalable source depends. Parallel data service: a. Sun Cluster systems provide an environment that shares parallel execution of applications across all the nodes of the cluster by using parallel data bases, b. Sun Cluster support for Oracle parallel server/real applications clusters is a set of packages that, when installed enables Oracle parallel server/real application cluster to run on Sun Cluster nodes. Cluster Application Modes: a. Failover b. Scalability or Load Balancing

Failover: The application only runs on one node at a time. IF the controlling node fails, then the application and any other associated resources are passed to another node which was previously in standby.

Scalability/Load Balancing: Runs on more than one node at the same time without any failover.

Public n/w interface: Clients connect to the cluster through the public network interfaces.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 301

IPMP Internet Protocol Network Multipathing: Software that uses fault monitoring and failover to prevent loss of node availability because of single network adapter or cable failure. IP network multipathing failover uses sets of network adapters called IP Network Multipathing groups (Multipathing groups) to provide redundant connections between a cluster node and the public network. The fault monitoring and failover capabilities work together to ensure availability of resources. Note: More than one highly available application can be run on a cluster at a time.

Cluster Topologies: Cluster configuration comes in four types. a. Clustered pair topology (Two or more pairs of nodes are each physically connected to some external storage shared by the pair. 2-node cluster comes under this topology) b. Pair+N c. N+1 d. Multiported N*N Multi host disk storage: A storage which is connected to more than one node at a time. It provides the following benefits. vii. Global access to file system viii. Multiple access to file systems and data ix. Tolerance for single node failures.

Cluster Time: Time between all nodes in a cluster must be synchronized.

Heart Beat: A periodic message sent across all available clusters interconnects transport paths. Lack of heart bat after a specified interval and number of retries might trigger an internal failover of transport communication to another path. Failure of all paths to a cluster member results in the CMM (Cluster Membership Monitor) revaluation the cluster program. During normal operation, each node regularly sends out the heart beat information across the private network to let every other node know about this health.

Split brain: A condition in which a cluster breaks up into multiple partitions, with each partition forming without knowledge of the existence of any other.

Amnesia: A condition in which a cluster restarts after a shutdown with stale cluster configuration data (CCR). For Eg: On a 2-node cluster with only node1 operational, if a cluster configuration change occurs on Node1, Node2s CCR become stale (=old). If the cluster is shutdown then restarted on Node2, an amnesia condition results because of Node2s stale CCR.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 302

Quorum device: 1. Is a disk shared by 2 or more nodes that contribute votes that are used to establish a quorum for the cluster to Sun. 2. Quorum device acquires quorum vote counts based on the number of node connections to the device. 3. It acquires the maximum vote count of (n-1) where n is the number of connected nodes to the quorum device. 4. Each node is assigned exactly one vote.

NOTE: 1. There must be a majority (more than 50% of all possible vote present) to form a cluster. 2. A single quorum device can be automatically configured by scinstall for 2-node cluster only. 3. All other quorum devicews are manually configured after the Sun Cluster s/w installation is complete. 4. (n/2)+1 quorum devices are required. (Similar to replica) 5. Quorum device rules: 5. Must be available to both nodes in 2-node cluster 6. Information is maintained globally in the CCR database

Understanding Quorum: Note: 1. To form a cluster an offer services, the nodes in a cluster must first reach quorum. 2. Each node in a configured cluster has one quorum vote. 3. Never have the number of quorum device votes exceed the number of device votes. 4. Always use the minimum number possible to achieve quorum, or the health of the cluster will depend on the health of the shared disks configured as quorum devices. The quorum equation states that a cluster must have the total number of configured votes, divided by two (Note: Remainders are discarded), plus one. Q = TCV/2 +1 If a cluster cannot reach quorum, then it does not form. The individual cluster nodes do not boot fully, but wait until enough votes are available to reach quorum. If a running cluster loses quorum, the affected nodes panic and try to reboot (assuming auto-boot? Is set to true on those nodes). Every shared device configured as a quorum device has votes totaling the number of connected devices minus one. Q = TCD -1 Quorum required to operate: Q = TCV/2 + 1 = (2)/2 + 1 = 2 Votes if one node fails: 1 When you introduce a quorum device, the equation changes. This Sun Cluster configuration, shown in the following figure, is one of the most common.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 303

Quorum required to operate: Q = (2 + 1)/2 + 1 = 2 Votes if one node fails: (1 + 1) = 2

Understanding SCSI reservations: With SCSI-3 capable storage where there are more than 2 paths to the storage, this reservation is accomplished by each available cluster node registering a key by writing it to the disk. The controlling node is tagged as the owner, and the other nodes are tagged as capable of becoming the owner. If a node fails, the remaining nodes remove the failed nodes key from the disk, and it is no longer eligible to own the quorum device. Once the failed node recovers and rejoins the cluster, its key is re-registered. In the event that the controlling node leaves the cluster, the remaining eligible nodes compete to gain control of the quorum devices. Note: /globaldevices file system, later renamed to /global/.devices/node@nodeid (where nodeid represents the number that is assigned to a node when it becomes a cluster member).

Creating an Administrative Console: To use a machine outside the cluster as an administrative consle, add the SUNWccon and SUNWscman packages to the administrative machine. These include the programs ctelnet, cconsole, crlogin and others. They allow the administrator to type commands into one window and have them echo on multiple cluster node windows.

Configuring the cluster: When the first cluster node is installed, the cluster enables installmode and is not completely configured. With installmode enabled, the firest cluster node sponsors additional nodes until quorum can be reached. Recall that in a 2-node cluster, a quorum device must be configured before the cluster will operate.

Important cluster commands: cconsole, ctelnet, crlogin - multi-window, multi-machine, remote console, login and telnet commands

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 304

sccheck - check for and report on vulnerable Sun Cluster configurations scconf - update the Sun Cluster software configuration scdidadm - global device identifier configuration and administration utility wrapper scinstall - install Sun Cluster software and initialize new cluster nodes scrgadm - manage registration and unregistration of resource types, resource groups, and resources scsetup - interactive cluster configuration tool scshutdown - shut down a cluster scstat - monitor the status of Sun Cluster scswitch- perform ownership and state change of resource groups and disk device groups in Sun Cluster configuration Outputs: Here we consider NODE-1 spec: 1. Ent250 As sponsoring node with c0t10d0s0 Solaris 10 OS installed 2. Sun Cluster 3.1 software installed 3. Sun Agents (Data Services) NFS installed 4. hme0 connected to public network (primary interface) IP=100.0.0.3 5. qfe0, qfe3 connected to private network (add-on cards) 6. Connected to multi-host storage (SCSI initiator id remains as default) 7. Host name = ent250 NODE-2 spec: 1. Sun Fire 280 r As sponsoring node with c1t10d0s0 Solaris 10 OS installed 2. Sun Cluster 3.1 software installed 3. Sun Agents (Data Services) NFS installed 4. ERI0 connected to public network (primary interface) IP=100.2.3.5 5. qfe0, qfe3 connected to private network (add-on cards) 6. Connected to multi-host storage (SCSI initiator id remains as default) 7. Host name = fire1 (In both the nodes private network IP will auto configured). Cluster Information: Name of the cluster = nfs-server IP = 100.0.0.100 Client spec: 1. Netra 150 2. hme0 = Public interface IP=100.0.0.10 3. Host name = NATRA

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 305

IN BOTH NODE-1 & NODE-2 1. 2 private networks has to be established and 1 public networks named nfs-server has to be given. 2. Make an entry in the /etc/hosts file for the public network(nfs-server) bash-3.00# vi /etc/hosts "/etc/hosts" [Read only] 9 lines, 144 characters # # Internet host table 127.0.0.1 localhost 100.0.0.3 ent250 loghost 100.2.3.5 fire1 100.0.0.100 nfs-server 100.0.0.10 NATRA

3. SCSI initiator ID has to be changed in one node from default 7 to 9 4. Set auto-boot value =false 5. Dedicate 2 slices of 500mb for replica and CCR info (slice 3 & slice 7) 6. Create new file system for the two slices. 7. Create the directory /globaldevices and mount the directory with slice 3 and add entry in /etc/vfstab bash-3.00# vi /etc/vfstab "/etc/vfstab" 15 lines, 640 characters #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # fd /dev/fd fd no /proc /proc proc no /dev/dsk/c0t10d0s1 swap no /dev/dsk/c0t10d0s0 /dev/rdsk/c0t10d0s0 / ufs 1 no /devices /devices devfs no sharefs /etc/dfs/sharetab sharefs no ctfs /system/contract ctfs no objfs /system/object objfs no swap /tmp tmpfs yes /dev/dsk/c0t10d0s3 /dev/rdsk/c0t10d0s3 /globaldevices ufs 1 yes /dev/did/dsk/d1s3 /dev/did/rdsk/d1s3 /global/.devices/node@1 ufs 2 no global

8. Add entry in /etc/.rhosts file as + bash-3.00# vi /.rhosts "/.rhosts" 1 line, 2 characters + ~ ~~ ~"/.rhosts" 1 line, 2 characters

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 306

9. Create replicas in slice 7 # metadb -afc6 /dev/rdsk/c0t10d0s7 # metadb flags a m pc luo a pc luo a pc luo a pc luo a pc luo a pc luo first blk 16 8208 16400 24592 32784 40976 block count 8192 8192 8192 8192 8192 8192

/dev/dsk/c0t10d0s7 /dev/dsk/c0t10d0s7 /dev/dsk/c0t10d0s7 /dev/dsk/c0t10d0s7 /dev/dsk/c0t10d0s7 /dev/dsk/c0t10d0s7

10. Edit the etc/profile file and make entrys for PATH & MANPATH bash-3.00# vi /etc/profile "/etc/profile" 49 lines, 800 characters #ident "@(#)profile 1.19 01/03/13 SMI"

/* SVr4.0 1.3

*/

# The profile that all logins get before using their own .profile. trap "" 2 3 export LOGNAME PATH MANPATH=$MANPATH:/usr/cluster/man export MANPATH PATH=$PATH:/usr/cluster/bin export PATH 11. Run the profile file present in /etc as . profile(to export the PATHS of cluster bin & man) bash-3.0# bash-3.0# bash-3.0# bash-3.0# cd /etc export MANPATH export PATH . profile CD-ROM used 4.3G 0K 0K 0K 0K 1.8M 0K 0K 0K 112K 120K 3.5M 3.5M avail capacity 1.4G 76% 0K 0% 0K 0% 0K 0% 0K 0% 1.7G 1% 0K 0% 0K 0% 0K 0% 1.7G 1% 1.7G 1% 421M 1% 421M 1% Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /etc/dfs/sharetab /dev/fd /tmp /var/run /global/.devices/node@2 /global/.devices/node@1

12. Install the sun cluster using the bash-3.00# df -h Filesystem size /dev/dsk/c0t10d0s0 5.8G /devices 0K ctfs 0K proc 0K mnttab 0K swap 1.7G objfs 0K sharefs 0K fd 0K swap 1.7G swap 1.7G /dev/did/dsk/d5s3 472M /dev/did/dsk/d1s3 472M

13. After installation configure the cluster environment through menu-driven method using scinstall command

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 307

14. Check the cluster configuration and environment is proper and working as required DO THESE IN ANY ONE NODE bash-3.0# bash-3.0# bash-3.0# bash-3.0# bash-3.0# mkdir /global/nfs cd /global/nfs mkdir admin data cd admin mkdir SUNW.nfs

CREATING DISKSETS bash-3.0# metaset -s nfs-data -a -h ent250 fire1 ATTACHING A DISK TO A METASET bash-3.00# scdidadm -L 1 ent250:/dev/rdsk/c0t10d0 2 ent250:/dev/rdsk/c1t10d0 2 fire1:/dev/rdsk/c2t10d0 3 ent250:/dev/rdsk/c1t12d0 3 fire1:/dev/rdsk/c2t12d0 4 ent250:/dev/rdsk/c1t9d0 4 fire1:/dev/rdsk/c2t9d0 5 fire1:/dev/rdsk/c0t0d0 6 fire1:/dev/rdsk/c1t6d0 CREATING A DATASET: bash-3.0# metaset -s nfs-data -a /dev/didrdsk/d2 /dev/did/rdsk/d3 /dev/did/rdsk/d1 /dev/did/rdsk/d2 /dev/did/rdsk/d2 /dev/did/rdsk/d3 /dev/did/rdsk/d3 /dev/did/rdsk/d4 /dev/did/rdsk/d4 /dev/did/rdsk/d5 /dev/did/rdsk/d6

LISTING THE METASETS: bash-3.00# metaset Set name = nfs_data, Set number = 1 Host ent250 fire1 Driv Dbase d2 d3 Yes Yes Owner Yes

CREATING A METADEVICE: bash-3.0# metainit -s nfs-data d10 1 1 /dev/did/rdsk/d2s0

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 308

CREATING A NEW FILE SYSTEM: bash-3.0# newfs /dev/md/nfs-data/rdsk/d10 MOUNTING THE METADEVICE: bash-3.0# mount /dev/md/nfs-data/rdsk/d10 /global/nfs

Add entry for metadevice in vfstab(this has to be done seperately for both nodes) bash-3.00# vi /etc/vfstab "/etc/vfstab" 15 lines, 640 characters #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # fd /dev/fd fd no /proc /proc proc no /dev/dsk/c0t10d0s1 swap no /dev/dsk/c0t10d0s0 /dev/rdsk/c0t10d0s0 / ufs 1 no /devices /devices devfs no sharefs /etc/dfs/sharetab sharefs no ctfs /system/contract ctfs no objfs /system/object objfs no swap /tmp tmpfs yes #/dev/dsk/c0t10d0s3 /dev/rdsk/c0t10d0s3 /globaldevices ufs 1 yes /dev/did/dsk/d1s3 /dev/did/rdsk/d1s3 /global/.devices/node@1 ufs 2 no global /dev/md/nfs_data/dsk/d10 ufs 1 yes global,logging /dev/md/nfs_data/rdsk/d10 /global/nfs

bash-3.0# cd /global/nfs/admin bash-3.0# cd SUNW.nfs MAKING ENTRY IN DFSTAB FOR CLUSTER: vi dfstab.nfs-res "dfstab.nfs-res" 1 line, 36 characters share -F nfs -o rw /global/nfs/data ~ ~ "dfstab.nfs-res" 1 line, 36 characters

bash-3.0# chmod 777 /global/nfs/data bash-3.0# cd global/nfs/data (add some data in this directory) bash-3.00# pwd /global/nfs/data
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 309

bash-3.00# ls aggregation.conf vold.conf coreadm.conf dacf.conf dumpadm.conf esd.conf

hba.conf ima.conf inetd.conf logadm.conf mpapi.conf

nfssec.conf nscd.conf nsswitch.conf pam.conf printers.conf

rmmount.conf rpld.conf scrollkeeper.conf sdp.conf syslog.conf

STARTING THE NFS SERVER SERVICE bash-3.0# svcadm enable nfs/server

REGISTERING THE NFS RESOURCE: bash-3.00# pwd /global/nfs/admin/SUNW.nfs bash-3.00# chmod 777 /global/nfs/data/ bash-3.00# cd /global/nfs/data/ bash-3.00# ls -l total 0 bash-3.00# cp /etc/*.conf ./(copying contents in /global/nfs/data/) bash-3.00# ls aggregation.conf rpld.conf pam.conf dacf.conf sdp.conf dumpadm.conf syslog.conf

esd.conf logadm.conf vold.confcoreadm.conf hba.conf scrollkeeper.conf ima.conf nfssec.conf inetd.conf nscd.conf

nsswitch.conf mpapi.conf printers.conf rmmount.conf

bash-3.00# ls -l total 64 -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -r--r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -rw-r--r-1 root -r--r--r-1 root -rw-r--r-1 root

root root root root root root root root root root root root root root root root root

253 372 2279 240 77 293 440 1100 1425 390 981 3001 1281 3103 190 442 496

Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov Nov

26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26

13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17 13:17

aggregation.conf coreadm.conf dacf.conf dumpadm.conf esd.conf hba.conf ima.conf inetd.conf logadm.conf mpapi.conf nfssec.conf nscd.conf nsswitch.conf pam.conf printers.conf rmmount.conf rpld.conf

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 310

-rw-r--r--rw-r--r--rw-r--r--r--r--r--

1 1 1 1

root root root root

root root root root

23 170 1001 1123

Nov Nov Nov Nov

26 26 26 26

13:17 13:17 13:17 13:17

scrollkeeper.conf sdp.conf syslog.conf vold.conf

bash-3.00# metaset Set name = nfs_data, Set number = 1 Host ent250 fire1 Driv Dbase d2 d3 Yes Yes Owner Yes

bash-3.00# svcadm -v enable nfs/server svc:/network/nfs/server:default enabled. bash-3.00# shareall Registering: # scrgadm

manage registration and unregistration of resource types, resource groups, and resources

Where -a -g -j -t -c

Adds a new configuration Creates a resource group. Creates a resource. Adds a resource type. Modifies an existing configuration

-h RT_installed_node_list Is valid with -a and -c. It is a comma-separated list of node names upon which this resource type is installed. -y property Is valid with -a and -c. property is defined as a name=value pair. Multiple instances of -y property are allowed. -L Indicates that the options that are used on the command line apply to a logical host name.

-l hostnamelist Specifies the addresses to be shared. Use host names even though dotted IP addresses may be specified. hostnamelist is a comma-separated list of host names that are to be made available by this LogicalHostname resource. All host names in the same hostnamelist must be on the same subnet.

-j

resource_name (not optional when using an IP address rather than a host name as
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 311

bash-3.00# scrgadm -a -t SUNW.nfs bash-3.00# scrgadm -a -g nfs-rg -h ent250,fire1 Pathprefix=/global/nfs/admin bash-3.00# scrgadm -a -g nfs-rg -h ent250,fire1 -y Pathprefix=/global/nfs/admin bash-3.00# scrgadm -a -L -g nfs-rg -l nfs-server bash-3.00# scrgadm -a -j nfs-res -g nfs-rg -t SUNW.nfs bash-3.00# pwd /global/nfs/data bash-3.00# ls aggregation.conf rpld.conf pam.conf dacf.conf sdp.conf dumpadm.conf syslog.conf

esd.conf logadm.conf vold.confcoreadm.conf hba.conf scrollkeeper.conf ima.conf nfssec.conf inetd.conf nscd.conf

nsswitch.conf mpapi.conf printers.conf rmmount.conf

bash-3.00# scrgadm -a -j nfs-res -g nfs-rg -t SUNW.nfs

DISPLAYING THE SUN CLUSTER STATUS: Using # scstat command perform: A list of cluster members 1. The status of each cluster member 2. The status of resource groups and resources 3. The status of every path on the cluster interconnect 4. The status of every disk device group 5. The status of every quorum device 6. The status of every Internet Protocol Network Multipathing group and public network adapter Where, -D Shows status for all disk device groups. -g -i -n -p -q -W Shows status for all resource groups. Shows status for all IP Network Multipathing groups and public network adapters. Shows status for all nodes. Shows status for all components in the cluster Shows status for all device quorums and node quorums. Shows status for cluster transport path.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 312

bash-3.00# scstat -g -- Resource Groups and Resources -Group Name ---------Resources: nfs-rg Resources --------nfs-server nfs-res

-- Resource Groups -Group Name ---------Group: nfs-rg Group: nfs-rg Node Name --------ent250 fire1 State ----Unmanaged Unmanaged

-- Resources -Resource Name ------------Resource: nfs-server Resource: nfs-server Resource: nfs-res Resource: nfs-res bash-3.00# scswitch -Z -g nfs-rg bash-3.00# scrgadm -a -j nfs-res -g nfs-rg -t SUNW.nfs bash-3.00# df -h Filesystem size /dev/dsk/c0t10d0s0 5.8G /devices 0K ctfs 0K proc 0K mnttab 0K swap 1.7G objfs 0K sharefs 0K fd 0K swap 1.7G swap 1.7G /dev/did/dsk/d5s3 472M /dev/did/dsk/d1s3 472M /dev/md/nfs_data/dsk/d10 8.3G bash-3.00# pwd /global/nfs/data bash-3.00# ls aggregation.conf rpld.conf pam.conf dacf.conf sdp.conf dumpadm.conf syslog.conf Node Name --------ent250 fire1 ent250 fire1 State ----Offline Offline Offline Offline Status Message -------------Offline Offline Offline Offline

used 4.3G 0K 0K 0K 0K 1.8M 0K 0K 0K 112K 120K 3.5M 3.5M 8.5M

avail capacity 1.4G 76% 0K 0% 0K 0% 0K 0% 0K 0% 1.7G 1% 0K 0% 0K 0% 0K 0% 1.7G 1% 1.7G 1% 421M 1% 421M 1% 8.3G 1%

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /etc/dfs/sharetab /dev/fd /tmp /var/run /global/.devices/node@2 /global/.devices/node@1 /global/nfs

esd.conf logadm.conf vold.confcoreadm.conf hba.conf scrollkeeper.conf ima.conf nfssec.conf inetd.conf nscd.conf

nsswitch.conf mpapi.conf printers.conf rmmount.conf

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 313

bash-3.00# cd ../admin/ bash-3.00# ls SUNW.nfs bash-3.00# cd SUNW.nfs/ bash-3.00# ls dfstab.nfs-res bash-3.00# cat dfstab.nfs-res share -F nfs -o rw /global/nfs/data bash-3.00# scrgadm -a -L -g nfs-rg -l nfs-server bash-3.00# scrgadm -a -j nfs-res -g nfs-rg -t SUNW.nfs bash-3.00# scswitch -z -g nfs-rg

Node-2 bash-3.0# newfs /dev/rdsk/c0t0d0s3 bash-3.0# newfs /dev/rdsk/c0t0d0s7 bash-3.0# mkdir globaldevices bash-3.0# vi /etc/vfstab "/etc/vfstab" 12 lines, 520 characters #device device mount FS fsck mount mount #to mount to fsck point type options # fd /dev/fd fd no /proc /proc proc no /dev/dsk/c0t0d0s1 swap no /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs /devices /devices devfs no swap /tmp tmpfs yes dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /globaldevices

pass

at boot

1 -

no

ufs 1 yes

bash-3.0# metadb -afc6 /dev/rdsk/c0t0d0s7 bash-3.0# metadb flags first blk block count a m pc luo 16 8192 a pc luo 8208 8192 a pc luo 16400 8192 a pc luo 24592 8192 a pc luo 32784 8192 a pc luo 40976 8192 bash-3.0# mount /globaldevices
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

/dev/dsk/c0t0d0s7 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d0s7

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 314

bash-3.0# vi /etc/hosts "/etc/hosts" [Read only] 9 lines, 164 characters # # Internet host table # ::1 localhost 127.0.0.1 localhost 100.0.0.3 ent250 100.0.0.100 nfs-server 100.0.0.10 NATRA 100.2.3.5 fire1 loghost bash-3.0# ./cdrom/cdrom0/Solaris_sparc/installer(installing the cluster software) bash-3.0# ./cdrom/cdrom0/installer(installing the cluster sun agents) bash-3.0# scinstall(configuring cluster) bash-3.0# mkdir -p /global/nfs bash-3.0# cd /global/nfs bash-3.0# mkdir admin data bash-3.0# cd admin bash-3.0# mkdir SUNW.nfs bash-3.0# vi /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # fd /dev/fd fd no /proc /proc proc no /dev/dsk/c0t0d0s1 swap no /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no /devices /devices devfs no swap /tmp tmpfs yes #/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /globaldevices ufs 1 yes /dev/did/dsk/d5s3 /dev/did/rdsk/d5s3 /global/.devices/node@2 ufs 2 no global /dev/md/nfs_data/dsk/d10 /dev/md/nfs_data/rdsk/d10 /global/nfs ufs 1 yes global,logging

bash-3.00# vi /etc/nsswitch.conf "/etc/nsswitch.conf" 57 lines, 1281 characters # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)nsswitch.files 1.14 06/05/03 SMI" # # /etc/nsswitch.files:
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 315

# # # # # #

An example file that could be copied over to /etc/nsswitch.conf; it does not use any naming service. "hosts:" and "services:" in this file are used only if the /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

#passwd: files passwd: files #group: files group: files #hosts: files hosts: cluster files #ipnodes: files ipnodes: files #networks: files networks: files #protocols: files protocols: files #rpc: files rpc: files #ethers: files ethers: files #netmasks: files netmasks: cluster files #bootparams: files bootparams: files #publickey: files publickey: files # At present there isn't a 'files' backend for netgroup; the system will # figure it out pretty quickly, and won't use netgroups at all. "/etc/nsswitch.conf" 57 lines, 1281 characters bash-3.00# vi /.rhosts "/.rhosts" 1 line, 2 characters + :wq! bash-3.00# df -h Filesystem size /dev/dsk/c0t0d0s0 9.6G /devices 0K ctfs 0K proc 0K mnttab 0K swap 1.9G objfs 0K sharefs 0K fd 0K swap 1.9G swap 1.9G /dev/did/dsk/d1s3 472M /dev/md/nfs_data/dsk/d10 8.3G /dev/did/dsk/d5s3 472M

used 4.5G 0K 0K 0K 0K 1.8M 0K 0K 0K 176K 112K 3.5M 8.5M 3.5M

avail capacity 5.0G 48% 0K 0% 0K 0% 0K 0% 0K 0% 1.9G 1% 0K 0% 0K 0% 0K 0% 1.9G 1% 1.9G 1% 421M 1% 8.3G 421M 1% 1%

Mounted on / /devices /system/contract /proc /etc/mnttab /etc/svc/volatile /system/object /etc/dfs/sharetab /dev/fd /tmp /var/run /global/.devices/node@1 /global/nfs /global/.devices/node@2

bash-3.00# vi /etc/profile "/etc/profile" 47 lines, 767 characters


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 316

#ident

"@(#)profile

1.19

01/03/13 SMI"

/* SVr4.0 1.3

*/

# The profile that all logins get before using their own .profile. MANPATH=$MANPATH:/usr/cluster/man export MANPATH PATH=$PATH:/usr/cluster/bin (Output Truncated)

bash-3.00# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 eri0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 100.2.3.5 netmask ff000000 broadcast 100.255.255.255 groupname sc_ipmp0 ether 0:3:ba:2d:10:ed qfe0: flags=1008843<UP,BROADCAST,RUNNING,MULTICAST,PRIVATE,IPv4> mtu 1500 index 4 inet 172.16.0.130 netmask ffffff80 broadcast 172.16.0.255 ether 0:3:ba:31:45:2d qfe3: flags=1008843<UP,BROADCAST,RUNNING,MULTICAST,PRIVATE,IPv4> mtu 1500 index 3 inet 172.16.1.2 netmask ffffff80 broadcast 172.16.1.127 ether 0:3:ba:31:45:30 clprivnet0: flags=1009843<UP,BROADCAST,RUNNING,MULTICAST,MULTI_BCAST,PRIVATE,IPv4> mtu 1500 index 5 inet 172.16.193.2 netmask ffffff00 broadcast 172.16.193.255 ether 0:0:0:0:0:2 lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1 inet6 ::1/128 qfe0: flags=2008841<UP,RUNNING,MULTICAST,PRIVATE,IPv6> mtu 1500 index 4 inet6 fe80::203:baff:fe31:452d/10 ether 0:3:ba:31:45:2d qfe3: flags=2008841<UP,RUNNING,MULTICAST,PRIVATE,IPv6> mtu 1500 index 3 inet6 fe80::203:baff:fe31:4530/10 ether 0:3:ba:31:45:30

Viewing the cluster stauts: Using # scstat command perform: A list of cluster members 1. The status of each cluster member 2. The status of resource groups and resources 3. The status of every path on the cluster interconnect 4. The status of every disk device group 5. The status of every quorum device 6. The status of every Internet Protocol Network Multipathing group and public network adapter

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 317

Where, -D Shows status for all disk device groups. -g -i -n -p -q -W Shows status for all resource groups. Shows status for all IP Network Multipathing groups and public network adapters. Shows status for all nodes. Shows status for all components in the cluster Shows status for all device quorums and node quorums. Shows status for cluster transport path.

bash-3.00# scstat -g -- Resource Groups and Resources -Group Name ---------Resources: nfs-rg Resources --------nfs-server nfs-res

-- Resource Groups -Group Name ---------Group: nfs-rg Group: nfs-rg Node Name --------ent250 fire1 State ----Online Offline

-- Resources -Resource Name ------------Resource: nfs-server LogicalHostname online. Resource: nfs-server Resource: nfs-res is online. Resource: nfs-res bash-3.00# scstat -q -- Quorum Summary -Quorum votes possible: Quorum votes needed: Quorum votes present: 3 2 3 Node Name --------ent250 fire1 ent250 fire1 State ----Online Offline Online Offline Status Message -------------Online Offline Online - Service Offline

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 318

-- Quorum Votes by Node -Node Name --------ent250 fire1 Present Possible Status ------- -------- -----1 1 Online 1 1 Online

Node votes: Node votes:

-- Quorum Votes by Device -Device Name ----------/dev/did/rdsk/d2s2 Present Possible Status ------- -------- -----1 1 Online

Device votes:

bash-3.00# scstat |more ------------------------------------------------------------------- Cluster Nodes -Node name --------ent250 fire1 Status -----Online Online

Cluster node: Cluster node:

------------------------------------------------------------------- Cluster Transport Paths -Endpoint -------ent250:qfe3 ent250:qfe0 Endpoint -------fire1:qfe3 fire1:qfe0 Status -----Path online Path online

Transport path: Transport path:

------------------------------------------------------------------- Quorum Summary -Quorum votes possible: Quorum votes needed: Quorum votes present: 3 2 3

-- Quorum Votes by Node -Node Name --------ent250 fire1 Present Possible Status ------- -------- -----1 1 Online 1 1 Online

Node votes: Node votes:

-- Quorum Votes by Device -Device Name ...skipping 1 line Device votes: /dev/did/rdsk/d2s2 1 1 Online Present Possible Status

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 319

-- Device Group Servers -Device Group -----------nfs_data nfs-data Primary ------ent250 Secondary --------fire1 -

Device group servers: Device group servers:

-- Device Group Status -Device Group -----------nfs_data nfs-data Status -----Online Offline

Device group status: Device group status:

-- Multi-owner Device Groups -Device Group -----------Online Status -------------

------------------------------------------------------------------- Resource Groups and Resources -Group Name ---------Resources: nfs-rg Resources --------nfs-server nfs-res

-- Resource Groups -Group Name ---------...skipping 1 line Group: nfs-rg fire1 Offline Node Name --------State -----

-- Resources -Resource Name ------------Resource: nfs-server LogicalHostname online. Resource: nfs-server Resource: nfs-res is online. Resource: nfs-res Node Name --------ent250 fire1 ent250 fire1 State ----Online Offline Online Offline Status Message -------------Online Offline Online - Service Offline

------------------------------------------------------------------

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 320

-- IPMP Groups -Node Name --------IPMP Group: ent250 IPMP Group: fire1 Group Status ---------sc_ipmp0 Online sc_ipmp0 Online Adapter ------hme0 eri0 Status -----Online Online

-----------------------------------------------------------------bash-3.00# scstat -W -- Cluster Transport Paths -Endpoint -------ent250:qfe3 ent250:qfe0 Endpoint -------fire1:qfe3 fire1:qfe0 Status -----Path online Path online

Transport path: Transport path:

bash-3.00# scdidadm -L 1 ent250:/dev/rdsk/c0t10d0 2 ent250:/dev/rdsk/c1t10d0 2 fire1:/dev/rdsk/c2t10d0 3 ent250:/dev/rdsk/c1t12d0 3 fire1:/dev/rdsk/c2t12d0 4 ent250:/dev/rdsk/c1t9d0 4 fire1:/dev/rdsk/c2t9d0 5 fire1:/dev/rdsk/c0t0d0 6 fire1:/dev/rdsk/c1t6d0 bash-3.00# scstat -n -- Cluster Nodes -Node name --------ent250 fire1

/dev/did/rdsk/d1 /dev/did/rdsk/d2 /dev/did/rdsk/d2 /dev/did/rdsk/d3 /dev/did/rdsk/d3 /dev/did/rdsk/d4 /dev/did/rdsk/d4 /dev/did/rdsk/d5 /dev/did/rdsk/d6

Cluster node: Cluster node:

Status -----Online Online

bash-3.00# scstat -D -- Device Group Servers -Device Group -----------nfs_data nfs-data Primary ------ent250 Secondary --------fire1 -

Device group servers: Device group servers:

-- Device Group Status -Device Group -----------nfs_data nfs-data Status -----Online Offline

Device group status: Device group status:

-- Multi-owner Device Groups -Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 321

Device Group ------------

Online Status -------------

bash-3.00# scstat -p ------------------------------------------------------------------- Cluster Nodes -Node name --------ent250 fire1 Status -----Online Online

Cluster node: Cluster node:

------------------------------------------------------------------- Cluster Transport Paths -Endpoint -------ent250:qfe3 ent250:qfe0 Endpoint -------fire1:qfe3 fire1:qfe0 Status -----Path online Path online

Transport path: Transport path:

------------------------------------------------------------------- Quorum Summary -Quorum votes possible: Quorum votes needed: Quorum votes present: 3 2 3

-- Quorum Votes by Node -Node Name --------ent250 fire1 Present Possible Status ------- -------- -----1 1 Online 1 1 Online

Node votes: Node votes:

-- Quorum Votes by Device -Device Name ----------/dev/did/rdsk/d2s2 Present Possible Status ------- -------- -----1 1 Online

Device votes:

------------------------------------------------------------------- Device Group Servers -Device Group -----------nfs_data nfs-data Primary ------ent250 Secondary --------fire1 -

Device group servers: Device group servers:

-- Device Group Status -Device Group


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Status

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 322

Device group status: Device group status:

-----------nfs_data nfs-data

-----Online Offline

-- Multi-owner Device Groups -Device Group -----------Online Status -------------

------------------------------------------------------------------- Resource Groups and Resources -Group Name ---------Resources: nfs-rg Resources --------nfs-server nfs-res

-- Resource Groups -Group Name ---------Group: nfs-rg Group: nfs-rg Node Name --------ent250 fire1 State ----Online Offline

-- Resources -Resource Name ------------Resource: nfs-server LogicalHostname online. Resource: nfs-server Resource: nfs-res is online. Resource: nfs-res Node Name --------ent250 fire1 ent250 fire1 State ----Online Offline Online Offline Status Message -------------Online Offline Online - Service Offline

------------------------------------------------------------------- IPMP Groups -Node Name --------IPMP Group: ent250 IPMP Group: fire1 Group Status ---------sc_ipmp0 Online sc_ipmp0 Online Adapter ------hme0 eri0 Status -----Online Online

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 323

# scswitch

perform ownership and state change of resource groups and disk device groups in Sun Cluster configurations

Where -Z Enables all resources of the specified resource-grp and their monitors, moves the resource group into the managed state, and brings the resource group online on all the default primaries. When the -g option is not specified, the scswitch utility attempts to bring all resource groups online.

-g

Specifies the name of one or more resource-grps.

The contents of this material is not affiliated with Sun Microsystems or any of it's affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 324

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 325

What tools for what tasks? FOREWORD: The most common error in systems performance analysis is to study the entrails of a system without at the same time measuring how well the system is doing what it was meant to do. Generically, those measures are referred to as 'Business Metrics', and they are always stated in terms of response-time, throughput, variance, efficiency ($/metric or BTU/metric) -- or estimations of latent capacity to grow or improve such metrics. Amomg the more common names for these, you might see: Business Metrics and Indicators (BMIs), and Key Performance Indicators (KPIs)

It is important to remember that 'indicators' are not 'business metrics', and that one's goal in performance analysis should always be focused on business metrics. It's often good to be able to correlate indicators with business metrics, but generally bad to confuse the two. So - while drinking in the wealth of instrumentation available through Solaris instrumentation, the reader is admonished to keep foremost in their mind: "What problem are you trying to solve?" System Statistics acctcom process accounting busstat Bus hardware counters cpustat CPU hardware counters iostat IO & NFS statistics kstat display kernel statistics mpstat Processor statistics netstat Network statistics nicstat - Enhanced network statistics nfsstat NFS client and server stats sar kitchen sink utility vmstat virtual memory stats fsstat - File system statistics ::memstat - Memory Summary filestat - UFS Block Layout Statistics statit - System Statistics Utility

Process Statistics cputrack - per-processor hw counters pargs process arguments pflags process flags pcred process credentials pldd process's library dependencies psig process signal disposition pstack process stack dump pmap process memory map pfiles open files and names prstat process statistics ptree process tree ptime process microstate times
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 326

pwdx process working directory

Process Control pmap - Show process memory mappings pgrep grep for processes pkill kill processes list pstop stop processes prun start processes prctl view/set process resources pwait wait for process preap reap a zombie process plgrp - examine and modify process home lgroup and lgroup affinities pmadvise - apply madvise(3C) to address segments of a process

Process Tracing/Debugging abitrace trace ABI interfaces dtrace trace the world mdb debug/control processes truss trace functions and system calls snoop - debug and trace network traffic collect/analyzer - Sun Studio tools for binary code development and runtime analysis (not bundled with Solaris, but freely downloadable)

Kernel Tracing/Debugging dtrace trace and monitor kernel lockstat monitor locking statistics lockstat -k profile kernel mdb debug live and kernel cores Hotkernel - What is the kernel doing?

How to increase file system in root disk mirroring with out detach the mirror If root file system 100% full what you have to do? What are soft links and hard links, and differentiate them. How to recover boot-block, if it it corrupted. and what happens to the os if it gets corrupted How u can detach or remove the disk it is in Veritas (Vxvm) control that is the disk in the production server ? How can i stop the telnet service in solaris 8 and 9? I want to Know how many LUNs are in my Solaris10 server as well as NIC cards ? What is the purpose of autofs and automountd commands? What is the difference b/w /etc/system profile and user profile? What is the profile file for ordinary user, when those will execute? In solaris we have 2 directories for commands. what are they..? is there any difference b/w those? What is the 3rd field of /etc/inittab file..? what are the possible values of that field...? how to add a run control script..? What is the umask value to crate directory with only rw options to root..? Difference b/w crash dump and core dump files..?

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 327

Solaris Performance Monitoring & Tuning - iostat , vmstat & netstat Introduction to iostat , vmstat and netstat This document is primarily written with reference to solaris performance monitoring and tuning but these tools are available in other unix variants also with slight syntax difference. iostat , vmstat and netstat are three most commonly used tools for performance monitoring . These comes built in with the operating system and are easy to use .iostat stands for input output statistics and reports statistics for i/o devices such as disk drives . vmstat gives the statistics for virtual Memory and netstat gives the network statstics . Following paragraphs describes these tools and their usage for performance monitoring and if you need more information there are some very good solaris performance monitoring books available at www.besttechbooks.com.

Input Output statistics ( iostat ) iostat reports terminal and disk I/O activity and CPU utilization. The first line of output is for the time period since boot & each subsequent line is for the prior interval . Kernel maintains a number of counters to keep track of the values. iostat's activity class options default to tdc (terminal, disk, and CPU). If any other option/s are specified, this default is completely overridden i.e. iostat -d will report only statistics about the disks. syntax: Basic synctax is iostat <options> interval count

option - let you specify the device for which information is needed like disk , cpu or terminal. (-d , -c , -t or -tdc ) . x options gives the extended statistics . interval - is time period in seconds between two samples . iostat 4 will give data at each 4 seconds interval. count - is the number of times the data is needed . iostat 4 5 will give data at 4 seconds interval 5 times

Example $ iostat -xtc 5 2 disk sd0 sd1 sd2 sd3 extended disk statistics tty cpu r/s w/s Kr/s Kw/s wait actv svc_t % w %b tin tout us sy wt id 2.6 3.0 20.7 22.7 0.1 0.2 59.2 6 19 0 84 3 85 11 0 4.2 1.0 33.5 8.0 0.0 0.2 47.2 2 23 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 10.2 1.6 51.4 12.8 0.1 0.3 31.2 3 31
Manickam Kamalakkannan

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Sun Solaris 10 Operating System

Page 328

The fields have the following meanings: disk name of the disk r/s reads per second w/s writes per second Kr/s kilobytes read per second Kw/s kilobytes written per second wait average number of transactions waiting for service (Q length) actv average number of transactions actively being serviced (removed from the queue but not yet completed) %w percent of time there are transactions waiting for service (queue non-empty) %b percent of time the disk is busy (transactions in progress)

Results and Solutions: The values to look from the iostat output are: Reads/writes per second (r/s , w/s) Percentage busy (% b) Service time (svc_t)

If a disk shows consistently high reads/writes along with , the percentage busy (% b) of the disks is greater than 5 percent, and the average service time (svc_t) is greater than 30 milliseconds, then one of the following action needs to be taken 1.)Tune the application to use disk i/o more efficiently by modifying the disk queries and using available cache facilities of application servers . 2.) Spread the file system of the disk on to two or more disk using disk striping feature of volume manager /disksuite etc. 3.) Increase the system parameter values for inode cache , ufs_ninode , which is Number of inodes to be held in memory. Inodes are cached globally (for UFS), not on a per-file system basis 4.) Move the file system to another faster disk /controller or replace existing disk/controller to a faster one.

Virtual Memory Statistics ( vmstat ) vmstat - vmstat reports virtual memory statistics of process, virtual memory, disk, trap, and CPU activity. On multicpu systems , vmstat averages the number of CPUs into the output. For per-process
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 329

statistics .Without options, vmstat displays a one-line summary of the virtual memory activity since the system was booted. syntax: Basic synctax is vmstat <options> interval count

option - let you specify the type of information needed such as paging -p , cache -c ,.interrupt i etc. if no option is specified information about process , memory , paging , disk ,interrupts & cpu is displayed . interval - is time period in seconds between two samples . vmstat 4 will give data at each 4 seconds interval. count - is the number of times the data is needed . vmstat 4 5 will give data at 4 seconds interval 5 times. Example The following command displays a summary of what the system is doing every five seconds. example% vmstat 5 procs memory page disk faults cpu r b w swap free re mf pi p fr de sr s0 s1 s2 s3 in sy cs us sy id 0 0 0 11456 4120 1 41 19 1 3 0 2 0 4 0 0 48 112 130 4 14 82 0 0 1 10132 4280 0 4 44 0 0 0 0 0 23 0 0 211 230 144 3 35 62 0 0 1 10132 4616 0 0 20 0 0 0 0 0 19 0 0 150 172 146 3 33 64 0 0 1 10132 5292 0 0 9 0 0 0 0 0 21 0 0 165 105 130 1 21 78 The fields of vmstat's display are procs r in run queue b blocked for resources I/O, paging etc. w swapped memory (in Kbytes) swap - amount of swap space currently available free - size of the free list page ( in units per second). re page reclaims - see -S option for how this field is modified. mf minor faults - see -S option for how this field is modified. pi kilobytes paged in po kilobytes paged out fr kilobytes freed de anticipated short-term memory shortfall (Kbytes) sr pages scanned by clock algorithm disk ( operations per second ) There are slots for up to four disks, labeled with a single letter and number. The letter indicates the type of disk (s = SCSI, i = IPI, etc) . The number is the logical unit number.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 330

faults in sy cs

(non clock) device interrupts system calls CPU context switches

cpu - breakdown of percentage usage of CPU time. On multiprocessors this is an a verage across all processors. us user time sy system time id idle time

Results and Solutions: A. CPU issues: Following columns has to be watched to determine if there is any cpu issue 1. 2. 3. 4. Processes in the run queue (procs r) User time (cpu us) System time (cpu sy) Idle time (cpu id)

procs cpu r b w us sy id 0 0 0 4 14 82 0 0 1 3 35 62 0 0 1 3 33 64 0 0 1 1 21 78 Problem symptoms: 1.) If the number of processes in run queue (procs r) are consistently greater than the number of CPUs on the system it will slow down system as there are more processes then available CPUs . 2.) if this number is more than four times the number of available CPUs in the system then system is facing shortage of cpu power and will greatly slow down the processess on the system. 3.) If the idle time (cpu id) is consistently 0 and if the system time (cpu sy) is double the user time (cpu us) system is facing shortage of CPU resources. Resolution : Resolution to these kind of issues involves tuning of application procedures to make efficient use of cpu and as a last resort increasing the cpu power or adding more cpu to the system.

B. Memory Issues: Memory bottlenecks are determined by the scan rate (sr) . The scan rate is the pages scanned by the clock algorithm per second. If the scan rate (sr) is continuously over 200 pages per second then there is a memory shortage.

Resolution : 1. Tune the applications & servers to make efficient use of memory and cache. 2. Increase system memory . 3. Implement priority paging in s in pre solaris 8 versions by adding line "set priority paging=1" in /etc/system. Remove this line if upgrading from Solaris 7 to 8 & retaining old /etc/system file.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 331

Network Statistics (netstat) netstat displays the contents of various network-related data structures in depending on the options selected. Syntax : netstat <option/s> multiple options can be given at one time. Options -a - displays the state of all sockets. -r - shows the system routing tables -i - gives statistics on a per-interface basis. -m - displays information from the network memory buffers. On Solaris, this shows statistics forSTREAMS -p [proto] - retrieves statistics for the specified protocol -s - shows per-protocol statistics. (some implementations allow -ss to remove fileds with a value of 0 (zero) from the display.) -D - display the status of DHCP configured interfaces. -n do not lookup hostnames, display only IP addresses. -d (with -i) displays dropped packets per interface. -I [interface] retrieve information about only the specified interface. -v be verbose interval - number for continuous display of statictics. Example : $netstat -rn Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------192.168.1.0 192.168.1.11 U 1 1444 le0 224.0.0.0 192.168.1.11 U 1 0 le0 default 192.168.1.1 UG 1 68276 127.0.0.1 127.0.0.1 UH 1 10497 lo0 This shows the output on a Solaris machine who's IP address is 192.168.1.11 with a default router at 192.168.1.1 Results and Solutions: A.) Network availability The command as above is mostly useful in troubleshooting network accessibility issues . When outside network is not accessible from a machine check the following 1. if the default router ip address is correct
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 332

2. you can ping it from your machine. 3. If router address is incorrect it can be changed with route add commnad . See man route for more info . route command examples: $route add default <hostname> $route add 192.0.2.32 <gateway_name> If the router address is correct but still you can't ping it there may be some network cable /hub/switch problem and you have to try and eliminate the faulty component .

B.) Network Response $ netstat -i Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue lo0 8232 loopback localhost 77814 0 77814 0 0 0 hme0 1500 server1 server1 10658566 3 4832511 0 279257 0 This option is used to diagnose the network problems when the connectivity is there but it is slow in response . Values to look at: Collisions (Collis) Output packets (Opkts) Input errors (Ierrs) Input packets (Ipkts)

The above values will give information to workout i. Network collision rate as follows : Network collision rate = Output collision counts / Output packets Network-wide collision rate greater than 10 percent will indicate Overloaded network, Poorly configured network, Hardware problems.

ii. Input packet error rate as follows : Input Packet Error Rate = Ierrs / Ipkts.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 333

If the input error rate is high (over 0.25 percent), the host is dropping packets. Hub/switch cables etc needs to be checked for potential problems. C. Network socket & TCP Cconnection state Netstat gives important information about network socket and tcp state . This is very useful in finding out the open , closed and waiting network tcp connection . Network states returned by netstat are following : CLOSED ---- Closed. The socket is not being used. LISTEN ---- Listening for incoming connections. SYN_SENT ---- Actively trying to establish connection. SYN_RECEIVED ---- Initial synchronization of the connection under way. ESTABLISHED ---- Connection has been established. CLOSE_WAIT ---- Remote shut down; waiting for the socket to close. FIN_WAIT_1 ---- Socket closed; shutting down connection. CLOSING ---- Closed, then remote shutdown; awaiting acknowledgement. LAST_ACK ---- Remote shut down, then closed ;awaiting acknowledgement. FIN_WAIT_2 ---- Socket closed; waiting for shutdown from remote. TIME_WAIT ---- Wait after close for remote shutdown retransmission.

Example: #netstat -a

Local Address *.* *.22 *.22 *.* *.32771 *.4045 *.25 *.5987 *.898 *.32772 *.32775 *.32776 *.* 192.168.1.184.22 192.168.1.184.22 192.168.1.184.22

Remote Address *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* *.* 192.168.1.186.50457 192.168.1.186.56806 192.168.1.183.58672

Swind Send-Q 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41992 0 38912 0 18048 0

Rwind Recv-Q State 24576 0 IDLE 24576 0 LISTEN 24576 0 LISTEN 24576 0 IDLE 24576 0 LISTEN 24576 0 LISTEN 24576 0 LISTEN 24576 0 LISTEN 24576 0 LISTEN 24576 0 LISTEN 24576 0 LISTEN 24576 0 LISTEN 24576 0 IDLE 24616 0 ESTABLISHED 24616 0 ESTABLISHED 24616 0 ESTABLISHED

if you see a lots of connections in FIN_WAIT state tcp/ip parameters have to be tuned because the connections are not being closed and they gets accumulating . After some time system may run out of resource . TCP parameter can be tuned to define a time out so that connections can be released and used by new connection.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 334

What flags in /etc/system are related to security? Q: While the article on kernel and /etc/system parameters there are still several things missing. In Solaris 2.4 there was a fix in /etc/system set nfs:nfs_portmon=1 which made nfsd only accept connections from low numbered ports. This is the same as running rpc.mountd on sunos4.x with a -n flag. Unfortunately this same parameter does not exist on solaris 2.5. What I need is a list of parameters such as this one which have nothing to do with performance tuning but everything to do with securing my system. I'd like a reference source for these sorts of tuning parameters. They are not autoconfigured based on available resources. A: I concentrate on performance related parameters, I'm not a security expert. However you will find set nfssrv:nfs_portmon=1 works in Solaris 2.5. There were changes due to the integration of NFS3 into the system that seem to have rearranged the nfs modules slightly. I found that it still existed by running /usr/ccs/bin/nm on /dev/ksyms, then located the module it contains in /kernel. /usr/ccs/bin/nm /kernel/misc/nfssrv | grep portmon [29] | 1676| 4|OBJT |LOCL |0 |3 |nfs_portmon The manual page for nfsd(1m) also documents this change. If the NFS_PORTMON variable is set, then clients are required to use privileged ports (ports < IPPORT_RESERVED) in order to get NFS services. This variable is equal to zero by default. This variable has been moved from the "nfs" module to the "nfssrv" module. To set the variable, edit the /etc/system file and add this entry: set nfssrv:nfs_portmon = 1 WORKOUTS 1. Find out what are the packages are partially installed. 2. Find out how many packages are partially installed. 3. Find out how many packages are totally installed. 4. How to stop the nfs client side service? 5. How to disable telnet login for the root user? 6. What are the fields in the crontab file? List out in sequence 7. How can you know what are the schedules in queue? 8. Find out the property of the mounted slice /dev/dsk/c0t0d0s5 9. How will you find out the alternate backup blocks for the slice /dev/dsk/c0t0d0s7? 10. How will you install a grub to the corrupted system? 11. How to enable telnet service for the root user? 12. What is the format of the patch? 13. What is the difference between patch and packages? 14. What is the difference between /etc/dfs/sharetab and/etc/dfs/dfstab file 15. Change the user login name Hari to Shivan. And make sure that Shivan can store some of his newly created documents to the existing home directory. 16. Change the ownership and group for the folder along with its contents. 17. Create a SUID file 18. Find out last 10 reboots and save to the file /etc/reboot 19. How will you identify the default printer? 20. How will you find out for how many hour the system is in the running state? 21. Where will you define the password security policy?
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 335

22. What are the features of Sun Solaris 10? 23. How will you find out what are the recent files that are currently accessed? 24. What is meant by instance name? 25. How will you change the home directory of the user hari? 26. How will you identify the dump device? 27. How will you mount the /dev/fssnap/0 devices? 28. Where the logs of SULOG are stored? 29. How will you distinguish between the successful and failure sulog? 30. What is the purpose of loginlog file. Location of loginlog file 31. How will you kill a process? 32. What is the use of # fmthard command? 33. List out the ways to make the OS to recognize the newly connected hard disks. 34. What is the function of # eeprom command 35. List out the permitted tag names to the slice? 36. What is the default flag for the swap slice? 37. How remove only the contents of the file? 38. Difference between SUID, SGID, Sticky bit 39. If you can ping a server, but can't telnet or ssh to it, what could be the problem? 40. What is 'ps' command for? 41. How would you kill a process? 42. List out the process scheduled by a user Shivan 43. What does init 0 and init 5 does? 44. If you forgot the root password, how do you get back in? 45. How will you identify the Solaris Software Cluster installed to the system? 46. What will you do if the SMF repositry is corruted? 47. Where does the SMF repostiry configuration stored? 48. How will you disable all the network services? 49. Difference between # svcs and # svcs a 50. How will you make the slice as read only even after several reboots? 51. How will you created the public directory for the anonymous ftp user? 52. List out the process running a by a user che 53. How will you move VTOC of one machine to another? 54. What is the location of man pages on the local system? 55. How will you identify the physical path of the booting device? 56. Which command is used to create a software cluster in the format of data stream? 57. How will you deny root user login to the local system? 58. What is the difference between reject and disable? 59. How can we find RAM size in solaris server ? 60. If a user logs in to UNIX, it displays the desktop and then immediately logs you back out, what could be wrong? 61. How will you change the shell of the existing user? 62. What is the difference between runlevel 1 and System maintance mode? 63. How will you disable telnet service only for the current session? 64. Which file needs to be edited to allow root user to perform ftp login? 65. The _________command is used for adding devices to the system without requesting reboot. 66. Besides the root file system, what other file system is required to boot a usable system. 67. You can type # mount /opt on the command line and not get an error message if which of the condition exists? 68. Which mechanism that manages removable media, such as the CD-ROM and pen drives? 69. A large file is a regular file whose size is greater than or equal to ___________ 70. What are the default file systems created by the Solaris Installtion program? 71. When installing a patch using the patchadd command , which option does not create a backup of the files to be patched?
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 336

72. Which SMF command displays the services that must be running before the multi-user milestone is reached? 73. Which service status state indicated that the service is configured to run, but is not yet running or available to run? 74. After reading the /etc/inittab file, which daemon does the init process startup? 75. Which file controls the default policy on password aging? 76. Password aging and encryption are stored in which of the file? 77. Which signal kills a process unconditionally? 78. A user wants to execute a command later today, after leaving work. Ehich command will allow him to do this? 79. You need to perform a backup of the root file system without bringsing the system to single-user mode or unmounting the root file system. What is the best method of backing up an active mounted file system? 80. Syntax of tar and ufsdump command 81. List some of the performance monitoring tools 82. Fields in /etc/vfstab 83. What is the difference between nvalias and devalias 84. Which command would you use to view partitions and their sizes on Solaris? 85. Which OBP command would use to print/view OBP environment variables on a Sun sever? 86. Is du a command? If so, what is its use? 87. Is it possible to count number of characters, line in a file, if so how? 88. How will you terminate a running process? 89. Is it possible to create a new file system in Solaris, if so how? 90. Write a command to display a files contents in various formats? 91. What file is the controlling file for the volume manager? 92. How would you find out what version of Solaris is running? 93. How can we find RAM size in Sun SPARC server? 94. Is it possible to delete a link file, if so how? 95. How do you find out drive statistics?

Vertitas Volume Manager Interview questions 1) File do you modify to change the mail aliases (Provide the full path)? 2) What command do you run after modifying the aliases file make the changes active? 3) How do you enable logging on a UFS file system? What 4) What commands can you use to dynamically add scsi disks to a sun system? 5) How do you install package to a specific directory? e.g like to install wget in /home/vin/wget rather than the default one "/usr". ---This was not answered by me. 6) What command shows what modules are loaded into the Kernel? 7) What command increases the priority of a process and all sub processes on a solaris system? 8) What command in Solaris, do you use to setup aliases for devices? 9) How do you watch network traffic on interface qfe3? 10 ) What command shows TCP/IP parameter settings? 11) How do you set Network cards to 100 full interactively & permanently? 12) What tools in Solaris help you diagnose harware failures? 13) How do you determine by how much a Veritas Volume can be expanded? 14) How do you grow a Veritas VXVM volume? 15) Where is the dump from a system crash normally kept? Can we customize it?
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 337

16) How do you determine Volume Status in Veritas VxVM? 17) Why would you deport a diskgroup in VxVM? 18) How do you create additional state databases in solaris volume manager? -- This was the tough one..!! 19) Does Solaris Volume Manager have soft partitioning? 20) How do you clear volume information from a solaris volume manager disk? 21) How do you shutdown a Veritas Cluster Server, leaving the applications running from the command line? 22) How do you speed up processing of a process and All it's child processes? -- This was quite tricky..!! 1. Name the mandatory disk group in VxVM 3.5 ? How will configure VxVM in 3.5 ? 2. How will you create private and shared disk group using VxVM ? 3. Which are the different layouts for volumes in VxVM ? 4. What is the basic difference between private disk group and shared disk group ? 5. How will you add new disk to the existing disk group ? 6. How will grow/shrink the volume/file system ? What is the meaning of growby and growto options ? What is the meaning on shrinkto and shrinkby options ? 7. How will you setup and unsetup disks explicitly using VxVM ? 8. How will list the disks, which are in different disk groups ? 9. What is private region in VxVM ? 10. If, vxdisk list command gives you disks status as "error", what steps you will follow to make the respective disks online ?

1. 2. 3. 4. 5. 6.

Name the mandatory disk group in VxVM 3.5 ? How will configure VxVM in 3.5 ? How will you create private and shared disk group using VxVM ? Which are the different layouts for volumes in VxVM ? What is the basic difference between private disk group and shared disk group ? How will you add new disk to the existing disk group ? How will grow/shrink the volume/file system ? What is the meaning of growby and growto options ? What is the meaning on shrinkto and shrinkby options ? 7. How will you setup and unsetup disks explicitly using VxVM ? 8. How will list the disks, which are in different disk groups ? 9. What is private region in VxVM ? 10. If, vxdisk list command gives you disks status as "error", what steps you will follow to make the respective disks online ? These are some questions which I feel every storage professional should know. Please let me know if these are useful, answers will be posted in coming posts.

1.List the files in current directory sorted by size ? - ls -l | grep ^- | sort nr 2. List the hidden files in current directory ? - ls -a1 | grep ^\. 3. Delete blank lines in a file ? - cat sample.txt | grep -v ^$ > new_sample.txt

4. Search for a sample string in particular files ? - grep .Debug. *.confHere grep uses the string .Debug. to search in all files with extension..conf. under current directory.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 338

5. Display the last newly appending lines of a file during appendingdata to the same file by some processes ? - tail .f Debug.logHere tail shows the newly appended data into Debug.log by some processes/user.

6. Display the Disk Usage of file sizes under each directory in currentDirectory ? - du -k * | sort .nr (or) du .k . | sort nr 10. Display the processes, which are running under yourusername ? - ps .aef | grep MaheshvjHere, Maheshvj is the username.

12. Display the files in the directory by file size ? - ls .ltr | sort .nr .k 5 13. How to save man pages to a file ? - man | col .b > Example : man top | col .b > top_help.txt or # man rcs | col -bx > rcs.txt 14. How to know the date & time for . when script is executed ? - Add the following script line in shell script.eval echo Script is executed at `date` >> timeinfo.infHere, .timeinfo.inf. contains date & time details ie., when script is executed and history related to execution. 15. How do you find out drive statistics ? - iostat E 16. Display disk usage in Kilobytes ? - du k 17. Display top ten largest files/directories ? - du -sk * | sort -nr | head 18. How much space is used for users in kilobytes ? - quot af 19. How to create null file ? - cat /dev/null > filename1 20. Access common commands quicker ? - ps -ef | grep -i $@ 21. Display the page size of memory ? - pagesize a 22. Display Ethernet Address arp table ? - arp a

23. Display the no.of active established connections to localhost ? - netstat -a | grep EST 24. Display the state of interfaces used for TCP/IP traffice ? - netstat i 25. Display the parent/child tree of a process ? - ptree Example: ptree 1267 26. Show the working directory of a process ? - pwdx Example: pwdx 1267 27. Display the processes current open files ? - pfiles Example: pfiles 1267 28. Display the inter-process communication facility status ? ipcs
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 339

29. Display the top most process utilizing most CPU ? - top .b 1 30. Alternative for top command ? - prstat -a 3) Describe about Logical Domains and its functions? LDOMS system administrator center provides resources and links to developers who are trying to install Ldoms technology. It gives you flexibility to group system resources and discrete systems within a computer system physically. It allows you to group system resources physically within its own operating system, identity and resources. 4) Explain about RBAC? RBAC is introduced into Solaris for managing specific tasks. These specific tasks are based and defined in the administrator profile. It is based on the standard developed by NIST. RBAC is a very important tool for performing multiple tasks. It also separates tasks which require high technical knowledge from low ones. 5) Explain about Roles? RBAC implementation depends upon the role specified in the administrator profiles. Roles are implemented according to the profile. Also access to certain files and configuration can be assigned by the user profile. It also allows RBAC to differentiate high technical knowledge roles from low ones. 6) What are the three different system management roles? There are three different roles specified by Solaris they are 1) Primary administrator who is responsible for security 2) System administrator is responsible for day to day roles 3) Operator is responsible for data back up and maintenance.

7) What are the different ways to execute profiles? Profiles can be executed in many different ways some of them are 1) Pfexec executes a single command in profile 2) With some restrictions pfsh and pfcsh can be executed. 3) By directly logging into the account using su.

8) Explain about sudo? Sudo maintains database of all the privileges assigned to a user name. These privileges can be indentified by different commands present in the database. This feature helps a user to format a disk but the root system cannot be changed.

9) Explain about the limitations present in sudo? There are some limitations for sudo which makes RBAC popular they are 1) It is not possible to assign a user to work on specific file or profile. 2) It is also not possible to assign a user to work on a specific command. 3) By using shell commands and certain functions it is possible to have some restrictions on a user but it would consume time for a larger setup.

16) Explain about the command prof_attr? This forms the RBAC profile database. It displays the relationship between among the profiles in the database. It also gives authorizations between navigation for those files. One of the samples is Solaris.admin.fsmgr.read.solaris.admin.serialmgr.read.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 340

17) Explain about kadmin command? Local kerbeors services can be managed by administering policies, keytabs and principles by managing the kadmin command. Kadmin.local is used to master KDC and it does not require any authentication. On the server login information is passed through a secured server. It checks the principle name by the value of the user environment variable. 1. You can ping servers on the subnet your workstation is on, but not other subnets. What is wrong? 2. If you can ping a server, but can't telnet or ssh to it, what could be the problem? 3. If a user logs in to UNIX, it displays the desktop and then immediately logs you back out, what could be wrong? 4. If you mistype a password, how do you clear it out to retype the password again. 5. When would you want to reconfigure the kernel and how would you do it? 6. Which is your favorite editor, shell, programming shell and why? 7. Why should you never have '.' in root's path? 8. If fsck is running, what is the one thing you shouldn't do? 9. What are the 3 or 4 major flavors of UNIX and what are their SA tools? 10. What kind of PC - UNIX connectivity programs are you familiar with? 11. What are: UFS, NFS, SaMBa, LDAP, NIS, DNS, Veritas 12. If you send an e-mail to someone and it comes back "Message Undeliverable", what could be wrong. 13. How do you give a user access to an application or program that needs to run as root without giving them the root password? 14. When you "ping server" and "ping server.domainname", you get different results. Why? 15. Someone pings a server from another location and gets a different result than if you ping the same server onsite. What is going on? 16. You know the reason the server won't boot is because of ODS, but the root partition isn't on ODS. How do you go about fixing it? 17. How would you truncate a log file that is growing too large if you don't have space to compress it or to move it somewhere else? How would you do it "hot"? 18. When the key is in the lock position on a Sun Enterprise server, can you do a Stop-A? Explain. 19. What does "boot -a" do? 20. What is uadmin and what does it do? 21. What does "ypwhich servername" do? Why would you use it? 22. If you have multiple ethernet interfaces, how do you keep it from routing between them? 23. Can you add HDD's to a Sun server and not have to do a reconfiguration reboot? Explain 24. If you have forgotten the root password for a server, how do you get back in? 25. What makes NIS+ more secure than NIS? 26. What are the differences between Solaris 2.6 and lower and 7 and higher? 27. How can you search for commands at the boot prompt if you only know part of the command? 28. What are the two settings you can change to make a system boot faster? 29. What are the differences between Sun OS and Solaris? 30. What do soft partitions buy you with Solaris Volume Manager? 31. How can you set EEPROM settings from Solaris?

1 ) Difference between Solaris 8, Solaris 9 and Solaris 10 2) How to list disk in vertitas volume manager 3) What is initilization in veritas volume manager
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 341

4) What is encapsulation in veritas volume manager 5) How to secure direct remote login of root in solaris 6) What are different type of RAID , explain each in brief , which is better for performance 7) What are the key compontents in Veritas Cluster Server 8) Difference between veritas cluster server and Microsoft cluster server 9) How to check whether installed solaris is of 32 bit or 64 bit 10) Explain Solaris boot process and Redhat Linux boot process 11) How to secure solaris installed on a machine 12) What are different run levels in Solaris & in Linux 13) Explain the hardware configuration steps in Solaris 14) How will you configure a NAS in Solaris,Linux 15) How will you map a SAN lun onto a Solaris host

General UNIX 1. What does the route command do? 2. What are the read/write/execute bits on a directory mean? 3. What does iostat do? 4. what does vmstat do? 5. What does netstat do? 6. What is the most graceful way to bring a system into single user mode? 7. How do you determine disk usage? 8. What is AWK? 9. What is SED? 10. What is the difference between binaries in /bin, and /usr/bin? 11. What is a dynamically linked file? 12. What is a statically linked file?

What is the difference between Daemon & Server process.

Please give examples of both Daemon and Server processes. Thanks. Latest Answer: A Daemon is a software process that runs in the background (continuously) and provides the service to client upon request. For example named is a daemon. When requested it will provide DNS service. Other examples are: xinetd (it is a super-daemon, ...

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 342

1. How are devices represented in UNIX? All devices are represented by files called special files that are located in/dev directory. Thus, device files and other files are named and accessed in the same way. A 'regular file' is just an ordinary data file in the disk. A 'block special file' represents a device with characteristics similar to a disk (data transfer in terms of blocks). A 'character special file' represents a device with characteristics similar to a keyboard (data transfer is by stream of bits in sequential order). 10. How does the inode map to data block of a file? Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks in the file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a three-level(triple in-direction)index block. This provides a very large maximum file size with efficient access to large files, but also small files are accessed directly in one disk read. 13. What are various IDs associated with a process? Unix identifies each process with a unique integer called ProcessID. The process that executes the request for creation of a process is called the 'parent process' whose PID is 'Parent Process ID'. Every process is associated with a particular user called the 'owner' who has privileges over the process. The identification for the user is 'UserID'. Owner is the user who executes the process. Process also has 'Effective User ID' which determines the access privileges for accessing resources like files. getpid() -process id getppid() -parent process id getuid() -user id geteuid() -effective user id

20. What is a zombie? When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls `wait()'; In the interval between the child terminating and the parent calling `wait()', the child is said to be a `zombie' (If you do `ps', the child will have a `Z' in its status field to indicate this.) 21. What are the process states in Unix? As a process executes it changes state according to its circumstances. Unix processes have the following states: Running : The process is either running or it is ready to run . Waiting : The process is waiting for an event or for a resource. Stopped : The process has been stopped, usually by receiving a signal. Zombie : The process is dead but have not been removed from the process table.

What is the command in UNIX to see a list of opened files?

lsos

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 343

lsof - List open files on the system. Normally, it only lists files you (or processes you own) have open; if run as root, it lists all open files. ...
Latest Answer:

When Grub is crashed then how i start the linux os?


Latest Answer:

boot frm 1st cd type1) chroot /mnt/sysimage2) grub-install

/dev/sda .
Unix/Linux administration interview questions

What is LILO? LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, and tell the system which partition and hard drive to boot from.

What is the main advantage of creating links to a file instead of copies of the file? A: The main advantage is not really that it saves disk space (though it does that too) but, rather, that a change of permissions on the file is applied to all the link access points. The link will show permissions of lrwxrwxrwx but that is for the link itself and not the access to the file to which the link points. Thus if you want to change the permissions for a command, such as su, you only have to do it on the original. With copies you have to find all of the copies and change permission on each of the copies. Write a command to find all of the files which have been accessed within the last 30 days. find / -type f -atime -30 > December.files This command will find all the files under root, which is /, with file type is file. -atime 30 will give all the files accessed less than 30 days ago. And the output will put into a file call December.files.

What is the most graceful way to get to run level single user mode? A: The most graceful way is to use the command init s. If you want to shut everything down before going to single user mode then do init 0 first and from the ok prompt do a boot -s. What does the following command line produce? Explain each aspect of this line. $ (date ; ps -ef | awk {print $1} | sort | uniq | wc -l ) >> Activity.log A: First lets dissect the line: The date gives the date and time as the first command of the line, this is followed by the a list of all running processes in long form with UIDs listed first, this is the ps -ef. These are fed into the awk which filters out all but the UIDs; these UIDs are piped into sort for no discernible reason and then onto uniq (now we see the reason for the sort - uniq only works on sorted data - if the list is A, B, A, then A, B, A will be the output of uniq, but if its A, A, B then A, B is the output) which produces only one copy of each UID.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 344

These UIDs are fed into wc -l which counts the lines - in this case the number of distinct UIDs running processes on the system. Finally the results of these two commands, the date and the wc -l, are appended to the file "Activity.log". Now to answer the question as to what this command line produces. This writes the date and time into the file Activity.log together with the number of distinct users who have processes running on the system at that time. If the file already exists, then these items are appended to the file, otherwise the file is created.

Unix admin questions How do you list the files in an UNIX directory while also showing hidden files? How do you execute a UNIX command in the background? What UNIX command will control the default file permissions when files are created? Explain the read, write, and execute permissions on a UNIX directory. What is the difference between a soft link and a hard link? Give the command to display space usage on the UNIX file system. Explain iostat, vmstat and netstat. How would you change all occurrences of a value using VI? Give two UNIX kernel parameters that effect an Oracle install Briefly, how do you install Oracle software on UNIX.

IMPORTANT FAQ IN SOLARIS 1)How to do see the processor information in solaris 8/9/10. # psrinfo # psrinfo v :- To see which processors are online and offline. If you have multiple processors. 2) How to change processor operation status in solaris. # psradm a n :- To set all processor available on the system to online # psradm f 2 3 :- To make processor 2 and 3 offline, if you have multiple processors 3)How to make processor 4 number offline when you have more then 4 processors. # psrinfo V :- To check the status and then # psradm f 4 offline - To make processor number 4 offline 4)How to make processor 3 online when you have more then 4 processor and processor 3 is offline? # psrinfo v:- To see the status of all processors # psrinfo a 3 online :- To make processor 3 online 5)How to see which kernel version and artitecture used by the syste. # isainfo -v :- To see kernal version and 32 bit or 64 bit system and artictect.

7)How do you set a deafault device from the boot prom # setenv boot-device disk Boot-device=disk
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 345

# reset - To make the changes.

11)How to check the check the clock devices from OBP Ok>netwatch-clock 12)How to set environment variable in NVRAM # nvalias /pci---/rarp to set scsi for booting of client # nvalias net dhcp to boot from dhcp # nvunalias net remove the alias 13)How to configure newly attached hardware like hardsik network card. # devfsadm Or #drvconfig

SOLARIS TROUBLE SHOOTING Q&A 1)What can I do if Solaris won't boot? You need to boot from your install CD. Insert the Solaris Software CD in your CDROM drive. If your CDROM drive/BIOS isn't bootable, first insert the "Device Configuration Assistant" (DCA) diskette. At the "Boot Solaris" menu, choose "CD." At the "Type of Installation: Interactive or JumpStart" menu, type "b -s" Or, after the video configuration, network, time and date you'll notice one of the menu's has a button: [Exit] Select Exit and, when it asks you again "do you want to exit?," just say yes. Once you're at the UNIX root prompt #, you can mount the boot drive with "mount /dev/dsk/c0t0d0s0 /mnt"" and view anything wrong with the boot drive (omit the "t0" for ATAPI). 2)How do I restore the Solaris boot block without reinstalling? This may happen when installing a boot manager that comes with another operating system (such as LILO from Linux) or an after-market multi-OS boot manager. These sometimes trample's active partition, which in our case is Solaris. Also, moving the Solaris partition with a partition manager program such as Partition Magic requires reinstalling the Solaris boot block. Before taking these steps, first verify the Solaris partition is active. If it isn't, just make the Solaris partition active and reboot. Otherwise follow the steps below. 1. Boot from CD-ROM and get the root prompt, #, as described in the previous question, 7.1. 2. Determine the controller, disk number, and partition. The boot disk is /dev/rdsk/c?t?d?p? where ? is the controller #, target ID, and disk #, and partition #. Omit "t?" for ATAPI E.g., /dev/rdsk/c0d0p0 3. Verify it's the correct device correct with prtvtoc for the drive: This is VERY important; if it's wrong, you you may hose another partition: prtvtoc /dev/rdsk/c0t0d0p0 (omit "t0" for ATAPI, always use p0, which means the "entire drive"). The prtvtoc prints out the map for the Solaris partition on the hard drive, if found. The partitions shown on the output are actually "slices" within the Solaris partition.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 346

5. Finally, remove your CDROM and diskette media and type "/sbin/shutdown -i6" to reboot. The Solaris Multiple Device Boot Menu should appear after rebooting. If not, you can always to an upgrade (re-)install. Note: This procedure does NOT make your Solaris partition active again (sometimes needed after installing another operating system, such as Windows, on the same disk), it just writes to your bootblock IN your Solaris partition. To learn more about the Solaris boot process, read the boot(1M) man page.

What file do you modify to change the mail aliases (Provide the full path) ? 2) What command do you run after modifying the aliases file make the changes active? 3) How do you enable logging on a UFS file system? 4) What commands can you use to dynamically add scsi disks to a sun system? 5) How do you install package to a specific directory? e.g like to install wget in /home/vin/wget rather than the default one "/usr". ---This was not answered by me. 6) What command shows what modules are loaded into the Kernel? 7) What command increases the priority of a process and all sub processes on a solaris system? 8) What command in Solaris, do you use to setup aliases for devices? 9) How do you watch network traffic on interface qfe3? 10 ) What command shows TCP/IP parameter settings? 11) How do you set Network cards to 100 full interactively & permanently? 12) What tools in Solaris help you diagnose harware failures? 13) How do you determine by how much a Veritas Volume can be expanded? 14) How do you grow a Veritas VXVM volume? 15) Where is the dump from a system crash normally kept? Can we customize it? 16) How do you determine Volume Status in Veritas VxVM? 17) Why would you deport a diskgroup in VxVM? 18) How do you create additional state databases in solaris volume manager? -- This was the tough one..!! 19) Does Solaris Volume Manager have soft partitioning? 20) How do you clear volume information from a solaris volume manager disk? 21) How do you shutdown a Veritas Cluster Server, leaving the applications running from the command line? 22) How do you speed up processing of a process and All it's child processes? -- This was quite tricky..!! These questions are asked in Dell,Invensys and collected from other interview experiences of blog readers. 1 ) Difference between Solaris 8, Solaris 9 and Solaris 10 2) How to list disk in vertitas volume manager 3) What is initilization in veritas volume manager 4) What is encapsulation in veritas volume manager
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 347

5) How to secure direct remote login of root in solaris 6) What are different type of RAID , explain each in brief , which is better for performance 7) What are the key compontents in Veritas Cluster Server 8) Difference between veritas cluster server and Microsoft cluster server 9) How to check whether installed solaris is of 32 bit or 64 bit 10) Explain Solaris boot process and Redhat Linux boot process 11) How to secure solaris installed on a machine 12) What are different run levels in Solaris & in Linux 13) Explain the hardware configuration steps in Solaris 14) How will you configure a NAS in Solaris,Linux 15) How will you map a SAN lun onto a Solaris host These are some of the L3 level unix interview questions 1. How do you replace a failed boot disk under meta in solaris? Step by step explanation? 2. How do you remove meta only for the root slice? remaining slices should run under meta? 3. what you would do if you want to replace a slice using metareplace option? 4. what is the significance of 51% state database replicas in SVM? 5. what are the common errors you find in Solaris Volume manager? 6. You have a boot disk under svm, the machine fails to boot and remains in ok prompt? what could be the possible reason? 7. metastat -p shows a metavolume needs replacement. Metavolume is a single way mirror only. Actually you find disk and metavolumes are ok and I/O is happening to the filesystems how will you remove the metareplace message that comes out of metastat. 8. How to create a shared disk group in VxVM? 9. What is the difference between private and public regions in Veritas Volume manager? 10. what would you do if the private region of a particular disk group is full? What are the design considerations for the size of private region in Vxvm disk group? 11. How to replace a corrupt private region? in vxvm 3.5 and greater versions 12. How would you convert a volume from gen to fsgen? why should you do that?
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 348

13. How can you unencapsulate a boot disk in VxVM? 14. How to identify multiple paths for a disk. 15. What is the difference between Vxdmp and EMC powerpath? 16. vxdisk -o alldgs list o/p shows some disk groups in braces What does that signify? 17. what are the various layouts that are available in VxVM? 18.What is a layered volume? how to create it using vxmake? 19.How to quickly mirror a volume, if the volume is empty? 20. How to grow a volume? 21. What is the difference between failing and failed disks? 22. How to replace a failed disk in Veritas? 23. Plex is in a disabled state. How will you recover? what are the steps to follow? 24.what is the difference between detached and disassociate state of plexes? 25. Whats the boot process of VxVM? 26. Whats the difference between SVM and VxVM? What would you recommend to your clients? why? 27.What are the various clusters you have worked on? 28. Which cluster is better VCS or Sun cluster? 29. Compare and contrast VCS and Sun Cluster. 30.how will you start VCS service? What are the configuration files in VCS? There are 6 files. #vi /etc/hosts #vi /etc/nodename #vi /etc/hostname.hme #vi /etc/net/ticlts/hosts #vi /etc/net/ticosts/hosts #vi /etc/net/ticotsord/hosts How to find the network card speed # ndd get /dev/hme link_speed 1 = 100mbps 0 = 10mbps How to modify network card speed # ndd set /dev/hme instance 0
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 349

# ndd get /dev/hme link_status # ndd get /dev/hme link_mode To modify # ndd set /dev/eri instance 0 # ndd set /dev/eri adv_100T4_cap0 # ndd set /dev/eri adv_100fdx_cap1 # ndd set /dev/eri adv_100hdx_cap0 # ndd set /dev/eri adv_10fdx_cap0 # ndd set /dev/eri adv_10hdx_cap0 # ndd set /dev/eri adv_autoneg_cap0

Procedure for Firmware upgrade Shutdown root cron on csslu377 servers #./etc/init.d/cron stop Reset the system controller from the console. # resetsc -y Upgrade the firmware on the system controller > cd /114527-04 > lom -G ./sgrtos.flash > lom -G ./sgsc.flash Escape to lom> and reset the SC: lom> resetsc -y Upgrade the firmware on the system boards: > lom -G ./lw8cpu.flash > lom -G ./lw8pci.flash Shutdown the Operating System. #shutdown i0 g0 y

Explain /etc/system file It will control the kernel modules and it dived into 5 sector Moddir : default loadable kernel modules Root.devices & root files configuration : Physical path name of the devices Exclude: Does not load the kernel during kernel initializing Forceload: Force the kernel module to load Set: set maxium user =40 Telnet = 23 ftp = 25 ssh = 22 nfs = 2049 nis = 749 How will you restart the inetd process? # Pkill HUP inetd

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 350

What is nice and renice command do To set the high priority for the process -20 high priorities +20 low priorities Eg: # nice 20 oracle

How will you check the disk performance? # iostat xctd 4 5

How to find the kernel bit version or architecture # isainfo kv How to enable and disable the dtlogin # /usr/dt/bin/dtconfig e ( enable) # /usr/dt/bin/dtconfig d ( disable) What are the NFS daemon in server & client Server Daemons 1 mountd 2.nfsd 3.nfslogd 4.statd 5.lockd

Client Daemons statd lockd

What is difference between Hard and Soft mount? Hardmount: Normal file system mount used mainly for mounting local file systems. Once a file system is hard mounted, can use a normal filesystem untill its umount. Soft mount: It allows automatic unmounting if the filesystem is idle for a specified timeout period. It is mainly used for network filesystems like NFS It can be configured using Autofs and the network filesystem can be soft mounted.

How will you comment error line in /etc/system file # Vi /etc/system (To comment the error line in /etc/system files, we have to use *) How will you come to know wheather hme 0r eri or to configuring the network card. Base on Ethernet card How many will you find the process id and disk utilizations. # pr What is WWN on storage World wide number What is mean by paging & server average time.

Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 351

If a disk shows consistently high reads/writes along with , the percentage busy (% b) of the disks is greater than 5 percent, and the average service time (svc_t) is greater than 30 milliseconds, then one of the following action needs to be taken

How to find the demo? #Ps ef |grep vxvm How to find the versions? pkginfo -l VRTSvxvm What are the daemons in VERITAS? Vxconfigd Vxiod vxrelocd How will create a rootdg # vxdg -g rootdg adddisk newroot=c2t2d0 How to mirror a rootdg Initialize a new disk #devfsadm #format ( to label the disk) #vxdctl enable #vxdisksetup I diskname (c0t1d0s2) #vxdg g rootdg adddisk rootnew=c0t1d0s2 #vxprint list #vxrootmir rootnew How to remove the root mirror First disaccociate the plex #vxplex dis rootvol-02 Now, the slice information for disk newroot (c2t2d0) is: # prtvtoc -s /dev/rdsk/c2t2d0s2

Delete the rootalt volume from the new root disk. # cd / # umount /mnt # vxvol stop rootalt # vxplex dis rootvol-02 (Disassociate the plex from the volume and remove the volume.) # vxedit rm rootalt # vxsd dis newroot-01 (Disassociate the sub-disk from the plex and remove the plex.) # vxedit rm rootvol-02 7. Mirror all the other volumes from the current root disk to the new root disk.Do not mirror swap volumes. Swap slices will be created on the new disk manually. In this example, the volumes to mirror are var and opt.
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 352

# vxassist -g rootdg mirror var newroot # vxassist -g rootdg mirror opt newroot What are the steps to be follow to add a disk in veritas & before add the disk what are the steps to be follow Before adding the disk, take an output from the format command. take an output of vxdisk list after the disk is added, do the following: #devfsadm #format --> label the disk #vxdctl enable #vxdiskadm choose the option 1 and then it will ask you the diskgroup once it has been added it will ask for the encapsulation, say no then it will ask the device name, assign the name, that's it, #vxdisk list, this will tell the status of the newly added disk as online

How will you create a subdisk and plexus vxmake sd disk02-02 disk02,0,8000 this would create a subdisk called disk02-02 at the start of disk02 and would be 8000blocks (4000k) long. vxmake plex hazly-02 sd=disk03-01 creates a plex called hazly-02 using subdisk disk03-01 How will you remove the subdisk and plexus to dissociate a subdisk try vxsd dis disk##-## remove a subdisk by vxedit rm disk##-##

Explain shrinking the disk Shrinking the disk is nothing but reducing the allocated volume size

How will you grow a disk space whitout disturbs #vxresize What is an alternative to the top command on Solaris? # prstat a How to find the VERITAS License? After installing VERITAS, one should confirm with VERITAS license keys #vxlicense -p How to create a new volume Detect new disks #devfsadm #vxdiskadm - select option 1 to add new disks (Initialize new disks and add it to disk group appdg )
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 353

# vxassist g appdg make snetprd01 55g (create volume in appdg as snetprd01) #mkfs F vxfs o largefiles /dev/vx/rdsk/appdg/snetprd01 (creating file system for the volumes snetprd01) # cd / (creating directories for snetprd01 ) #mkdir snetprd01 #chown oracle /snetprd01 (change the ownership to oracle for snetprd01 directories ) #vi /etc/vfstab #mount /snetprd01 #df k #mount p #vxdisk list ##vxprint g appdg How to remove the volume Restore the previous /etc/vfstab #cp /etc/vfstab.0702 /etc/vfstab # umount /snetprd01 (Unmounting the files) #rmdir /snetprd01 (Remove the mount points) #vxvol g appdg stop snetprd01 (Stopping the volumes snetprd01 from appdg) #vxedit g appdg v rm snetprd01 (removing volumes from disk group) # df k #vxprint -g appdg How to find the plex, sub disk, Volume group, disk status, free spaces, disk controller, Volume controller? Displays info about plexes #vxprint -lp #vxprint -l plex_name Displays info about subdisks # vxprint -st #vxprint -l disk##-## show disk iops over 10 seconds... #ssaadm display -p c# Traces all i/o on a volume.. #vxtrace vol To report disk stats #vxstat -d Displays the free space on the disks #vxdg free Display the disk crontroller #vxprint list #vxprint -Aht Tells you how much you can grow a volume by #vxassist maxgrow vol How to remove the pluxs ,subdisk.

In VERITAS How to recover the mirror disk with data.


Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 354

How to bring the existing data disk into VERITAS volume manger control. Through Encapsulations method

How to change the mirror status from 0:1 to 0:5 and how? Through vxedit Were the veritas disk information store. #/kernel/drv/sd.cf How to increase the size of the file system? # df k ( dentify the VERITAS group and volume name of /myhr on EXU407 ) # vxassist g appdg maxsize (check for the free space available in the group appdg on EXU407 ) # vxprint thA g appdg (Check if /myhr is mirrored) # mount p (check the file system of /myhr ) # cp p /etc/vfstab/etc/vfstab.070223 ((take backup of /etc/vfstab file ) you can increase the size of teh file system by using solaris volume manager # vxresize F vxfs g rootdg myapps +5g (increase the size of /myapps by 5gb) How to increase the size of the file system? # vxresize F vxfs g rootdg myapps +5g (decrease the size of /myapps by 5gb) #df -k How to add a root dg? #vxdg -g <dg name> adddisk <media name>=c2t0d0 What is the difference between the VERITAS 3.0 and VERITAS 4.0? In VERITAS 3.0 , the root dg is present by default In VERITAS 4.0, the root dg has to be created manually In Vertias 4.0 cdsdisk has introduced which means, in any os it can be exported How to mirror a root dg? With eg #vxrootmir How to rename the old root disk. In this example, rootdisk is being renamed as rootold. # vxedit -g rootdg rename rootdisk rootold How to Encapsulate the new root disk (c2t2d0). # /etc/vx/bin/vxencap rootdisk=c2t2d0 How to mirror and unmirror a disk? #vxassist mirror hazly disk05 disk06 uses disks5 and 6 ro make a mirror on volume called hazly #vxassist make hazly 50m layout=mirror makes a 50Mb mirror using any 2 disks How to remove a disk group? #vxdg destroy <disk group> How to display the volume configuration information? #vxprint -l rootdg
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 355

What is the command to identify master node on vcs #vxdctl -c mode mode: enabled: cluster active - MASTER What is the nature of VCS? Active Active Load Balancing and high availability Active passive No load Balancing What is HA? It is a daemon of a cluster which is in the form of Active Passive, i.e. No load balancing HA--> Highly Available means, two or more systems are connected with the same configuration, if one fails the other will take care the resources How far VCS supports? VCS supports more than 32 nodes. What are the protocols in VCS VRTSLLT ( low latency ) & VRTSGAB ( Global autom) How to Use the # DEVICE c1t1d0s2 c1t2d0s2 c1t3d0s2 # # clear the failing flag on a veritas volume manager disk: vxdisk list command to find out which disks are failing: vxdisk list TYPE DISK GROUP STATUS auto:sliced mydg01 mydg online auto:sliced mydg02 mydg online failing auto:sliced mydg03 mydg online vxedit set failing=off mydg02 vxdisk list

How to Create a snapshot mirror snapstart starts creating a online snapshot mirror of the volume using the available disk space . The snapshot is completed with vxassist snapshot command when offline snapshot volume is created with a userdefined name . Command Syntax: vxassist snapstart volume_name To create a snapshot mirror of a volume called vol8, type #vxassist snapstart vol8

How to bring the Disk into diskgroup on veritas. Force a lip event on the hbas so they will re-login in Storage luxadm e forcelip /dev/cfg/c5 luxadm e forcelip /dev/cfg/c7 Enable the disk devices. vxdctl enable vxdisk o alldgs list initialize newdisk
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 356

vxdisksetup i <diskname> Add disk to disk group vxdg g oradg adddisk oradg05= <diskname> vxdg g oradg adddisk oradg06= <diskname> Verify free disk space vxassist g oradg maxsize How to Create a snapshot volume Command Syntax vxassist snapshot volume_name new_volume_name To create a snapshot volume of vol8, type: #vxassist snapshot vol8 snapvol8 You can now back up the snapshot volume by whatever means you prefer. To avoid wasting space, you can then remove the snapshot volume, which occupies as much space as the original volume

What are the types of cluster configuration? 1. Horizontal configuration 2. Vertical configuration Command to find the VCS status #hastatus sum What are the minimum hardware requirements for cluster configuration? Storage boxes 1 Node Cluster 2 Minimum 2 nodes, 2 etherned address, shared disk and HA applications (ex) oracle What is the purpose of ha daemons in VCS servers? Ha daemons are used to start/stop services in VCS servers How to check the communication between 2 nodes? Heart beat checks the communication between 2 nodes. What is a heart-beat? It is a script that checks the communication between nodes. Heart-beat is a communication which can be set at the time of creating a system in a cluster, which can send and receive signal through that designed port. to check the heartbeat use the command gabconfig -a

What are the two types of service groups? 1. Parallel Service group
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 357

2.

Fail over service group.

How to unconfigure llt and gab #lltconfig U #gabconfig -U #hastop How to start llt and gab #lltconfig c #gabconfig c -x #hastart How to start one node cluster. Ok boot x How to stop one node cluster exclusively # hastop local force ( This will ring down the vcs only not application it will on alive) Were the vcs logs will be #/var/VRTSvcs/log/engine_A.log What are configuration files and to configure it in VCS configuration files: Notes :- Before configuring VCS make sure the local_mac_address =true. #eeprom local_mac_address?=true ( on both the nodes) # /etc/llthosts (specify the node names) (eg) 0 sun 1 1 sun 2 #/etc/llttab (specify the node names) Set-node 0 Link qfe0 /dev/qfe:0 _ ether _ _ Link qfe1 /dev/qfe:1 _ ether _ _ set_cluster 10 Start #/etc/gabtab (specify the node names) /sbin/config c n 2 Path to be set = /etc/profile #PATH=$PATH:/opt/VRTS/bin:/sbin:/opt/VRTSllt #export PATH #/etc/VRTSvcs/conf/config/main.cf #/etc/VRTSvcs/conf/config/sysname How to bring the resource to online and offline # /opt/VRTSvcs/bin/hagrp -online (service_group) -sys (system_name) hagrp # /opt/VRTSvcs/bin/hagrp -offline (service_group) -sys (system_name) hagrp How to Switch service group between nodes # /opt/VRTSvcs/bin/hagrp -switch (service_group) -to (system_name) hagrp How to Freeze svcgroup, (disable onl. & offl.) # /opt/VRTSvcs/bin/hagrp -freeze (service_group) [-persistent] hagrp
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

Sun Solaris 10 Operating System

Page 358

How to unfreeze the svcgroup, (enable onl. & offl.) # /opt/VRTSvcs/bin/hagrp -unfreeze (service_group) [-persistent] What is the command to check the connectivity between 2 nodes Get the mac address from both the nodes #getmac /dev/qfe:0 Sv from server side Cv from client side #./dlpiping sv /dev/qfe:0 macaddresss #./dlpiping cv /dev/qfe:0 macaddresss How to stop the VCS #hastop local #hastop local evaculate 100% shutdown the system #hastop loca force without shutting down the application,only vcs can be down (hadaemon) What are the service group dependence? 4types Online local Online remote Online global Offline global SUN CLUSTER offline cluster resources on smslu131 verify resources are online on tgui1-svc - # scstat Take all resources offline - # scswitch F g smsweb-rg verify resources are offline on both tgui1 & tgui2 - # scstat verify resources are offline on tgui1-svc & tgui2-svc - # scstat

switch resources online on smslu131 - #scswitch Z g smsweb-rg verify resources are online on tgui1-svc - #scstat verify resources are online on tgui1-svc - # scstat switch resources from smslu131 to smslu132 -# scswitch z g smsweb-rg h tgui2-svc verify resources are online on tgui2-svc - # scstat switch resources from smslu131 to smslu132 -# scswitch z g smsweb-rg h tgui1-svc verify resources are online on tgui1-svc - # scstat

The contents of this material is not affiliated with Sun Microsystems affiliates. Any tips/information offered up here can be followed at your own risk. I will not be responsible for any loss of data, time, or any other damage occurred by following any information on this material. They seemed to work for me, but your mileage may vary. 2009 Manickam Kamalakkannan
Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster Manickam Kamalakkannan

You might also like