Single user mode is the character based mode, we canperform administrator task and all.
In Multiuser mode , runlevel 3 is the default run of that.We can perform all types of system functions.
Single User mode: Single user mode is for trouble shootingpurpose, in this mode only root user can login to the system.
Multi User Mode: In this mode apart from root user other user can also login to the system and they can access resources and applications of the system.
Single user
Solaris OS single-user mode with critical file systems mounted and accessible, Maintenance
Only root user can access.
Multi user
The system is supporting multiuser operations. Multiple users can access the system. All system daemons are running except for the Network File System (NFS) server and some other network resource server related daemons.
In multiuser mode NFS server & client services are available whereas in single user mode, no NFS service is available and only root filesystem is available.
Single user mode is the maintenance mode where only systems critical files are mounted. Multiuser mode is running the server with full network services including NFS.
________________________________________
Single User Mod or Run Level s or S,
Solaris OS single-user mode with critical file systems mounted and accessible.
Multi User Mode or Run Level 3,
The system is supporting multiuser operations and has NFS
resource sharing and other network resource servers
available.
Main difference between these two level is as follows.
1). Network Services will not work in Single user mode.
2). Network Serviceses will work in Multi user mode.
Which of the following commands can tell you whether packets are being delayed or dropped on your network?
Spray
What are the main differences between solaris 10 and 9?
Answers:
The main difference in solaris 9 & solaris 10 is "SMF(SolarisManagement Facility)".
In solaris 9, if any service goes down then we should restart all services this is the disadvantage.
But in solaris 10,if any service goes down then that particular service we can select and enable it instead of restarting all services.
Solaris9:its only support terabytes
this only init phase
its not used SMF(Service management Facility)
there is no Zones
Solaris 10:its only support petabytes and ZFS(zeta byte file system)
it used in svcs servicess
zones also supported
There is an SMF facility
What is the big difference between /dev/dsk and /dev/rdsk
In Solaris whenever you create a new slice using format command a raw physical slice or a Raw Device will be created which is addressed as /dev/rdsk/c#d#s# where # is the number for slice.
After formatting it with newfs command the slice will be addressed as /dev/dsk/c#d#s# which can now be used for mounting.
eg. newfs /dev/rdsk/c0d0s4
mkdir /oracle
mount /dev/dsk/c0d0s4 /oracle
After mounting /dev/dsk/c#d#s# is called as Block Device
/dev actually contains logical device names which are links (Shortcuts in windows terminology) to actual physicaldevices in /devices directory.
________________________________________
when we performing i/o operation on secter of disk the use the /dev/rdsk/c#t#d#s# #number
e.g this will use when creating the file system, repairing the file system & while retriving the some informatuion form the file system
/dev/dsk its is a block device,when we perform the i/o operation on the block of disk,
e.g During mounting & unmounting
What command will display the VTOC for disk c0t0d0s0?
Answers:
prtvtoc /dev/rdsk/c0t0d0s0
PRTVTOC
There are two options
1.#prtvtoc /dev/rdsk/c0t0d0s0
2. #format
What file controls system wide password aging?
/etc/shadow
/etc/default/passwd
Which NFS daemons are found on the NFS server?
Answers:
nfslogd
________________________________________
In NFS server side there are 4 Deamons
They are
1.mountd
2.statd
3.lockd
Posted by: Praveen kumar
Contact Praveen kumar
________________________________________
nfsd
mountd
lockd
statd
nfslogd
These five daemons will be in NFS server.
statd and lockd will be in NFS client too.
server daemons-
nfsd
mountd
statd
lockd
rpcbind
nsflogd
What is the command can reconfigure devices with out reboot?
Answers:
Either you can use
1.devfsadm
single command solaris 8 on wards in the backward we have to use
1.drvconfig
2.diskor tape..(Device type)
3. devlinks
then the device will configure properly.
How will you add a virtual IP address to a server in Solaris. Given the interface qe0 and IP 10.10.1.150
Answers:
Syntax:
#ifconfig qe0:1 plumb
# ifconfig qe0:1 10.10.1.150 up
where "qe0" is an interface (e.g., le0) and N is a number between 1 and
with "ifconfig qe0:1 10.10.1.150 down".
As with physical interfaces, all you need to do is make the
appropriate /etc/hostname.qe0:X file.
What is the command to do an interactive boot from the ok prompt?
After Power on,
press,
STOP+A
at the ok prompt type,
ok>boot –a
Which obp command has a premenent allais?
When NValias need is:
In case system can not boot from primary disk and it is needed to make another boot disk to access the data , nvalias command is used.
nvalias command makes the device alias and assigns an alternate name to a physical disk. Physical address of target disk is required which can be had by show-disk command on ok>.
ok> nvalias disk7 /iommu@f,e0000000/sbus@f,e0001000/dma@3,81000/esp@3,80000/sd2,0
The new aliased disk can be named as boot disk or can be used for booting by referring its name
ok> setenv boot-device disk7
ok>reset
or
ok> boot disk7
How can we find RAM size in solaris server ?
Answers:
In Solaris 10 you can find the RAM Size using sdtwsinfocommand. This command gives complete WorkstationConfiguration Information in a pop up window.
________________________________________
use Banner in ok prompt
or use prtconf with grep for mem
prtconf |grep mem
________________________________________
#prtdiag command will help you to find the RAM size.
________________________________________
There are many options
1. prtconf |grep Mem
2 . In OPB banner
swap -l
swap -s
This two commands can display the EAM size
________________________________________
You can use the command below as well:
prtdiag -v |grep Mem
What would a XIR signal do to a server and why would it be used?
XIR signal used by reset command in solaris.
reset(1M) allows you to reset one or more domains in one of two ways: reset the hardware to a clean state or send an externally initiated reset (XIR) signal. The default is to reset the hardware to a clean state. You will receive an error if the virtual keyswitch is in the secure position. An optional confirmation prompt is given by default. Refer to Chapter 6 in the System Management Services (SMS) 1.2 Administrator Guide for the Sun Fire 15K/12K Systems for more information.
An XIR signal (reset -x ) also traps to low-level domain software (OpenBoot PROM or kadb ), which retains control of the software. The domain must be rebooted manually.
Let me hope it will be useful info....
What field will cause the message Your password has expired to be displayed to the user?
he /etc/shadow file contains following fields.Login-id : Which indicates the username of that perticular user.Passwd : It Contains encrypted password.Lastchg : Indicates the number of days between 1-JAN-1970 and last passwd modification date.Min : Contains minimum no of days required between password changes.Max : Contains the maximum no of days the password is valid before the user's propted to enter a passwd at login.Warn : Contains the number of days the user is warn before the password expires.Inactive : Contains the number of inactive days allowed for that user before the user's account is locked.Expire : contains the date when the user account expires once exceeded. The user can no longer log in also it will display the message "Your password has been expired".
he /etc/shadow file contains following fields.Login-id : Which indicates the username of that perticular user.Passwd : It Contains encrypted password.Lastchg : Indicates the number of days between 1-JAN-1970 and last passwd modification date.Min : Contains minimum no of days required between password changes.Max : Contains the maximum no of days the password is valid before the user's propted to enter a passwd at login.Warn : Contains the number of days the user is warn before the password expires.Inactive : Contains the number of inactive days allowed for that user before the user's account is locked.Expire : contains the date when the user account expires once exceeded. The user can no longer log in also it will display the message "Your password has been expired".
The NVRAM is also soldered to the main logic board or motherboard.
Answers:
It is a pluggable IC with yellow sticker on it, can be easily replaceble when it goes wrong.
What is the big difference between /dev/dsk and /dev/rdsk
Answers:
In Solaris whenever you create a new slice using format command a raw physical slice or a Raw Device will be created which is addressed as /dev/rdsk/c#d#s# where # is the number for slice.
After formatting it with newfs command the slice will be addressed as /dev/dsk/c#d#s# which can now be used for mounting.
eg. newfs /dev/rdsk/c0d0s4
mkdir /oracle
mount /dev/dsk/c0d0s4 /oracle
After mounting /dev/dsk/c#d#s# is called as Block Device
/dev actually contains logical device names which are links (Shortcuts in windows terminology) to actual physicaldevices in /devices directory.
How do you check the cron jobs of other users, (as a super user)
Answers:
The above would work. You could also run: crontab -l Username
________________________________________
#su - username
#crontab –l
How many different kill signals are there? 47
1. How do you find out what’s your shell? - echo $SHELL
2. What’s the command to find out today’s date? - date
3. What’s the command to find out users on the system? - who
4. How do you find out the current directory you’re in? - pwd
5. How do you remove a file? - rm
6. How do you remove a - rm -rf
7. How do you find out your own username? - whoami
8. How do you send a mail message to somebody? - mailsomebody@techinterviews.com -s ‘Your subject’ -c ‘cc@techinterviews.com‘
9. How do you count words, lines and characters in a file? - wc
10. How do you search for a string inside a given file? - grep string filename
11. How do you search for a string inside a directory? - grep string *
12. How do you search for a string in a directory with the subdirectories recursed? - grep -r string *
13. What are PIDs? - They are process IDs given to processes. A PID can vary from 0 to 65535.
14. How do you list currently running process? - ps
15. How do you stop a process? - kill pid
16. How do you find out about all running processes? - ps -ag
17. How do you stop all the processes, except the shell window? - kill 0
18. How do you fire a process in the background? - ./process-name &
19. How do you refer to the arguments passed to a shell script? - $1, $2 and so on. $0 is your script name.
20. What’s the conditional statement in shell scripting? - if {condition} then … fi
21. How do you do number comparison in shell scripts? - -eq, -ne, -lt, -le, -gt, -ge
22. How do you test for file properties in shell scripts? - -s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability
23. How do you do Boolean logic operators in shell scripting? - ! tests for logical not, -a tests for logical and, and -o tests for logical or.
24. How do you find out the number of arguments passed to the shell script? - $#
25. What’s a way to do multilevel if-else’s in shell scripting? - if {condition} then {statement} elif {condition} {statement} fi
26. How do you write a for loop in shell? - for {variable name} in {list} do {statement} done
27. How do you write a while loop in shell? - while {condition} do {statement} done
28. How does a case statement look in shell scripts? - case {variable} in {possible-value-1}) {statement};; {possible-value-2}) {statement};; esac
29. How do you read keyboard input in shell scripts? - read {variable-name}
30. How do you define a function in a shell script? - function-name() { #some code here return }
31. How does getopts command work? - The parameters to your script can be passed as -n 15 -x 20. Inside the script, you can iterate through the getopts array as while getopts n:x option, and the variable $option contains the value of the entered option.
General Questions
________________________________________
1.
Q:
What are Solaris Subscriptions?
A:
Solaris Subscriptions service plans cover enterprises running the Solaris OS on your choice of platform, including Sun SPARC and Sun or third-party x64/x86 hardware. They feature simple, per-system pricing based on the number of processor sockets in each system. Sun offers Solaris Subscriptions support at Basic, Standard, and Premium levels.
Back to Top
________________________________________
2.
Q:
What platforms are Solaris Subscriptions supported on?
A:
Solaris is supported on x64/x86 platforms, as well as SPARC. View a complete list of x64/x86 supported platforms.
Back to Top
________________________________________
3.
Q:
What patches/fixes/updates do you get with a Solaris Subscription support contract?
A:
With a Subscription, you get patches/fixes as they become available. Without a Subscription, you can only get all the patches/fixes when they are rolled into a complete OS release. Security and driver fixes are available to all.
Back to Top
________________________________________
4.
Q:
Will free Solaris usage licenses be available for previous versions of Solaris?
A:
No, free usage licenses begin with Solaris 10.
Back to Top
________________________________________
5.
Q:
What services does Sun offer to help customers migrate from a non-Sun OS or a previous version of Solaris to Solaris 10?
A:
Sun offers migration services to help customers migrate databases from competitors environments to the Solaris 10 OS. Sun also offers SunReady Assessments, Performance Tuning and Architecture Consulting to assess and prepare existing infrastructure.http://www.sun.com/service/solaris10/additionalservices.xml
Back to Top
________________________________________
6.
Q:
What is unique at the product level for free Solaris on the web compared to Solaris Under a Subscription?
A:
With a Subscription, you receive comprehensive technical phone support,(Standard and Premium plans) on demand updates and upgrades as they become available and access to web-based courses for Solaris 10. For free Solaris 10 without a Service Plan, you are not IP protected, nor will you have on demand access to updates. You must wait for the full next release of the OS.
Back to Top
________________________________________
7.
Q:
What is required to purchase a Solaris Subscription?
A:
You must purchase the correct Solaris Subscription offering for the version of OS you are running. There are unique part numbers for each version of Solaris that Sun supports. You will also be required to provide the hardware serial number of the system for which will be covered with Solaris support. Each system using Solaris requires its own support contract.
Back to Top
________________________________________
8.
Q:
Will a Solaris 10 usage license be associated with a physical system or be freestanding?
A:
Freestanding, but subscriptions are associated with a physical system and is priced on a per-system basis.
Back to Top
________________________________________
9.
Q:
If you download Solaris 10, but do not purchase a Solaris Subscription, what can you receive?
A:
You can download future full Solaris releases and obtain security fixes, but you are not entitled to any support, or patches released in between the release cycle. With a Solaris Subscription, Sun provides limited indemnification for third-party IP infringement claims related to the Solaris 10 OS, to help protect you from legal risks.
Back to Top
________________________________________
10.
Q:
How do Solaris Subscriptions differ from Solaris support in SunSpectrum System Plans?
A:
No difference. Solaris Subscription deliverables are part of SunSpectrum support contracts.
Back to Top
________________________________________
11.
Q:
What Solaris versions are covered by Solaris Subscriptions?
A:
Solaris Subscriptions cover all commercially available Solaris versions. Customers with support contracts on earlier versions of Solaris are rolled over at renewal time into Solaris version specific offerings. Sun offers unique part numbers for each version of the OS Sun offers support for.
Back to Top
________________________________________
12.
Q:
Does the price of a Solaris Subscription change with versions of the OS?
A:
Sun reserves the right to change the price of a Solaris Subscription at any time, depending on market conditions and other factors. Price changes, if any, do not impact customers with existing and active support contracts. Additionally, once a product version reaches its End-Of-Life (EOL), the price of post-EOL product support can be higher. View details on the Solaris life cycle and eol/eosl time lines.
Back to Top
________________________________________
13.
Q:
What is the difference between software updates and upgrades?
A:
Software updates are releases that include software updates (security fixes, recommended updates & non-critical updates), new platform support and limited new features (feature updates). Upgrades are major releases providing significant new features and might include major internal code changes (note the Solaris Application Guarantee – stable ABI).
Back to Top
________________________________________
14.
Q:
How do you order Solaris Subscriptions?
A:
You can order support through your Sun sales representative or you can choose whichSolaris Subscription best meets your needs and then buy online.
Back to Top
________________________________________
15.
Q:
What educational benefits do I get with Solaris Subscription?
A:
Your Solaris Subscription entitles you to certain educational online courses to help you get up to speed on Solaris 10 and keep your skills honed over time.
The Sun Solaris 10 learning modules are designed to introduce the fundamentals of using one of the most powerful operating systems on the planet, Solaris 10. Some of these modules introduce the Solaris 10 desktop system, file system, and shell. In addition, there is coverage of file archives and transfers between remote hosts. The System Boot procedures course explains how run levels, the boot process, and shutdown works in x86 and AMD 64-based systems. In addition to these modules and others, you are offered a Skill Assessment to test your knowledge on Solaris 10.
Back to Top
________________________________________
16.
Q:
How can I determine if Solaris 10 is supported on my computer?
A:
Visit BigAdmin to determine if Solaris 10 is supported on your computer.
Back to Top
________________________________________
17.
Q:
I have just purchased a Solaris Subscriptions, how can get patches and updates?
A:
If you don’t already have one, you need to first create a Sun Online Account and accept the click through license agreement. This will give you access to NO COST patches designated as security patches and device drivers by Sun. To also get access to all Solaris Software Updates (patches) you need to also associate your subscription contract with Sun Online account. Go to: http://sunsolve.sun.com/pub-cgi/show.pl?target=home
Back to Top
________________________________________
18.
Q:
What is SunSolve?
A:
SunSolve is a proprietary online database of software patches, patch information, tools, technical articles and troubleshooting documents. It is an extremely valuable resource for supporting Sun hardware and software products. The SunSolve database is owned, developed and controlled by Sun Microsystems and is continuously updated based on knowledge and experience from support and engineering personnel and real-time production systems. The SunSolve database contains Solaris OS patches as well as information to help analyze and administer patches, and also to troubleshoot and support OS-related issues that may arise in production environments.
http://sunsolve.sun.com/
Back to Top
________________________________________
19.
Q:
I have multiple systems running Solaris, how many subscriptions do I need?
A:
A separate Sun support contract is required for every system to which you apply Software Updates (with the limited exception of Security Patches and Device Drivers). You must have either a Sun System Service Plan or a Solaris Subscription in place for each system or an Enterprise Service site-wide support contract that covers all your systems with hardware and OS coverage.
Back to Top
________________________________________
20.
Q:
I have tried to access patches on SunSolve and I have been told that I require a Sun Service Plan?
A:
Sun Service Plan is not required for accessing NO COST patches designated as Security Patches and Device Drivers by Sun; however, you do need to have a Sun Online account and accept the Software License Agreement applicable to all Sun patches to have access to such patches.
Back to Top
________________________________________
21.
Q:
Does Sun offer Solaris Developer support?
A:
Developer support options are available for code support, programming and technical assistance. Recognized industry-wide, Sun offers developer training and certification coursesfor Solaris, Java, and Web 2.0 developers. more info:
http://developers.sun.com/solaris/
Back to Top
________________________________________
22.
Q:
Is support available for OpenSolaris?
A:
Yes, there are many ways to receive support for OpenSolaris:
a) If you are a SunSpectrum System Plan Customer, OpenSolaris support is included with your System Service Plan if you choose to replace your OS with OpenSolaris. You are not entitled to run both Solaris and OpenSolaris and receive support for both. Its one or the other.
b) If you have a Solaris Subscription, OpenSolaris support is also included with your Solaris Subscription if you choose to replace your OS with OpenSolaris. You are not entitled to run both Solaris and OpenSolaris and receive support for both. Its one or the other. You will be required to renew your subscription with the OS you are using at time of renewal.
c) Solaris Everywhere and Enterprise site wide support contracts include support for both Solaris and OpenSolaris at the same level of support. Or you may purchase one of the threeOpenSolaris Subscription Service Plans
Veritas:
Disks
Disks are referred in volume manager by two terms - device name and disk name . The device name specifies controller , target id and slice of the disk . Disk name is the common name given to the device name as an easy to remember name .
For example device name c2t3d0s2 represents controller number 2 , target id 3 , disk group 0 and slice 2 and disk01 may be its disk name . While device name is system dependent based on controller and disk id the disk name is user defined .
Disk groups :
• A disk group is a collection of volume manager disks grouped together to hold the data . All the configuration changes made to a disk group are applied to the disks in that disk group only.
• Volume Manager objects cannot span disk groups i.e. all the operations on a particular disk group remains confined to that particular group .
• Disk groups enable high availability as these can be shared by two or more hosts but can be accessed by only one host at a time. In two hosts and a shared storage situation one host can take over the ownership of the disk groups and drives in case other host fails.
Volume Manager disks
• Adding physical disks to the volume manager results in creation of public and private region in the disk by the volume manager .The public region is the disk space available for volume space and the private region stores the configuration information.
• A Volume Manager disks are created from the public region of a physical disk that is under Volume Manager control. Each volume manager disk corresponds to one physical disk.
• A volume manager disk is given a disk media name when it is added to a disk group which can be default or unique user defined..
• Once a volume manager disk is assigned a disk media name, the disk is no longer referred to by its physical address of c#t#d#. The physical address of c#t#d# becomes known as the disk access record.
Subdisks
• A subdisk is a subsection of a disk's public region and is the smallest unit of storage in Volume Manager.
• A subdisk is defined by an offset and a length in sectors on a volume manager disk.
• A volume manager disk can contain multiple subdisks but subdisks cannot overlap or share the same portions of a volume manager disk.
• volume manager disk space that is not reserved or that is not part of a subdisk is free space. You can use free space to create new subdisks.
A subdisk is similar to a partition but with following differences :
• The maximum number of partitions to a disk is eight.
• There is no theoretical limit to number of subdisks that can be attached to a single plex, but it has been limited to a default value of 4096. If required, this default can be changed, using the vol_subdisk_num tunable parameter.
Plexes
• A plex is a structured or ordered collection of subdisks that represents one copy of the data in a volume. A plexconsists of one or more subdisks located on one or more physical disks.
• A plex is also called a mirror. The terms plex and mirror can be used interchangeably, even though a plex is only one copy of the data. The terms "mirrored" or "mirroring" imply two or more copies of data.
• The length of a plex is determined by the last block that can be read or written on the last subdisk in the plex.
• The default naming convention for plexes in a volume is volumename-##. The default plex name consists of the volume name, a hyphen, and a two-digit number
Volumes
• A volume is composed of one or more plexes not restricted by the physical size of the disk.
• A volume can span across multiple disks.
• Volume Manager uses the default naming convention vol## for volumes, where ## represents a two-digit number but can be user defined as per requirement.
Volume Manager Objects and Their Relationship
2.0 Volume Manager Configuration
Volume configuration consists of adding two or more disks to form disk group and create volume/s from this disk group. File system can be created on these volumes or these can be accessed as raw devices for some database applications. First step in volume manager configuration consists of adding and initializing disks under volume manager which creates a public region which is bulk of disk space available for volume space .Private region which is generally of a few megabytes stores the disk configuration information .
Most of the volume manager operation related to disks & volume can be performed by a character based menu utility call vxdiskadm
Following paragraphs describes the use of vxddiskadm to configure and manage volume manager.
#vxdiskadm
Typing vxdiskadm brings up a menu based utility (text) . The options , their explanation and screen shots are given below .Most of the options need a disk name , device name or disk group name and you can have this information by typing list in the vxdiskadm menu .The list menu option is used to display a list of disks attached to your system. This also lists removed or failed disks. Most useful to get a quick view of all disks or list details of a single disk - its name , volume association and status.
A disk needs to be formatted in order to be included in volume manager . volume manager will report unformatted disk as invalid and a will only recognize after formatting
By default all the available disks in the system are considered for inclusion as volume manager disk however to exclude certain disks, list the names of the disks to be excluded in the file /etc/vx/disks.exclude before the initialization or encapsulation. Similarly, you can exclude all disks on specific controllers from initialization or encapsulation by listing those controllers in the file /etc/vx/cntrls.exclude.
? & ?? options provide help about the menu item and menu system.
#vxdiskadm
Volume Manager Support Operations
Menu: VolumeManager/Disk
1 Add or initialize one or more disks
2 Encapsulate one or more disks
3 Remove a disk
4 Remove a disk for replacement
5 Replace a failed or removed disk
6 Mirror volumes on a disk
7 Move volumes from a disk
8 Enable access to (import) a disk group
9 Remove access to (deport) a disk group
10 Enable (online) a disk device
11 Disable (offline) a disk device
12 Mark a disk as a spare for a disk group
13 Turn off the spare flag on a disk
list List disk information
? Display help about menu
?? Display help about the menuing system
q Exit from menus
Select an operation to perform
2.1 Add or initialize one or more disks
The formatted disks can be added or initialized with volume manager . Disk groups needs to be given for making a new group or adding disks in existing group. Default disk group is rootdg and if none is specified the disks are added to volume manager and are kept as hot spares which can be used in place of a failed disk.
Select 1 (Add or initialize one or more disks) from the vxdiskadm main menu.
Add or initialize disks
Menu: VolumeManager/Disk/AddDisks
Use this operation to add one or more disks to a disk group. You can add the selected disks to an existing disk group or to a new disk group that will be created as a part of the operation. The selected disks may also be added to a disk group as spares. The selected disks may also be initialized without adding them to a disk group leaving the disks available for use as replacement disks.
More than one disk or pattern may be entered at the prompt. Here are some disk selection examples:
all: all disks
c3 c4t2: all disks on both controller 3 and controller 4,target 2
c3t4d0: a single disk
Select disk devices to add:
[
list at the prompt displays a list of the disks available to the system, followed by a prompt at which you should type the device name of the disk to be added:
DEVICE DISK GROUP STATUS
c0t0d0 disk01 rootdg online
c0t1d0 disk02 rootdg online
c0t2d0 disk03 rootdg online
c0t3d0 - - online
c1t0d0 disk10 rootdg online
c1t0d1 - - error
.
.
.
c3t0d0 - - error
c3t1d0 disk33 rootdg online
c3t2d0 disk34 rootdg online
c3t3d0 disk35 rootdg online
Select disk devices to add:
[
All disks attached to the system are recognized by the Volume Manager and displayed here.. Error status indicates disks not recognized by volume manager as part of volume manager and can be used to add in the volume manager .. Disks with a name , group and online status are present in volume manager in a valid volume manager disk group .One or more disks separated by space can be selected for adding into volume manager.
Here is the disk selected. Output format: [Device_Name]
c1t2d0
Continue operation? [y,n,q,?] (default: y) 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 [
Use a default disk name for the disk? [y,n,q,?] (default: y)
Add disk as a spare disk for rootdg? [y,n,q,?] (default: n) n
The selected disks will be added to the disk group rootdg with
default disk names.
c1t2d0
Continue with operation? [y,n,q,?] (default: y) 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]
c1t2d0
Encapsulate this device? [y,n,q,?] (default: y) n
c1t2d0
Instead of encapsulating, initialize? [y,n,q,?] (default: n) y
Initializing device c1t2d0.
Adding disk device c1t2d0 to disk group rootdg with disk
name disk39.
Add or initialize other disks? [y,n,q,?] (default: n)
2.2 Encapsulate one or more disks
This is used to bring the disk under volume manager , which are already present in the system with data but without volume manager . Data on these disks are not disturbed and if these disks meets certain volume manager requirements these are added under volume manager.
System needs rebooting if encapsulation is used for disk with mounted filesystem or running applications . Also the old device names needs to be changed in applications/scripts to reflect the new volume name.
vfstab information is updated automatically but it is worthwhile to check vfstab if changes are proper as any discrepancy in vfstab may cause system boot failure on next reboot.
Encapsulation preserves any existing data on the disk when the disk is placed under volume manager control. To reduce the
chance of encapsulation failure, make sure that the disk meets the following requirements:-
• It has a small amount of free space (at the beginning or end of the disk) that does not belong to any partition
• It has two free partitions
• It has an s2 slice that represents the whole disk
One of the most common application is encapsulation of root disk to bring it under volume manager and then mirror it to have an alternate boot disk .
The EEPROM variable use-nvramrc? must be set to true and an alternate boot disk alias name needs to be defined to access the second boot disk by an alternate alias name in case primary disk fails.
ok>eeprom use-nvramrc?=true
Procedure for encapsulating a disk for volume manager use is as follows:
Select menu item 2 (Encapsulate one or more disks) from the vxdiskadm main menu and follow the prompts :-
Encapsulate one or more disks
Menu: VolumeManager/Disk/Encapsulate
Use this operation to convert one or more disks to use the Volume Manager.
This adds the disks to a disk group and replaces existing
partitions
with volumes. Disk encapsulation requires a reboot for the
changes to take effect.
More than one disk or pattern may be entered at the prompt. Here
are some disk selection examples:
all: all disks
c3 c4t2: all disks on both controller 3 and controller 4, target 2
c3t4d0: a single disk
Select disk devices to encapsulate:
[
Here is the disk selected. Output format: [Device_Name]
c2t5d0
Continue operation? [y,n,q,?] (default: y) y
You can choose to add this disk to an existing disk group or to
a new disk group. To create a new disk group, select a disk group name that does not yet exist.
Which disk group [
Use a default disk name for the disk? [y,n,q,?] (default: y)
The selected disks will be encapsulated and added to the rootdg
disk group with default disk names.
c2t5d0
Continue with operation? [y,n,q,?] (default: y) y
The following disk has been selected for encapsulation. Output format:
[Device_Name]
c2t5d0
Continue with encapsulation? [y,n,q,?] (default: y) y
The disk device c2t5d0 will be encapsulated and added to the disk
group rootdg with the disk name disk01.
The c2t5d0 disk has been configured for encapsulation.
The first stage of encapsulation has completed successfully. You
should now reboot your system at the earliest possible opportunity.
The encapsulation will require two or three reboots which will happen automatically after the next reboot. To reboot execute the command:
shutdown -g0 -y -i6
This will update the /etc/vfstab file so that volume devices are
used to mount the file systems on this disk device. You will need to update any other references such as backup scripts, databases,
or manually created swap devices.
Encapsulate other disks? [y,n,q,?] (default: n) n
The disk device c2t5d0 will be encapsulated and added to the disk group rootdg with the disk name disk01.
The encapsulation operation failed with the following error:
It is not possible to encapsulate c2t5d0, for the following reason:
Hit RETURN to continue.
Encapsulation may fail if there is not enough free space available on the disk to accommodate volume manager. If this happens, the procedure above will end abruptly with an error message as above .
2.3 Remove a disk
This option is used to remove a disk from a disk group provided there is no active volume using this disk .. If there are some volumes using the disk the those have to be either moved to some other disk or removed if they are no longer needed.
However since a diskgroup must have at least one disk you can not remove all the disks from a disk group . To remove all disks from a diskgroup you have to disable the volume group with the exception of rootdg disk group which can not be disabled .
Select menu item 3 (Remove a disk) from the vxdiskadm main menu.
Remove a disk
Menu: VolumeManager/Disk/RemoveDisk
Use this operation to remove a disk from a disk group. This
operation takes, as input, a disk name. This is the same name
that you gave to the disk when you added the disk to the disk
group.
Enter disk name [
Requested operation is to remove disk disk01 from group rootdg.
Continue with operation? [y,n,q,?] (default: y)
Removal of disk disk01 is complete.
Remove another disk? [y,n,q,?] (default: n)
2.4 Remove a disk for replacement
This option is used for removing the disk but retaining the name of the disk so that it can be used by the newly replaced disk . The replacement disk can be a newly added disk or already available disk in the other disk groups
Select menu item 4 (Remove a disk for replacement) from the vxdiskadm main menu.
Remove a disk for replacement
Menu: VolumeManager/Disk/RemoveForReplace
Use this menu operation to remove a physical disk from a disk
group, while retaining the disk name. This changes the state
for the disk name to a removed disk. If there are any
initialized disks that are not part of a disk group, you will be
given the option of using one of these disks as a replacement.
Enter disk name [
Additional screens display if there are volumes associated with the disk you want to remove. You have to decide if data is needed or not needed and answer the prompts as asked .
The following devices are available as replacements:
c1t1d0
You can choose one of these disks now, to replace disk02.
Select "none" if you do not wish to select a replacement disk.
Choose a device, or select "none"
[
Requested operation is to remove disk disk02 from group rootdg.
The removed disk will be replaced with disk device c1t1d0.
Continue with operation? [y,n,q,?] (default: y)
Removal of disk disk02 completed successfully.
Proceeding to replace disk02 with device c1t1d0.
Disk replacement completed successfully.
Remove another disk? [y,n,q,?] (default: n)
2.5 Replace a failed or removed disk
This option is used to replace a failed or removed disk . The new disk can be initialized or non initialized as this option does initialization .
Select menu item 5 (Replace a failed or removed disk) from the vxdiskadm main menu.
Replace a failed or removed disk
Menu: VolumeManager/Disk/ReplaceDisk
Use this menu operation to specify a replacement disk for a disk
that you removed with the "Remove a disk for replacement" menu
operation, or that failed during use. You will be prompted for
a disk name to replace and a disk device to use as a replacement.
You can choose an uninitialized disk, in which case the disk will
be initialized, or you can choose a disk that you have already
initialized using the Add or initialize a disk menu operation.
Select a removed or failed disk [
The following devices are available as replacements:
c1t0d0s2 c1t1d0s2
You can choose one of these disks to replace disk02.
Choose "none" to initialize another disk to replace disk02.
Choose a device, or select "none"
[
The requested operation is to use the initialized device c1t0d0s2
to replace the removed or failed disk disk02 in disk group rootdg.
Continue with operation? [y,n,q,?] (default: y)
Replacement of disk disk02 in group rootdg with disk device
c1t0d0s2 completed successfully.
2.6 Mirror volumes on a disk
volumes can be mirrored to another disk with available space however it can not be used to mirror existing mirrors or mirrors spanning more than one sub disk .
To mirror volumes on a disk, make sure that the target disk has an equal or greater amount of space as the originating disk and then do the following
Select menu item 6 (Mirror volumes on a disk) from the vxdiskadm main menu.
Mirror volumes on a disk
Menu: VolumeManager/Disk/Mirror
This operation can be used to mirror volumes on a disk. These
volumes can be mirrored onto another disk or onto any
available disk space. Volumes will not be mirrored if they are
already mirrored. Also, volumes that are comprised of more than
one subdisk will not be mirrored.
Mirroring volumes from the boot disk will produce a disk that can
be used as an alternate boot disk.
Enter disk name [
You can choose to mirror volumes from disk disk02 onto any
available disk space, or you can choose to mirror onto a specific
disk. To mirror to a specific disk, select the name of that disk.
To mirror to any available disk space, select "any".
Enter destination disk [
Note - Be sure to always specify the destination disk when you are creating an alternate root disk. Otherwise, the volume manager will select space available in the disk group which might span disk and will result in boot failure from this disk.
2.7 Move volumes from a disk
This option is used in case the disk is to be replaced or removed and has active volumes on the disk. . Also volumes can be moved to different disk groups for better space , performance etc.
Select menu item 7 (Move volumes from a disk) from the from the from the from the vxdiskadm main menu.
Move volumes from a disk
Menu: VolumeManager/Disk/Evacuate
Use this menu operation to move any volumes that are using a
disk onto other disks. Use this menu immediately prior to
removing a disk, either permanently or for replacement. You can
specify a list of disks to move volumes onto, or you can move the
volumes to any available disk space in the same disk group.
NOTE: Simply moving volumes off of a disk, without also removing
the disk, does not prevent volumes from being moved onto
the disk by future operations. For example, using two
consecutive move operations may move volumes from the
second disk to the first.
Enter disk name [
You can now specify a list of disks to move onto. Specify a list
of disk media names (e.g., disk01) all on one line separated by
blanks. If you do not enter any disk media names, then the
volumes will be moved to any available space in the disk group.
Requested operation is to move all volumes from disk disk01 in
group rootdg.
NOTE: This operation can take a long time to complete.
Continue with operation? [y,n,q,?] (default: y)
Move volume vol3 ...
Move volume vol3-bk00 ...
Evacuation of disk disk01 is complete.
Move volumes from another disk? [y,n,q,?] (default: n)
2.8 Enable access to (import) a disk group
Used in enabling ownership of the other system to a disk group which has been deported by the other system. Used in failover configurations where the ownership of a shared disk/disk group is transferred to the other system in case of failure of current system.
Select menu item 8(Enable access to (import) a disk group) from the vxdiskadm main menu.
Enable access to (import) a disk group
Menu: VolumeManager/Disk/EnableDiskGroup
Use this operation to enable access to a disk group. This can be
used as the final part of moving a disk group from one system to
another. The first part of moving a disk group is to use the
"Remove access to (deport) a disk group" operation on the
original host.
A disk group can be imported from another host that failed without
first deporting the disk group. Be sure that all disks in the disk
group are moved between hosts.
If two hosts share a SCSI bus, be very careful to ensure that the
other host really has failed or has deported the disk group. If
two active hosts import a disk group at the same time, the disk
group will be corrupted and will become unusable.
Select disk group to import [
newdg
The import of newdg was successful.
Select another disk group? [y,n,q,?] (default: n)
2.9 Disable access to (deport) a disk group
Disk group is deported if disks groups ownership needs to be transferred to another system or all the disks in a disk groups needs to be freed from group. Disks in a disk groups to be deported should not be active.
Select menu item 9 (Remove access to (deport) a disk group) from the vxdiskadm main menu.
Remove access to (deport) a disk group
Menu: VolumeManager/Disk/DeportDiskGroup
Use this menu operation to remove access to a disk group that is
currently enabled (imported) by this system. Deport a disk
group if you intend to move the disks in a disk group to another
system. Also, deport a disk group if you want to use all of the
disks remaining in a disk group for some new purpose.
You will be prompted for the name of a disk group. You will also
be asked if the disks should be disabled (offlined). For
removable disk devices on some systems, it is important to
disable all access to the disk before removing the disk.
Enter name of disk group [
The requested operation is to disable access to the removable
disk group named newdg. This disk group is stored on the
following disks:
newdg01 on device c1t1d0s2
You can choose to disable access to (also known as "offline")
these disks. This may be necessary to prevent errors if
you actually remove any of the disks from the system.
Disable (offline) the indicated disks? [y,n,q,?] (default: n)
Continue with operation? [y,n,q,?] (default: y)
Removal of disk group newdg was successful.
Disable another disk group? [y,n,q,?] (default: n)
2.10 Enable (online) a disk device
Disks which are turned offline by volume manager , or which are to be imported can be enabled by this option. This operation causes disks to be scanned and find out the disk belonging to a disk group.
Select menu item 10 (Enable (online) a disk device) from the vxdiskadm main menu.
Enable (online) a disk device
Menu: VolumeManager/Disk/OnlineDisk
Use this operation to enable access to a disk that was disabled
with the "Disable (offline) a disk device" operation.
You can also use this operation to re-scan a disk that may have
been changed outside of the Volume Manager. For example, if a disk
is shared between two systems, the Volume Manager running on the
other system may have changed the disk. If so, you can use this
operation to re-scan the disk.
NOTE: Many vxdiskadm operations re-scan disks without user
intervention. This will eliminate most needs to online a
disk directly, except when the disk is directly offlined.
Select a disk device to enable [,list,q,?] c1t1d0
Enable another device? [y,n,q,?] (default: n)
2.11 Disable (offline) a disk device
This option disables all access to a disk which is not part of any disk group . This is used to remove disk from volume group. Some systems do not support disks that can be removed from a system during normal operation. On such systems, the offline operation is not very useful.
Select menu item 11 (Disable (offline) a disk device) from the vxdiskadm main menu.
Disable (offline) a disk device
Menu: VolumeManager/Disk/OfflineDisk
Use this menu operation to disable all access to a disk device
by the Volume Manager. This operation can be applied only to
disks that are not currently in a disk group. Use this operation
if you intend to remove a disk from a system without rebooting.
NOTE: Many systems do not support disks that can be removed from
a system during normal operation. On such systems, the
offline operation is seldom useful.
Select a disk device to disable [,list,q,?] c1t1d0
Disable another device? [y,n,q,?] (default: n)
2.12 Mark a disk as a spare for a disk group
This is used to reserve the disk as an automatic replacement disk ( hot-relocation) in case of another disk in the disk group fails. Hot-relocation relocates redundant subdisks to other disks and restores the affected volume manager objects and data. If a disk has already been designated as a spare in the disk group, the subdisks from the failed disk are relocated to the spare disk. Otherwise, any suitable free space in the disk group is used.
Select menu item 12 (Mark a disk as a spare for a disk group) from the vxdiskadm main menu.
Mark a disk as a spare for a disk group
Menu: VolumeManager/Disk/MarkSpareDisk
Use this operation to mark a disk as a spare for a disk group.
This operation takes, as input, a disk name. This is the same name
that you gave to the disk when you added the disk to the disk group.
Enter disk name [
Marking of disk01 in rootdg as a spare disk is complete.
Mark another disk as a spare? [y,n,q,?] (default: n)
Any VM disk in this disk group can now use this disk as a spare in the event of a failure. If a disk fails, hot-relocation should automatically occur .The failed disk needs to be replaced.
2.13 Turn off the spare flag on a disk
This is used to remove a VM Disk From the Hot-Relocation Pool & free hot-relocation spare disks for use as regular volume manager disks While a disk is designated as a spare, the space on that disk is not used as free space for the creation of volume manager objects within its disk group and this option makes this space available.
Select menu item 13 (Turn off the spare flag on a disk) from the vxdiskadm main menu.
Turn off the spare flag on a disk
Menu: VolumeManager/Disk/UnmarkSpareDisk
Use this operation to turn off the spare flag on a disk.
This operation takes, as input, a disk name. This is the same
name that you gave to the disk when you added the disk to the
disk group.
Enter disk name [
Disk disk01 in rootdg no longer marked as a spare disk.
Turn-off spare flag on another disk? [y,n,q,?] (default: n)
After using the vxdiskadm for configuring disks and diskgroups next step is to configure volumes and then use them for storage operations . The second part of this article discusses this aspect of volume manager .
----
Note that the first 28 questions have answers related to using the command line. Sun do not normally support this method of bottom up creation of volumes. An explanation of why can be seen in Q97. The questions are designed to give you an idea of what goes on in the background. However, if at all possible, use the GUI.
----
1. How do I create a disk group ?
2. How do I create a a subdisk ?
3. How do I split a subdisk into 2 or more subdisks ?
4. How do I create a concat plex from two subdisks ?
5. How do I create a volume from a plex ?
6. What this volume looks like from a vxprint -Ath output
7. How do I start this volume ?
8. What this volume looks like from a vxprint -Ath output
9. How do I make this a mirrored volume ?
10. What this volume looks like from a vxprint -Ath output during mirror sync ?
11. What this volume looks like from a vxprint -Ath output after mirror ?
12. How do I blow away a mirrored volume ?
13. How do I blow away the subdisks ?
14. How do I attaching a plex to another plex in a volume ?
15. What this volume looks like from a vxprint -Ath output during attach ?
16. What does this volume look like from a vxprint -Ath output after attach ?
17. How do I detach a plex from a volume ?
18. What does this volume look like from a vxprint -Ath output after attach ?
19. How do I disassociate a plex from a volume ?
20. How do I add a disk into my disk group ?
21. How do I create a RAID5 volume ?
22. How does the vxprint -Ath for a RAID 5 volume look during the build ?
23. How does the vxprint -Ath for a RAID 5 volume look after the build ?
24. How do I get information about a RAID5 volume ?
25. How do I build a hot-spare ?
26. How does a hot spare look in vxprint -Ath
27. How do I make this volume a filesystem and mount it ?
28. How does a RAID 5 volume look if we loose a sub-disk ?
----
29. How can I tell if a disk has been hot spared ?
30. How do I redirect mail to be sent to another user instead of root in the event of a failure & hot spare replacement ?
31. How do I force a disk back into it's original configuration after it has been hot-spared ?
32. How do I make Volume Manager see newly added disks ?
33. How to determine unused space in a diskgroup config ?
34. How do I list all the subdisks in my volume ?
35. How can I find out which physical disks are in a disk group ?
36. How can I change the name of a VM disk ?
37. How do I move all the subdisks from one physical disk to another disk ?
38. Is it safe to use vxevac on a live system ?
39. Can I use a hot-spare across multiple disk groups ?
40. How does Dirty Region Logging (DRL) work ?
41. Early Notifier Alert RAID-5
42. Hot reloction VS hot sparing
43. How can I manually failover a diskgroup in an SSA ?
44. How can I grow the private region of a disk group ?
45. Where can I get the latest SSA Matrix - (Patches & Compatibility) ?
46. Where can I get Demo License for VxVM (2.6) ?
47. How can I create a small rootdg without encapsulating a disk ?
48. What should I consider when configuring swap ?
49. How can I stop volume creation ?
50. How can I recover a failing disk - FAILING ?
51. How do I move disks from one disk group to another ?
52. How do I return to underlying devices ?
53. How could I backup and restore private regions ?
54. How can I add more swap from another disk under Veritas ?
55. How can I setup an alternate dump device (rcS.d/S35newdumpdevice) ?
56. Official SSA/A5000 Software/Firmware Configuration Matrix
57. Veritas On-Line Storage Manager (www.veritas.com)
58. Download Veritas Software
59. Veritas Utilities and Scripts (Unsupported)
60. What can the vxprivutil command be used for ?
61. How can I clear the message 'volume ? is locked by another utility' ?
62. How can I clear subdisks which are in IOFAIL state ?
63. How do I upgrade to Solaris 2.5 & VM 2.1.1 ?
64. How does a hotspare know when to kick in ?
65. How do I encapsulate the boot disk ?
66. How can I clone a Sparc Storage Array which is under Veritas control ?
67. How to import rootdg from another host ?
68. How do I increase the size of a striped mirrored volume ?
69. How do I boot from a SSA ?
70. How can I set the ownership of a volume ?
71. How do I change the WWN of a Sparc Storage Array ?
72. When I try to encapsulate the boot disk I get the errornot enough free partitions. Why ?
73. I want to move a Volume out of one dg into another, all the disks in the original dg are part of the Volume. How do I do it ?
74. How do I import diskgroup's on dual ported SSA's ?
75. How do I Start/Stop a disk tray on a SSA ?
76. How do I get a plex out of being in a stale state ?
77. How do I change the hostname info on the private regions ?
78. Can I encapsulate a disk that has no free space for a private region ?
79. How can I get iostat to report the disks as c#t#d# instead of sd# ??
80. How can I get round the errorvolume locked by another utility when trying to detach a plex ?
81. Veritas Volume Manager Disaster Recovery Guide
82. Can I use prestoserve with the SSA ??
83. Can I grow the root filesystem online ??
84. Can I change the hostname of a machine without affecting Volume Manager ??
85. Can I move some Volumes from one dg to another ??
86. Can I test the SOC from the ok prompt ??
87. Can I restore the rootdisk from backup ??
88. Can I make my SparcStation to wait for the SSA to spin up ??
89. Can I move a SSA to a new system and save the data on it ??
90. Can I have a rootdg, without encapsulating a disk ??
91. Can I Increase the Size of the private region, because when I try and add a volume to a dg I getvxvm:vxassist: ERROR: No more space in disk group configuration
92. Cannot import Diskgroup - "No configuration copies"
93. My volume is ENABLED/SYNC but doesn't appear to be a syncing process running (i.e. vxrecover). What do I do ?
94. How can I view the contents of my Private Region ?
95. I need to change the hostname in my Private Regions and my /etc/vx/volboot file. How do I do it ?
96. Veritas has changed my VTOC layout when it encapsulated my rootdisk. How do I recover my original VTOC?
97. My volume won't start. I think it may be due to my volume not on a cylinder boundary. How can I determine if this is true ?
98. Why can't I simply mirror back my seconday rootdisk mirror to my primary rootdisk mirror if my primary disk fails ?
99. How can I make hot-relocation use ONLY spare disks ?
100. How do I enable debug mode on vxconfigd ?
101. How do I disable DMP, dynamic multi-pathing ?
102. How do I take a disk out from under Veritas control ?
103. Volume Manager has relayed out my VTOC after encapsulation. I now need to get back my original VTOC but there is no original in /etc/vx/reconfig.d/disk.d/vtoc. How can I get back my /opt filesystem ?
104. What are the different status codes in a 'vxdisk list' output ?
105. How do I delete a disk from a disk group ?
106. How can I fix "vxvm: WARNING: No suitable partition from swapvol to set as the dump device." ?
107. After an A5000 disk failure, I lost my rootdg and now I getvxvm:vxdisk: ERROR: Cannot get records from vxconfigd: Record not in disk groupwhen I runvxdisk listandvxvm:vxdctl: ERROR: enable failed: System error occurred in the clientwhen I runvxdctl enable. How can I fix it ?
108. After some A5000/Photon loop offline/onlines, my volume now has one plex in STALE state and the other in IOFAIL. How can I fix this ?
109. Is there any VxVM limitation on the number of volumes which can be created on a system ?
110. Configuration copies explained
----1. How do I create a disk group ?
/usr/sbin/vxdg init
2. How do I create a a subdisk ?
/usr/sbin/vxmake -g
3. How do I split a subdisk into 2 or more subdisks ?
/usr/sbin/vxsd -g
4. How do I create a concat plex from two subdisks ?
/usr/sbin/vxmake -g
5. How do I create a volume from a plex ?
/usr/sbin/vxmake -U fsgen -g
6. What this volume looks like from a vxprint -Ath output
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen DISABLED CLEAN 4305279 SELECT -
pl pl-01 vol01 DISABLED CLEAN 4305279 CONCAT - RW
sd disk01-01 pl-01 disk01 0 4152639 0 c1t5d0 ENA
sd disk02-01 pl-01 disk02 0 152640 4152639 c1t3d0 ENA
7. How do I start this volume ?
/usr/sbin/vxvol -g
8. What this volume looks like from a vxprint -Ath output
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen ENABLED ACTIVE 4305279 SELECT -
pl pl-01 vol01 ENABLED ACTIVE 4305279 CONCAT - RW
sd disk01-01 pl-01 disk01 0 4152639 0 c1t5d0 ENA
sd disk02-01 pl-01 disk02 0 152640 4152639 c1t3d0 ENA
9. How do I make this a mirrored volume ?
/usr/sbin/vxassist -g
10. What this volume looks like from a vxprint -Ath output during mirror sync ?
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen ENABLED ACTIVE 4305279 SELECT -
pl vol01-01 vol01 ENABLED TEMPRMSD 4306160 CONCAT - WO
sd disk04-01 vol01-01 disk04 0 153520 0 c1t1d0 ENA
sd disk03-01 vol01-01 disk03 0 4152640 153520 c1t4d0 ENA
pl pl-01 vol01 ENABLED ACTIVE 4305279 CONCAT - RW
sd disk01-01 pl-01 disk01 0 4152639 0 c1t5d0 ENA
sd disk02-01 pl-01 disk02 0 152640 4152639 c1t3d0 ENA
11. What this volume looks like from a vxprint -Ath output after mirror ?
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen ENABLED ACTIVE 4305279 SELECT -
pl vol01-01 vol01 ENABLED ACTIVE 4306160 CONCAT - RW
sd disk04-01 vol01-01 disk04 0 153520 0 c1t1d0 ENA
sd disk03-01 vol01-01 disk03 0 4152640 153520 c1t4d0 ENA
pl pl-01 vol01 ENABLED ACTIVE 4305279 CONCAT - RW
sd disk01-01 pl-01 disk01 0 4152639 0 c1t5d0 ENA
sd disk02-01 pl-01 disk02 0 152640 4152639 c1t3d0 ENA
12. How do I blow away a mirrored volume ?
/usr/sbin/vxedit -g
13. How do I blow away the subdisks ?
/usr/sbin/vxedit -g
14. How do I attaching a plex to another plex in a volume ?
/usr/sbin/vxplex -g
15. What this volume looks like from a vxprint -Ath output during attach ?
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen ENABLED ACTIVE 2000000 SELECT -
pl Cor-Plex vol01 ENABLED ACTIVE 2000000 CONCAT - RW
sd disk-01 Cor-Plex disk01 0 1000000 0 c1t5d0 ENA
sd disk-02 Cor-Plex disk02 0 1000000 1000000 c1t3d0 ENA
pl Cor-Plex-2 vol01 ENABLED TEMP 2000000 CONCAT - WO
sd disk-01-2 Cor-Plex-2 disk01 1000000 1000000 0 c1t5d0 ENA
sd disk-02-2 Cor-Plex-2 disk02 1000000 1000000 1000000 c1t3d0 ENA
16. What does this volume look like from a vxprint -Ath output after attach ?
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen ENABLED ACTIVE 2000000 SELECT -
pl Cor-Plex vol01 ENABLED ACTIVE 2000000 CONCAT - RW
sd disk-01 Cor-Plex disk01 0 1000000 0 c1t5d0 ENA
sd disk-02 Cor-Plex disk02 0 1000000 1000000 c1t3d0 ENA
pl Cor-Plex-2 vol01 ENABLED ACTIVE 2000000 CONCAT - RW
sd disk-01-2 Cor-Plex-2 disk01 1000000 1000000 0 c1t5d0 ENA
sd disk-02-2 Cor-Plex-2 disk02 1000000 1000000 1000000 c1t3d0 ENA
17. How do I detach a plex from a volume ?
usr/sbin/vxplex -g
18. What does this volume look like from a vxprint -Ath output after attach ?
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v vol01 fsgen ENABLED ACTIVE 2000000 SELECT -
pl Cor-Plex vol01 ENABLED ACTIVE 2000000 CONCAT - RW
sd disk-01 Cor-Plex disk01 0 1000000 0 c1t5d0 ENA
sd disk-02 Cor-Plex disk02 0 1000000 1000000 c1t3d0 ENA
pl Cor-Plex-2 vol01 DETACHED STALE 2000000 CONCAT - RW
sd disk-01-2 Cor-Plex-2 disk01 1000000 1000000 0 c1t5d0 ENA
sd disk-02-2 Cor-Plex-2 disk02 1000000 1000000 1000000 c1t3d0 ENA
19. How do I disassociate a plex from a volume ?
usr/sbin/vxplex -g
sd disk-01-2 Cor-Plex-2 disk01 1000000 1000000 0 c1t5d0 ENA
sd disk-02-2 Cor-Plex-2 disk02 1000000 1000000 1000000 c1t3d0 ENA
20. How do I add a disk into my disk group ?
/usr/sbin/vxdg -g
21. How do I create a RAID5 volume ?
/usr/sbin/vxassist -g
This returns the maximum size (8304640) of the volume which can be used in the following command.
/usr/sbin/vxassist -g
22. How does the vxprint -Ath for a RAID 5 volume look during the build ?
v vol-r5 raid5 DETACHED EMPTY 12456192 RAID -
pl vol-r5-01 vol-r5 ENABLED EMPTY 12457728 RAID 4/128 RW
sd disk04-01 vol-r5-01 disk04 0 4152640 0/0 c1t1d0 ENA
sd disk02-01 vol-r5-01 disk02 0 4152640 1/0 c1t3d0 ENA
sd disk03-01 vol-r5-01 disk03 0 4152640 2/0 c1t4d0 ENA
sd disk01-01 vol-r5-01 disk01 0 4152640 3/0 c1t5d0 ENA
pl vol-r5-02 vol-r5 ENABLED EMPTY 5600 CONCAT - RW
sd disk05-01 vol-r5-02 disk05 0 5600 0 c1t2d2 ENA
23. How does the vxprint -Ath for a RAID 5 volume look after the build ?
v vol-r5 raid5 ENABLED ACTIVE 12456192 RAID -
pl vol-r5-01 vol-r5 ENABLED ACTIVE 12457728 RAID 4/128 RW
sd disk04-01 vol-r5-01 disk04 0 4152640 0/0 c1t1d0 ENA
sd disk02-01 vol-r5-01 disk02 0 4152640 1/0 c1t3d0 ENA
sd disk03-01 vol-r5-01 disk03 0 4152640 2/0 c1t4d0 ENA
sd disk01-01 vol-r5-01 disk01 0 4152640 3/0 c1t5d0 ENA
pl vol-r5-02 vol-r5 ENABLED LOG 5600 CONCAT - RW
sd disk05-01 vol-r5-02 disk05 0 5600 0 c1t2d2 ENA
24. How do I get information about a RAID5 volume ?
/usr/sbin/vxinfo -U raid5 -g
25. How do I build a hot-spare ?
/usr/sbin/vxedit -g
26. How does a hot spare look in vxprint -Ath
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
dm disk06 c1t5d1s2 sliced 66079 978880 SPARE
27. How do I make this volume a filesystem and mount it ?
/usr/sbin/mkfs /dev/vx/rdsk/
/usr/sbin/mount /dev/vx/dsk/
28. How does a RAID 5 volume look if we loose a sub-disk ?
v vol-r5 raid5 ENABLED ACTIVE 12456192 RAID -
pl vol-r5-01 vol-r5 ENABLED ACTIVE 12457728 RAID 4/128 RW
sd disk04-01 vol-r5-01 disk04 0 4152640 0/0 c1t1d0 ENA
sd disk02-01 vol-r5-01 disk02 0 4152640 1/0 - NDEV
sd disk03-01 vol-r5-01 disk03 0 4152640 2/0 c1t4d0 ENA
sd disk01-01 vol-r5-01 disk01 0 4152640 3/0 c1t5d0 ENA
pl vol-r5-02 vol-r5 ENABLED LOG 5600 CONCAT - RW
sd disk05-01 vol-r5-02 disk05 0 5600 0 c1t2d2 ENA
29. How can I tell if a disk has been hot spared ?
A mail message will have been sent to root (by default) indicating
that a hot relocation has taken place.
The message subjects should be :
Subject: Volume Manager failures on host xxx
Subject: Attempting VxVM relocation on host xxx
30. How do I redirect mail to be sent to another user instead of root in the event of a failure & hot spare replacement ?
Edit /etc/rc2.d/S95vxvmrecover and enter 'vxsparecheck user-name &'
where user-name is the user you wish to have mailed.
Note this is hot sparing and not hot relocation.
31. How do I force a disk back into it's original configuration after it has been hot-spared ?
/usr/sbin/vxassist -g
where disk05 is the 'relocated to' disk and disk02 is the 'relocated from' disk
Of course, before moving any relocated subdisks back, ensure the disk thatexperienced the failure has been fixed.
An alternative would be to use vxevac. See option 37 below.
32. How do I make Volume Manager see newly added disks ?
/usr/sbin/vxdctl enable
33. How to determine unused space in a diskgroup config ?
/usr/sbin/vxassist -g
34. How do I list all the subdisks in my volume ?
/usr/sbin/vxedit -g
35. How can I find out which physical disks are in a disk group ?
/usr/sbin/vxdisk (-s) list
36. How can I change the name of a VM disk ?
/usr/sbin/vxedit -g
An alternative would be to use vxassist. See option 31 above.
37. How do I move all the subdisks from one physical disk to another disk ?
/usr/sbin/vxevac -g
38. Is it safe to use vxevac on a live system ?
Yes. Volume manger will build a mirror and do a full sync of the original disk to the new disk.
39. Can I use a hot-spare across multiple disk groups ?
No. Hot-spares only act as replacements for other disk in the same disk group.
________________________________________
This rest of this section is designed to give you an idea of various disk management tips and hints for Volume Manager.
----40. How does Dirty Region Logging (DRL) work ?
What is DRL ?
Dirty Region Logging is a bit map mechanism used to facilitate mirror resynchronisation after a system failureWhere DRL's can be used
A DRL is ONLY used when a volume has 2 plexes or more (ie, a mirror) and the system panics (or someone yanks out the power cord).
NB. One mistake people make is assuming that the DRL is the same thing as the log used on a Raid5 volume. They function completely different.
The DRL is not added automatically, because it is an "option" and not always necessary.
If one side of a mirror goes down and is marked as bad and needs to be restarted, a full resync will be done and the DRLs have no value. The main use for DRLs is in system failure. In most other scenarios they are not used.
What Veritas DRL's will NOT do
In SDS you can do a metaoffline and the SDS DRL keeps track of which regions are changed then when doing a metaonlinesome time later SDS only resync's the changed regions. This 'feature' or functionality is not part of the design of the Veritas software.
In the case where a plex is disassociated, this causes the entire plex to go stale, so when you reattach the plex to the mirror, it requires a full resync.
They are not used for on-line reconfigurations operations.
Again, the DRL is ONLY used if the system crashes and is subsequently rebooted.
How DRL's work When the system is rebooted after a 'non-graceful' shutdown, volume manager needs to syncronize the plexes to guarantee that both mirrors are identical. It does this by reading each and every block and copying the data to the "other" plex. Obviously, this will take a long time. If there's a DRL attached to the volume, volume manager will only have to 'sync' the regions which are dirty. Since it works on a "region" basis, the resync times are greatly reduced, in most cases, but not necessarily all cases.
Performance
The performance difference you may notice during normal operation may be due to the updates in the log. There is some amount of overhead involved, though normally it is minimal.
Fast writes with DRL's
Fast_write has nothing to do with DRL.... Veritas has no knowledge of fast_write... The SSA fast_write feature is very safe with DRL's in with all configurations. There were some problems in the past but that is ancient history.
41. EARLYNOTIFIER_ALERT_RAID-5
The EARLYNOTIFIER_ALERT_RAID-5 says:
For non-typical RAID-5 configurations which have the following characteristics:
- a RAID-5 column which is split into multiple subdisks where the subdisks do NOT end and begin on a stripe-unit aligned boundary
- and a RAID-5 reconstruction operation was performed.Data corruption can be present, in the region of the RAID-5 column where the split subdisks align.
So for a preventive action I want to verify the customers RAID-5 configurations. ( using explorer results )
This can be done as follows.
Here's an example:A. Good case
Case-1:
# vxprint -g kuro -hqvt
v vol01 raid5 ENABLED ACTIVE 640000 RAID -
pl vol01-01 vol01 ENABLED ACTIVE 640000 RAID 3/32 RW
sd kuro01-01 vol01-01 kuro01 0 224000 0/0 c2t1d0 ENA
sd kuro02-01 vol01-01 kuro02 0 224000 1/0 c2t1d1 ENA
sd kuro03-01 vol01-01 kuro03 0 224000 2/0 c2t1d2 ENA
pl vol01-02 vol01 ENABLED LOG 1008 CONCAT RW
sd kuro04-01 vol01-02 kuro04 0 1008 0 c2t1d3 ENA
Subdisk size is multiple of stripe width. So you don't worry about this.
Case-2:
# vxprint -g kuro -hqvt
v vol01 raid5 ENABLED ACTIVE 640000 RAID -
pl vol01-01 vol01 ENABLED ACTIVE 640000 RAID 3/32 RW
sd kuro01-01 vol01-01 kuro01 0 224000 0/0 c2t1d0 ENA
sd kuro05-01 vol01-01 kuro05 0 96000 0/224000 c2t4d0 ENA
sd kuro02-01 vol01-01 kuro02 0 224000 1/0 c2t1d1 ENA
sd kuro06-01 vol01-01 kuro06 0 96000 1/224000 c2t4d1 ENA
sd kuro03-01 vol01-01 kuro03 0 224000 2/0 c2t1d2 ENA
sd kuro07-01 vol01-01 kuro07 0 96000 2/224000 c2t4d2 ENA
pl vol01-02 vol01 ENABLED LOG 1008 CONCAT - RW
sd kuro04-01 vol01-02 kuro04 0 1008 0 c2t1d3 ENA
Subdisk is concatanated, but still they're matched with stripe size boundary. Also you don't worry about this.
B. Bad case --- You need to care about those configuration.
Case-1:
# vxprint -g kuro -hqvt
v vol01 raid5 ENABLED ACTIVE 614400 RAID -
pl vol01-01 vol01 ENABLED ACTIVE 617728 RAID 3/32 RW
sd kuro01-01 vol01-01 kuro01 0 205200 0/0 c2t1d0 ENA
sd kuro05-01 vol01-01 kuro05 0 103680 0/205200 c2t4d0 ENA
sd kuro02-01 vol01-01 kuro02 0 205200 1/0 c2t1d1 ENA
sd kuro06-01 vol01-01 kuro06 0 102816 1/205200 c2t4d1 ENA
sd kuro03-01 vol01-01 kuro03 0 205200 2/0 c2t1d2 ENA
sd kuro07-01 vol01-01 kuro07 0 102816 2/205200 c2t4d2 ENA
pl vol01-02 vol01 ENABLED LOG 1008 CONCAT - RW
sd kuro04-01 vol01-02 kuro04 0 1008 0 c2t1d3 ENA
This means the last stripe unit of "kuro01-01" contains only 16 blks. This means this bottom section isn't aligned stripe size. As the result, the first 16 blks in "kuro05-01" is used for this stripe. You need to pay attention to this configuration. The Early Notifier tells us this.
Case-2:
# vxprint -g kuro -hqvt
v vol01 raid5 ENABLED ACTIVE 614400 RAID -
pl vol01-01 vol01 ENABLED ACTIVE 617728 RAID 3/32 RW
sd kuro01-01 vol01-01 kuro01 0 205200 0/0 c2t1d0 ENA
sd kuro02-01 vol01-01 kuro02 0 205200 1/0 c2t1d1 ENA
sd kuro03-01 vol01-01 kuro03 0 205200 2/0 c2t1d2 ENA
pl vol01-02 vol01 ENABLED LOG 1008 CONCAT - RW
sd kuro04-01 vol01-02 kuro04 0 1008 0 c2t1d3 ENA
Currently, there're no concatinated subdisk in this raid5 volume. But each subdisk size is not aligned with stripe width. The last stripe has only 16 blks. At this moment, VxVM doesn't use this last stripe part. But think again, when you resize this volume with new 3 drives with "vxva" or "vxassist growto", this configuration will changed to "Case-1" above. So you need to pay attention to this configuration too.42. Hot reloction VS hot sparing
Hot reloction VS hot sparing.....
Presently if there is a media (read) failure of redundant data, Volume Manager
will read from the other plex and then write the data to the plex that
encountered the error data. The data is then re-read from the newly
written data to ensure it is good. Should this fail again, Volume Manager then
performs a diagnostic in its private region for that disc. This
diagnostic (for the lack of a better descriptive word) consist basically
of writing and reading in the private region. Should it fail then Volume Manager
will replace the disc with another disc (if the Hot Sparing option is
selected and a disc is available), and then copy good data from the good
plex to the newly replaced disc. As you notice this is a disc for disc
replacement for redundant data.In the new Hot Relocation scheme, pretty much the same is carried on up
to the point of the diagnostic in the private region. Instead of
performing the diagnostic in the private region and then replacing the
disc with another. Now Volume Manager will replace the errored sub-disc with a
matching sized area out of the disc(s) allocated for the Hot Relocation
pool and copies data from the good plexs sub-disc to the newly acquired
sub-disc. As you will notice this is a sub-disc for sub-disc
replacement of redundant data, without the requirement that the complete
disc fail.
In both the above cases non-redundant data is not moved to the newly
aquired disc space, be it a complete disc or sub-disc failure. This
operation becomes the function of the systems operator...
Obviously there is much more to the operation, this is meant to be
nothing more than just a thumb nail sketch of the differences..
A dead disc type failure is pretty much the same, with all the
operations failing on the bad disc.
43. How can I manually failover a diskgroup in an SSA
If SSA linked to two systems and one system fails
To list groups out there
# vxdiskadm
8 Enable access to (import) a disk group
list
To force the import of a disk group
# vxdg -fC import disk_group
To start the volumes
# vxvol -g disk_group -f start vol01 vol02 vol03 etc..
To mount volumes
# mount /dev/vx/dsk/disk_group/vol01 /data01
To bring in rootdg disks on SSA into different group
# vxdg -tC -n "newgroup" import "diskgroup"
44. How can I grow the private region of a disk group ?
The following information is from "Ultra Enterprise PDB 1.2 Release Notes - December 1996"Large System Configurations
Systems that have a very large disk group configurations can eventually exhaust the private region size in the disk group, which results in not being able to add more configuration objects. At this time, the configuration either has to be split into multiple disk groups, or the private regions have to be enlarged. This task involves re-initializing each disk in the disk group. There is no method to dynamically enlarge this private region.The private region of a disk is specified by using the privlen option to the vxdisksetup cammand. For example,
# vxdisksetup -i c1t0d0 privlen=2048
Reasons why this is not a good idea
Increasing the size of the private region is tricky because you have to increase it on ALL the disks in the dg before the database itself will "expand". Therefore, running vxdissetup on only one disk is not going to work. Unfortunately, it's not that easy.If you increase the size of the private area, that means less space for data on the disk, so you'r PROBABLY looking at a complete backup, tear down of the dg, remaking the dg with the newly formatted/initialized disks, and then remaking the volumes and restoring data. Obviously, this is very time consuming.
Once enlarged, if ANY failed disk is replaced by use of normal means the dfault region size will be on the new device, thus forcing the entire group to default back to that size.
Lastly, if the customer ever in the future runs 'vxdiskadm' to initialize a new disk, it'll put the default (small) private area on the disk. This won't work, cause all the disks in the dg HAVE to have the larger private area. So for the rest of this guys life he needs to run vxdisksetup with the appropriate parameters to give the disk the larger private area.
Options
They should look into just putting any new volumes and disks into a new diskgroup.Split the disk group that has the problem up, move some of the volumes out to a different disk group, so that they do not run into problems under live running conditions. As the Veritas volume manager requires space in the private region for say when it has to use hot sparing/relocation etc... Only where necessary use enlarged private regions.
45. Where can I get the latest SSA Matrix - (Patches & Compatibility) ?
SSA Matrix - (Patches & Compatibility)
46. Where can I get Demo License for VxVM (2.6) ?
Demo License for VxVM (2.6)
47. How can I create a small rootdg without encapsulating a disk ?
Create Small Rootdg Group
There MUST be a rootdg group for each node when using the SPARCcluster.
It is the default disk group and cannot be omitted.
It is more difficult to upgrade to new version or recover from certain
errors when the root is encapsulated.Prerequsists:-
Install Solaris 2.x plus patches.
Install Volume Manager and patches.
Reboot.Create a 2 cylinder raw partition on a disk.NB DO NOT RUN VXINSTALL.
Set the initial operating mode to disable. This disables
transactions and creates the rendevous file install-db,
for utilities to perform diagnostic and initialization
operations.
# vxconfigd -m disable
# ps -ef | grep vxconfigd
root 608 236 6 16:20:20 pts/0 0:00 grep vxconfigd
root 605 1 18 16:17:44 ? 0:00 vxconfigd -m disable
NB. If the above command fails its probably because vxconfigd is already running.
Just kill off vxconfigd and re-run the above command again or alternatively try vxconfigd -k which kills the daemon and restarts it.
Initialise database
# vxdctl init Make new rootdg group
# vxdg init rootdg Add a simple slice
# vxdctl add disk c0t3d0s7 type=simple
vxvm:vxdctl: WARNING: Device c0t3d0s7: Not currently in the configuration Add disk record
# vxdisk -f init c0t3d0s7 type=simple Add disk name to rootdg disk group
# vxdg adddisk c0t3d0s7 Enable transactions
# vxdctl enable Remove file
# rm /etc/vx/reconfig.d/state.d/install-db
48. What should I consider when configuring swap ?
Dump device
Primary swap needs to be a phyiscal partition. This is not to say it cannot be under vertias control.
This is because in the event of a panic VM doesn't support volumes as dump devices.
It gets it from a physical slice initially which is then is changed to a vertias volume.
During the startup from /etc/rcS.d/S35vxvm-startup1 it executes the following.
"vxvm: NOTE: Setting partition $dumpdev as the dump device."
swap -a $dumpdev
swap -d $dumpdev
breakdoneMore than one swap
One place for the primary swap.
You can have other swap areas which could be raw partitions or a swap file.
How much swap must be non striped
We do not support a striped primary swap device. This could be made smaller than memory.
How big must his swap be
We advise this to be at least the same size as his systems memory, so that crash dumps can be taken. - not really relevant to Enterprise class systems
Maximum limit
Up to a max of 2GB.
All core dumps will be truncated to 2GB, and in fact a partition over 2GB is a problem for 'savecore'.
The core dump is copied to the _end_ of the primary swap partition,
and savecore can't read it because it can't seek over 2GB.
Direct mapping between devices
Veritas finds the 'real' partition that the swapvol maps to and uses this for the 'dumpdevice' ( for core dumps ).
If there is not direct mapping, then this will break and the system will have not dumpdevice.
How swap works
There is no point in striping swap.
Swap is allocated on a round robin basis in 1MB pieces from all the partitions or files that are assigned as swap space.
Just take all the pieces of disk that you were planning on striping, and assign them as swap space in their own right.
"Striping" will essentially occur automatically.
Creating primary swap on different disk
The swap partition should still be on slice 1 but must not start at cylinder 0 (start at cylinder 1) and it's tag must be swap.
This is because it stops the veritas volume manager startup script S35vxvm-config from mapping the underlying partition
as a dumpdevice after the disk has been encapsulated.
Although this was done on a raid5 volume, the same could be done for any type of volume.
49. How can I stop volume creation ?
We created a raid5 volume that was imediately seen to be the wrong size.
By running the following commands ment we can have another
go at creating it the correct size, without having to wait
for it to finish the raid5 setup.// Find the id of the process creating the raid5 volume.
# ps -ef
// Kill off the process.
# kill
// Clear the tutil and putil fields (we want dashes in the fields).
// These fields can be seen by running vxprint.
// May only have to do it for the plex.
# vxmend clear tutil0 vol01-01
# vxmend clear tutil0 vol01
// Remove the volume.
// You will not be able to do this from the GUI.
# vxedit -fr rm vol01
50. How can I recover a failing disk - FAILING ?
In VXVM 2.3 when a subdisk gets an I/O error, hot relocation kicks in and the
VMdisk that contained the failed VMsubdisk is set to "failing=on".This prevents vxassist from using the disk to create new subdisks unless explicitly directed to do so by the user.
You can use the following command to turn the flag off if you think it got turned
on due to a transient error. VXVM 2.3 GUI also has a checkbox for this functionality.
# vxedit set failing=off disk05 51. How do I move disks from one disk group to another ?
NB.
If these disks are going into an existing disk group then
you do not need to initialise the disk group and the disk
names must be different,
eg If you have c1t0d0s2=disk01 then the disk group you
are moving the disk into must not have a disk01.
Moving Populated Volume Manager Disks between Disk Groups
i) Assume I intend to move volumes vol02 and vol04 from the disk
group olddg to a new group, newdg.
ii) Get a list of disks in the disk group you intend to split.
# vxdisk list | grep olddg
c1t0d0s2 sliced olddg01 olddg online
c1t0d1s2 sliced olddg06 olddg online
c1t1d0s2 sliced olddg04 olddg online
c1t1d1s2 sliced olddg09 olddg online
c1t2d0s2 sliced olddg02 olddg online
c1t2d1s2 sliced olddg07 olddg online
c1t4d0s2 sliced olddg03 olddg online
c1t4d1s2 sliced olddg08 olddg online
c1t5d0s2 sliced olddg05 olddg online
c1t5d1s2 sliced olddg10 olddg online
iii) Get the configuration.
iv) Determine which disks contain the volumes to be moved. Insure that all
volume allocations are self-contained in the set of disks to be moved.
In this case, my volumes are contained on disks olddg04 through olddg09,
with no unassociated plexes or subdisks, and no allocations which cross
out of this set of disks.
v) Save the configuration, in a format that can be plugged back into
the vxmake utility. Specify all volumes on the disks in question (plus
any unassociated plexes and their child subdisks, plus any unassociated
subdisks).
# vxprint -hmQqvps -g olddg vol02 vol04 > movers
vi) Unmount the appropriate file systems, and/or stop the processes
which hold the volumes open.
vii) Stop the volumes.
# vxvol -g olddg stop vol02 vol04
viii) Remove from the configuration database the definitions of the
structures (volumes, plexes, subdisks) to be moved. (NOTE that this
does not affect your data.)
# vxedit -g olddg -r rm vol02 vol04
ix) Remove the disks from the original diskgroup.
# vxdg -g olddg rmdisk olddg04 olddg05 olddg06 olddg07 olddg08 olddg09
x) Initialize the new diskgroup using one of your disks. DO NOT
reinitialize the disk itself. (vxdisk init). (If you are moving the disks
to a disk group that already exists, skip this step.) It is simplest to
keep their old names until a later step.
# vxdg init newdg olddg04=c1t1d0s2
xi) Add the rest of the moving disks to the new disk group.
# vxdg -g newdg adddisk olddg05=c1t5d0s2
# vxdg -g newdg adddisk olddg06=c1t0d1s2
# vxdg -g newdg adddisk olddg07=c1t2d1s2 olddg08=c1t4d1s2 olddg09=c1t1d1s2
xii) See the disks in the new disk group.
# vxdisk list | grep newdg
c1t0d1s2 sliced olddg06 newdg online
c1t1d0s2 sliced olddg04 newdg online
c1t1d1s2 sliced olddg09 newdg online
c1t2d1s2 sliced olddg07 newdg online
c1t4d1s2 sliced olddg08 newdg online
c1t5d0s2 sliced olddg05 newdg online
xiii) Reload the object configuration into the new disk group.
# vxmake -g newdg -d movers
xiv) Bring the volumes back on-line.
# vxvol -g newdg init active vol02
# vxvol -g newdg init active vol04
xv) Observe the configuration of the new disk group.
# vxprint -ht -g newdg
xvi) Test the data. Remember that the device names have changed to refer
to newdg instead of olddg; you'll need to modify /etc/vfstab and/or your
database configurations to reflect this. Then you'd mount your file
systems, start your database engines, etc.
xvii) Note that the original database is intact, though the disk naming is
a bit odd. You *can* rename your disks and their subdisks to reflect the
change. This is optional.
# vxprint -ht -g olddg
# vxedit rename olddg10 olddg04
# vxprint -g olddg -s -e "name~/olddg10/"
# vxedit rename olddg10-01 olddg04-01
# vxprint -g olddg -ht
xviii) Do the same for the disks in newdg and their subdisks.
# vxprint -g newdg -s
# vxprint -g newdg -e "name~/olddg/"
# vxedit rename olddg04 newdg01
# vxedit rename olddg05 newdg02
# vxedit rename olddg06 newdg03
# vxedit rename olddg07 newdg04
# vxedit rename olddg08 newdg05
# vxedit rename olddg09 newdg06
# vxedit rename olddg04-01 newdg01-01
# vxedit rename olddg05-01 newdg02-01
# vxedit rename olddg06-01 newdg03-01
# vxedit rename olddg07-01 newdg04-01
# vxedit rename olddg08-01 newdg05-01
# vxedit rename olddg09-01 newdg06-01
# vxedit rename olddg08-02 newdg05-02
# vxedit rename olddg09-02 newdg06-02
# vxprint -g newdg -ht 52. How do I return to underlying devices ?
Notes:- Use the name of your system disk rather than c0t3d0, which is
used in this guide only as an example.
- When rebooting, you might have to specify a disk if the disk is not
the default boot disk, instead of init 6.
Sequence:
Boot from CD-ROM to convert back to underlying devices and stop Volume
Manager.
Boot from cdrom
>ok boot cdrom -sw
# fsck /dev/rdsk/c0t3d0s0
FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? y
# mount /dev/dsk/c0t3d0s0 /a
Take a copy of the vfstab and system files
# cp /a/etc/vfstab /a/etc/vfstab.vx
# cp /a/etc/system /a/etc/system.vx
Edit vfstab file to replace any of the system partition entries with
entries for the underlying partitions.
Also remove/convert/hash out, any other entries to vx devices.
# vi /a/etc/vfstab
/proc - /proc proc - no -
fd - /dev/fd fd - no -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 / ufs 1 no -
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 no -
/dev/dsk/c0t3d0s3 /dev/rdsk/c0t3d0s3 /var ufs 1 no -
/dev/dsk/c0t3d0s5 /dev/rdsk/c0t3d0s5 /opt ufs 2 yes -
/dev/dsk/c0t3d0s1 - - swap - no -
Check the rest of the system filesystems.
# fsck /dev/rdsk/c0t3d0s6
# fsck /dev/rdsk/c0t3d0s3
# fsck /dev/rdsk/c0t3d0s5
Edit system file to remove the following entries for Volume Manager.
# vi /a/etc/system
rootdev:/pseudo/vxio@0:0
set vxio:vol_rootdev_is_volume=1
Stop Volume Manager.
# touch /a/etc/vx/reconfig.d/state.d/install-db
install-db should be the only file in this directory, remove any other
files like root-done.
# cd /
# umount /a
# fsck /dev/rdsk/c0t3d0s0
Reboot on the underlying disk
# init 6 53. How could I backup and restore private regions ?
The following proceedure is not a substitute for backing up your valuable
data. Please ensure you have reliable backups of your data.
Take a snapshot of the current configuration
When you have volume manager up and running, you need to run the following
command for each disk group.
# vxprint -hmQqsvp -g dg > /directory-path/filenameWe also need a list of the names which equate to the physical disks,
this can be obtained be keeping the output from
# vxdisk list
Create the new disk group
NB. Disk names MUST correspond to the same disks exactly as they were
originally (see you backup copy vxdisk list output).
Initalise the diskgroup, using one of the disks from the lost disk
group.
# vxdg init dg access name=medianameNB. Substitute the disk group, disk access name and media name
from the saved vxdisk list output. e.g.
# vxdg init datadg disk01=c2t0d0s2Add in the rest of the disks.
# vxdg -g new_data_dg adddisk =[other disks]Recreate the volume(s) configuration from the configuration file.
# vxmake -g dg -d /directory-path/filename
NB. If this fails saying input file too large, then split the
file up and run the above for each one.
In most cases it works, its just for very large configurations
and then we have only split it into two pieces.You can use the above command with the -V option which will
go through the motions but not actually do anything.
You may have to bring the volume back online (each vol must be done
one at a time).
# vxvol -g init active 54. How can I add more swap from another disk under Veritas ?
Create more swap in a different disk group
NB Name no longer than swapvol ie swapvl2 or swap02 is ok.To add extra swap manually:-
# swap -l
# swap -a /dev/vx/rdsk/swapdg/swap02
# swap -l
To pick up the extra swap at boot time:-
# vi /etc/vfstab
/dev/vx/rdsk/swapdg/swap02 - - swap - no -
# init 6 55. How can I setup an alternate dump device (rcS.d/S35newdumpdevice) ?
#!/bin/sh
#
# /etc/rcS.d/S35newdumpdevice
#
# Author: Bede Seymour (bede.seymour@Eng.Sun.COM)
#
# Created: Wed Apr 30 14:41:09 EST 1997
#
# This script *MUST* come before /etc/rcS.d/S40standardmounts.sh !!!
#
# This only works because the swapadd/swap -a command only edits the
# dumpvp vnode ptr in the kernel if not already set.
#
# Set DUMPDEV to the device/slice on which you would like to dump.
#
# set defaults
PATH=/sbin:/etc:/bin:/usr/sbin:/usr/bin:/usr/ucb ; export PATH
PROG=`basename $0` ; export PROG
DUMPDEV="/dev/dsk/c0t0d0s1" ; export DUMPDEV
echo "$
Unknown macro: {PROG}
: configuring $
Unknown macro: {DUMPDEV}
as dump device ..."
swap -a $
swap -d $
Unknown macro: {DUMPDEV}
echo "$
: done." 56. Official SSA/A5000 Software/Firmware Configuration Matrix
Official SSA/A5000 Software/Firmware Configuration Matrix 57. Veritas On-Line Storage Manager (www.veritas.com)
Veritas On-Line Storage Manager (www.veritas.com) 58. Download Veritas Software
Download Veritas Software 59. Veritas Utilities and Scripts (Unsupported)
Veritas Utilities and Scripts (Unsupported) - Australian 'Spider' server 60. What can the vxprivutil command be used for ?
Check the consistancy of the information in the private region try the following:
# /etc/vx/diag.d/vxprivutil dumpconfig /dev/rdsk/c?t?d?s2 > /tmp/vx.output
# cat /tmp/vx.output | vxprint -Ath -D -or
# cat /tmp/vx.output | vxprint -vpshm -D - > /tmp/vxprint.vpshm
# vxmake -g diskgroup -d /tmp/vxprint.vpshm
You should see a normal vxprint output. 61. How can I clear the message 'volume ? is locked by another utility' ?
If you get the following error message :
vxvm:vxplex: ERROR: Plex vol01-02 in volume vol01 is locked by another utility
This can be fixed by running the following commands:
$ vxmend clear tutil plex
$ vxmend clear tutil vol
$ vxplex -g diskgroup det plex
$ vxrecover -s
If you look at the TUTIL0 in a vxprint you will see that there are
some flags set call ATT, all you need to do is to clear them. 62. How can I clear subdisks which are in IOFAIL state ?
How to get rid of the subdisk in a IOFAIL state, if volume is mirror'd
This is a known bug (Bug ID: 4050048), the workaround is as follows
NOTE:-
Before you start make sure you have an output of
$ vxprint -Ath
In this example it is the rootdisk which has had this problem, hence
sd rootdiskPriv - ENABLED 2015 - - - PRIVATE
v rootvol root ENABLED 1919232 - ACTIVE - -
pl rootvol-03 rootvol ENABLED 1919232 - ACTIVE - -
sd disk01-01 rootvol-03 ENABLED 1919232 0 - - -
pl rootvol-01 rootvol ENABLED 1919232 - ACTIVE - -
sd rootdisk-B0 rootvol-01 ENABLED 1 0 - - Block0
sd rootdisk-02 rootvol-01 ENABLED 1919231 1 IOFAIL - - Both sides of the plex are working but the sd rootdisk-02 is marked as
IOFAIL, the only way to clear this state is to remove the subdisk and
recreate it will the same subdisk offsets and length. this can be done
as follows
# vxplex -g rootdg dis rootvol-01
# vxsd -g rootdg dis rootdisk-02
# vxedit -g rootdg rm rootdisk-02
# vxmake -g rootdg sd rootdisk-02 rootdisk,0,1919231
where DISK is rootdisk, DISKOFFS is 0 and LENGTH is 1919231The DISK, DISKOFFS and LENGTH can be found from the vxprint -th output
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v rootvol root ENABLED ACTIVE 1919232 ROUND -
pl rootvol-03 rootvol ENABLED ACTIVE 1919232 CONCAT - RW
sd disk01-01 rootvol-03 disk01 0 1919232 0 c1t0d0 ENA
pl rootvol-01 rootvol ENABLED ACTIVE 1919232 CONCAT - RW
sd rootdisk-B0 rootvol-01 rootdisk 1919231 1 0 c0t3d0 ENA
sd rootdisk-02 rootvol-01 rootdisk 0 1919231 1 c0t3d0 ENA NOTE:
depending where the subdisk is used, ie with in a stripe you may need
to use the -l option to specifiy where the subdisk is located in the stripe.
# vxsd -g rootdg assoc [-l n] rootvol-01 rootdisk-02
where n is the position in the stripe, this again can be determined from the vxprint -th output.
for subdisk datadg08-01 the -l number would be 2 (STRIPE 2/0)
for subdisk datadg06-01 the -l number would be 0 (STRIPE 0/0)| V | NAME | USETYPE | KSTATE | STATE | LENGTH | READPOL | PREFPLEX |
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
pl vol01-02 - DISABLED - 104672 STRIPE 4/128 RW
sd datadg06-01 vol01-02 datadg06 0 26208 0/0 c1t1d0 ENA
sd datadg07-01 vol01-02 datadg07 0 26208 1/0 c1t3d0 ENA
sd datadg08-01 vol01-02 datadg08 0 25760 2/0 c1t3d1 ENA
sd datadg09-01 vol01-02 datadg09 0 25760 3/0 c1t5d1 ENA
# vxplex -g rootdg att rootvol rootvol-01
Once the re-sunc has finished then everything should be back to normal.
________________________________________
This section deals more specifically with issues related to Veritas Volume Manager and the Sparc Storage Array
________________________________________
63. How do I upgrade to Solaris 2.5 & VM 2.1.1 ?
We had a customer who installed Solaris 2.5 on top of Vm 2.1.... This is not a supported config, because it does not work. This left the customer in a position of not being able to get his system back up. After jumping thru some hoops the customer was back up on line. This to point out a few things to try and save others from the same or similar problems....
o The Vm 2.1.1 binaries for Solaris 2.3 and 2.4 are NOT the same as the binaries for Solaris 2.5.
o This a departure from the past, due to some other problems (to be solved in the next release).
o This also means that the Vm 2.1 binaries will NOT work with Solaris 2.5...
o If you are going to use Solaris 2.5 and Vm, it MUST be Vm 2.1.1(release)....
o If a customer upgrades Vm to 2.1.1 on either Solaris 2.3 or 2.4 and then decides to go to Solaris 2.5, caution should be taken. As mentioned above the Vm 2.1.1 binaries for Solaris 2.3/2.4 and 2.5 are not the same, so both Vm and Solaris need to be upgraded in this case.
o The upgrade procedures for Vm 2.1.1 provided with the CD, do not cover this situation, a procedure needs to be developed and tested to handle this.
64. How does a hotspare know when to kick in ?
This is how a hotspare works with Veritas Volume Manager....
Specifically, here's the procedure Vol Mgr goes through to determine
whether a disk has failed:
If read error on non-protected (non-mirrored and non-RAID5) volume:
do nothing, other than report the error
(this is the same thing Solaris does)
If read error on protected volume:
read the data from alternate drives
(from alternate mirror, or by reconstructing the
data from the remaining disks in RAID5)
return data to app
write data to drive which originally reported read error
(Reason: if the original read error was due to
a bad spot on the disk, then this write may
cause the SCSI drive to re-vector the block to an
alternate track)
If write error:
Try to read & write the private region on the disk.
If private region accessible:
Must be just a bad spot on the disk.
Do not consider disk failed, and do not hot spare.
Detach plex(es) associated with this disk and email root
Else:
The whole disk is almost surely bad.
Consider disk failed, and initiate hot spare.
Note that it takes a little while to go through all this, doing extra
I/O's to make sure the disk has really failed, waiting for commands to
time out, etc. This is why you don't see hot spares kick in instantaneously.
Volume Manager is trying to make sure that the disk really is bad. This
is Good. You don't want to start swapping in hot spares unless the disk
is really bad.
So, if Vol Mgr decides to kick in a hot spare, it proceeds to build the
appropriate subdisk(s), plex(es), and volume(s) that were on the failed
disk onto the hot spare. It then populates the subdisks with the data
that was on the failed disk.
If all you had on the failed disk was 100MB of volume stuff, then that's
all that gets written to the hot spare. It doesn't write the whole disk
unless it has to.
Look at this example Failures have been detected by the VERITAS Volume Manager:
failed plexes:
ukdb00-01
ukdb02-01
ukdb03-01
ukdb04-01
No data appears to have been lost.
The line "No data appears to have been lost." inidcates this, and inform's root
that he needs to decide what to do
1. try and re-attach disk and see if he has a geniune h/w Error or
2. replace faulty disk, and rebuild the mirror
In a nutshell a hotspare will only be initated by Volume Manager if/when Volume Manager cannot read/write
to the private region of the disk. In all other circumstances Volume Manager will email root (to configure
Volume Manager to email more users edit /etc/rc2.d/S95vxvm-recover and modify the line that says
"vxsparecheck root &" to vxsparecheck root other-users &") and inform him/her that it has detached a plex
Unknown macro: {mirror}
as it encountered problems, and needs attention (this is better than ODS which just sits there until,
you issue a metastat command too see whats happening)
65. How do I encapsulate the boot disk ?
SRDB ID: 10923
SYNOPSIS: How to encapsulate root disk for mirroring
DETAIL DESCRIPTION:
Bring the internal bootable disk under the control of the
Veritas Volume Manager software so it can be mirrored.
SOLUTION SUMMARY:
The disk must have the following file systems:
/ /usr /tmp /var
There must be some swap space allocated on the bootable
disk, or the Veritas software will not encapsulate the disk.
Set up for encapsulation as follows:
* Select two unused slices on the disk and verify that these are
unassigned, 0 (zero) length slices. If there aren't any unused
slices, then they must be made; i.e., if all seven allocated slices
of the disk have been used, the disk cannot be encapsulated.
These two unused slices will become the Volume Manager's private
and public regions.
* Next, try to "steal" two cylinders (at least 2MB are needed) from
the last used slice. It is best to use the two cylinders (or
the amount needed) at the end of the disk. These are not set up
as a slice, they are just not part of the last allocated slice.
This means if slice "g" is the last used slice and extends all the way
to the last cylinder, for example, cylinder number 1254, make
this slice stop at cylinder 1252 instead. This area will be used
by the Veritas software to hold its private region data.
If this space is not allocated for the software to use, it will
take it from the swap area of the disk. So, if swap is at a premium
on this system, allocate the space.
* Encapsulate the disk by running the following from the command line:
# vxdiskadm
* Select "encapsulate disk" from the menu to complete the
encapsulation operation.
Once the disk has been encapsulated, it is readyto be mirrored.
PRODUCT AREA: SunOS Unbundled
PRODUCT: Install
SUNOS RELEASE: Solaris 2.3
HARDWARE: any
66. How can I clone a Sparc Storage Array which is under Veritas control ?
These scripts might prove useful to some of you, to use as-is or
to modify as needed.This is used for cloning purposes.
Here is a script to replicate a SSA plex/subdisk configuration
from a command line instead of each machine doing the GUI work.
This may be of interest to you to take a look at. I thought it
might be useful for say disaster recover purposes.
________________________________________
To make an identical disk storage array set up to the one you have at
another site do the following:
1) at the original site do the command:
# vxprint -t > /tmp/vxprint.out
2) copy the vxprint.out file and the vxawk script to the new site.
3) install the SSA according to the instructions including running the vxinstall script.
4) make an install script with the commands:
# awk -f vxawk vxprint.out > vxscript
# chmod 755 vxscript
5) run the vxscript:
# ./vxscript
6) start the vxva program:
# vxva &
7) select the Volumes button.
8) use the select followed by mutiple adjust mouse buttons to select all the volumes.
9) under the Advanced-Ops/Volume/Initialize Volumes menu chose Active.
10) if needed under Basic-Ops/File-System-Operations chose Make File System.
11) The system should now be ready for operations.
________________________________________
# VXAWK SCRIPT TO CREATE A DUPLICATE DISK STORAGE ARRAY SET-UP.
# THIS CAN BE USED AS A PART OF A RESTORATION PROCEDURE OF
# A DISASTER RECOVERY PLAN, WHERE THE ORIGINAL STORAGE ARRAY
# MUST BE REPLACED IN TOTAL. TO USE IN THIS MANNER A vxprint -t
# OUTPUT FILE MUST BE SAVED IN OFFLINE MEDIA TO ASSIST IN THE
# RECONSTRUCTION OF THE OLD STORAGE ARRAY. SEE ACCOMPANYING
# HOWTO FILE FOR MORE INFORMATION.
#
# AUTHOR: N. Derek Arnold (derek.arnold@cbis.com)
# COMPANY: Cincinnati Bell Information Systems.
# COPYRIGHT: 1995
# EDIT HISTORY:
# 05-28-95 nda (creation)
#
# THIS PROGRAM CONTAINS UNPUBLISHED PROPRIETARY MATERIAL OF CBIS
# (CINCINNATI BELL INFORMATION SYSTEMS INC.). IT MAY NOT BE
# REPRODUCED OR INCLUDED IN ANY OTHER PACKAGES WITHOUT WRITTEN
# CONSENT FROM CBIS. THE INCLUSION OF THIS COPYRIGHT DOES NOT
# IMPLY INTENT TO PUBLISH. ALL RIGHTS, BOTH FOREIGN AND DOMESTIC,
# ARE RESERVED.
#
BEGIN {
print "PATH=$
Unknown macro: {PATH}
:/usr/sbin:/usr/lib/vxvm/bin"
print "export PATH"
print "set -x"
print ""
print "vxconfigd -k"
print ""
{color:#3366ff}}
# DO NOTHING FOR DGs - this should be done by the vxinstall script
# IF disk groups other than root, this could be a problem in that
# we assume that the dg is always root.
# $1 == "dg" {
# print "vxdg init " $2 " nconfig=" $3 " nlog=" $4 " minor=" $5
# print ""
# }
# SAME COMMENT HERE AS FOR DGs
#$1 == "dm" {
# access = substr( $3, 1, 6 )
# print "vxdisksetup " access " privlen=" $5 " publen=" $6
# print "vxdisk init " $3 " type=" $4
# print "vxdg adddisk " $2 "=" $3
# print ""
#}
# NEED TO DO REMAINING.
$1 == "sd" {
split( $7, col, "/" )
print "vxmake sd " $2 " disk=" $4 " offset=" $5 " len=" $6 " column=" col[1]
print ""
if( plex[$3] == "" )
plex[$3] = $2
else
plex[$3] = plex[$3] "," $2
{color:#3366ff}}
$1 == "pl" {
if( $7 == "STRIPE" )
{
split( $8, f, "/" )
tag = " st_width=" f[2] " sd_num=" f[1]
}
else
{
tag=""
}
output = "vxmake plex " $2 " kstate=" $4 " state=" $5
output = output " len=" $6 " iomode=" $9 tag " sd=" plex[$2]
print output
print ""
if( vol[$3] == "" )
vol[$3] = $2
else
vol[$3] = vol[$3] "," $2
{color:#3366ff}}
$1 == "v" {
output = "vxmake vol " $2 " use_type=" $3 " kstate=" $4
output = output " state=" $5 " len=" $6 " read_pol=" $7
output = output " plex=" vol[$2]
print output
print ""
{color:#3366ff}}
{ }
67. How to import rootdg from another host ?
Note: you *can* import the rootdg from system 1 on system 2 with a click
or two from the vxvm GUI after you move the array, however, you will have
to do some serious handwaving to move the array back to its original
configuration.From the Veritas System Administrators Guide, Release 2.0/Jan 95,section 3.7.4.1 Renaming Disk Groups
The following set of steps can be used to temporarily move the rootdg disk group from one host to another
(for repair work on the root volume, forinstance) and then move it back:
1) On the original host, identify the disk group ID of the rootdg disk group to be import to the other host:
# vxdisk -s list
This command results in output that includes disk group information similar to the following.
dgname: rootdg
dgid: 774226267.1025.tweety
2) On the importing host, import and rename the rootdg disk group as
follows:
# vxdg -tC -n "newdg_name" import "diskgroup"
(quotes not needed)
where -t indicates a temporary import name; -C clears import locks; -n specifies a temporary name for the rootdg to be imported (so that it does not conflict with the existing rootdg); and "diskgroup" is the disk group ID of the disk group being imported (774226267.1025.tweety,for example).
If a reboot or crash occurs at this point, the temporarily-imported disk group will become unimported and will require a reimport.
3) After the necessary work has been done on the imported rootdg, deport it back to its original host as follows:
# vxdg -h newhost_id deport diskgroup
where newhost_id is the hostid of the system whose rootdg is being returned (this is the system's namd, which can be confirmed with the command uname -n). This command removes the imported rootdg from the importing host and returns locks to its original host. The originalhost will then autoimport its rootdg on its next reboot.
68. How do I increase the size of a striped mirrored volume ?
This is how I did it, but note that I used the GUI. I found that the autoresizing of the volume did NOT occur when I used the command line interface.At this point I have my two volumes:
vol02 is my larger volume who's plex is going to hold the data eventually: 1) stop vol02
# vxvol -g Daviddg stop vol02
2) Disassociate plex from volume
vxplex -g Daviddg dis vol02-01 (this also sets the volume size to 0 by itself)
vxvol -g Daviddg set len=0 vol02 ( not for command line you need to do this manually)
3) I then remove that volume as I no longer need it
# vxedit -g Daviddg rm vol02
4) time to attach the larger plex to my original volume:
# vxplex -g Daviddg att vol01 vol02-01
Note there is an error at this point when it tries to do a vxpvol set len
command. (I don't get the error when I use the command line interface though)
5) Wait for the sync up, remove the smaller plex :
# vxplex -g Daviddg dis vol01-01
( and a vxvol command comes up to and changes the size of the volume to the larger plex.)
I had to do this by hand using the command line interface.
# vxvol -g Daviddg set len=205632 vol01
vxprint shows the volumes new size:
6) I remove the old plex/subdisks This is what the GUI ran :
# vxedit -g Daviddg rm vol01-01 (plex)
# vxedit -g Daviddg rm David13-01 David14-01 (subdisks)
On the command line I did this which deleted the subdisks too.
# vxedit -g Daviddg -rf rm vol01-01
7) Increase the size of the filesystem with mkfs
Before:
/dev/vx/dsk/Daviddg/vol01 47855 9 43066 0% /foobar
# /usr/lib/fs/ufs/mkfs -F ufs -M /foobar /dev/vx/rdsk/Daviddg/vol01 205632
Warning: 192 sector(s) in last cylinder unallocated
/dev/vx/rdsk/Daviddg/vol02: 205632 sectors in 402 cylinders of 16 tracks, 32 sectors
100.4MB in 26 cyl groups (16 c/g, 4.00MB/g, 1920 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 8256, 16480, 24704, 32928, 41152, 49376, 57600, 65824,
74048, 82272, 90496, 98720, 106944, 115168, 123392, 131104, 139328,
147552, 155776, 164000, 172224, 180448, 188672, 196896, 205120,
# df -k /foobar
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/Daviddg/vol01 96143 9 86524 0% /foobar
Another plex can be added to the vlume to provide protection.
I have done this with files on a volume, and fsck'd the disk afterwards and it all seems fine. YOU MUST take
backups in case things go wrong, and althoughthis works in the lab I am sure you understand I cannot
say this will work for you, although someone from Veritas has looked over this.
69. How do I boot from a SSA ?
you need the following: Fcode 1.33 on the sbus card.
Firmware 1.9 in the array.
Optical Modules rev -03.
2.4 Hardware 3/95.
These are all minimum requirements because:
lower rev fcode: scrambles the world address of the array in
the boot prom, never gets to open the disk device.
lower rev firmware: loadsabugs. not recommended anyway.
lower rev optical modules: give SOC-OFFLINE messages then times
out at the boot prom.
lower rev OS: not got the soc or pln drivers bundled so can't
find the array at boot.
The new firmware is supplied with both SSA 2.0 and 2.1 cd's, the fcode
and the program to check / update this is only with the 2.1 cd.
To update / check the fcode, use the fc_update program as follows:
fc_update [return] will check for SOC cards and bring them
all to the current fcode revision, asking for confirmation
on each one.
fc_update -v [return] will go through the system looking for
SOC cards and reporting the fcode revision levels it finds.
No changes are made to the system.
In order to set up a system to boot from an array without any other
disks during the install, you will need either two cd drives to hold
the OS and SSA cd's, or a copy of the fc_update directory on tape that
you can use.
During the install you will be offered the chance to put the OS onto
any of the array disks, along with any other disks on the system
under the "c0t0d0" naming scheme.
To get the boot device, do not reboot after the install has finished,
instead cd into /dev/dsk, and use ls -l on the boot device. This will
show the full symlink to the /devices entry for the array disk. Remove
the initial "/devices" and the tailing ":a" (for slice 0) and this is
your boot device.
To store the boot device into the eeprom, shutdown the system and use
nvedit. eg for an example ss1000, booting from an array connected to
the SOC in sbus slot 3 on the first system board, with the world address
"a0000000,740d10"
nvedit [return]
0 devalias ssa /io-unit@f,e0200000/sbi@0,0/SUNW,soc@3,0/
SUNW,pln@a0000000,740d10/SUNW,ssd@0,0 [return]
1 [ctrl-c]
nvstore [return]
reset
then you can "boot ssa" to start the system.
70. How can I set the ownership of a volume ?
Say for example you had a volume you wanted to use with sybase
then you'd issue a command something like this.... # vxedit set user=sybase group=sybase mode=600 /dev/vx/dg/volumename
volume manager will set this everytime upon bootup.
71. How do I change the WWN of a Sparc Storage Array ?
It has become evident that there are times when it is advantageous to
change the World-Wide Number (WWN) for a particular SPARCstorage Array
(SSA), such as after replacing the array controller. Up until the
release of Solaris 2.4 HW 3/95 this entailed a delicate sequence of
steps to modify the device tree enough to recognize the new array
controller, download the old address and then restore the original
devices and links to the array disks.Now that the SSA drivers are bundled in the O/S (Sol2.4 3/95 and higher)
this operation can be completed much more easily using the cdrom
shell. The only difficulties that present themselves are obtaining the
old WWN and the fact that the cdrom shell does not include the
ssaadm(1M) or ssacli(1M) utilities. Not to worry, we can do this.
The Procedure:
--------------
1) Boot cdrom and mount O/S
ok boot cdrom -sw ; boot the single-user cdrom shell
# mount -o ro /dev/dsk/c0t0d0s0 /a ; provides RO access to "root"
NOTE: In the case of a single large / (no separate /usr, /opt, etc)
this is all you need to mount. Otherwise, also mount 'usr' and 'opt'
on /a/usr and /a/opt. Use the /a/etc/vfstab for reference.
NOTE2: Use of the "-o ro" mount will prevent superblock consistency
problems in the case of mirrored system disks.
2) Obtain old WWN value
# ls -l /a/dev/dsk/cNt0d0s2 ; where N is old controller #
/dev/dsk/c3t0d0s2 ->../../devices/io-unit@f,e1200000/sbi@0,0/
SUNW,soc@1,0/SUNW,pln@b00008000,201831c9/sd@0,0:c
^^^^^^^^^^^^^
The WWN is 12 digits long made up of the first four digits LEFT
of the comma followed by the next eight digits RIGHT after the
comma (zero fill if necessary). In this case "8000201831c9".
If you happen to have the output of "ssaadm display cN" or
"ssacli display cN" handy the "Serial Num:" field shows the
correct WWN value.
3) Locate the new array controller
# ls -l /dev/dsk/c*t0d0s2 | grep NWWN ; where NWWN is the four digits
; appearing in the SSA display
a match will come from controller N
4) Download the old address to the new controller
/a/opt/SUNWssa/bin/ssacli -s -w 8000201831c9 download cN
OR
/a/usr/sbin/ssaadm download -w 8000201831c9 cN
5) Reset the system
# umount
# halt
Press "Reset" on the back of the SSA.
ok boot
This should NOT require a reconfiguration, and should have you right back
where you started before the SSA controller was replaced.
As you might imagine, this position in the cdrom shell, with working
SSA devices and drivers loaded allows you to accomplish many other
tasks as well.
Don Finch
SunService
History:
10/31/95 - Original document.
11/01/95 - Clarified WWN info, per Manuel Cisnero's input (Thanks!)
03/05/96 - Specified read-only mount for /a to avoid problems with
mirrored system disk configurations. Thanks to Bob Deguc
of the NTC for catching this potential gotcha.
- Removed Power-Cycle of SSA, reset is easier and less apt to cause trouble.
72. When I try to encapsulate the boot disk I get the error "not enough free partitions". Why ?
Basically you need 2 free partitions (1 for the public
region, and 1 for the private region). You can't use slice 2 since this
is the whole disk. Effectively this mean's you need 3 free partition's
to encapsulate the disk. You'd have to repartition the disk making sure
there's 2 free partitions, and then try again...
73. I want to move a Volume out of one dg into another, all the disks in the original dg are part of the Volume. How do I do it ?
In this example we will be moving a volume called "data_vol01"
from a disk group called "old_dg" to a disk group called "new_dg"
and all the disks in disk group "old_dg" are part of this volume
we're also assuming that the diskgroup "new_dg" already exists...the volume is a stripe consisting of 2 disks......
1. list the group that you want to take the volume from..
# vxprint | grep old_dgc2t0d0s2 sliced martin01 old_dg online
c2t1d0s2 sliced martin02 old_dg online2. umount the volume...
# umount /martin13. Display the Configuration
# vxprint -ht -g old_dg| dg | old_dg | default | default | 57000 | 818174277.1121.p4m-ods |
dm martin01 c2t0d0s2 sliced 1519 4152640 -
dm martin02 c2t1d0s2 sliced 1519 4152640 -
v data_vol01 fsgen ENABLED ACTIVE 1024000 SELECT data_vol01-01
pl data_vol01-01 data_vol01 ENABLED ACTIVE 1024496 STRIPE 2/128 RW
sd martin01-01 data_vol01-01 martin01 0 512240 0/0 c2t0d0 ENA
sd martin02-01 data_vol01-01 martin02 0 512240 1/0 c2t1d0 ENA 4. Get the volume config and store it in the file /tmp/movers
# vxprint -hmQq -g old_dg data_vol01 > /tmp/movers5. Stop the Volume
# vxvol -g old_dg stop data_vol016. Remove the volume from the configuration database in that dg
# vxedit -g old_dg -r rm data_vol017. Remove the 1st disk from the disk group
# vxdg -g old_dg rmdisk martin018. Too remove the last disk you have to deport it....
# vxdg deport old_dg9. As the disk group new_dg already exists we don't have to bother
issuing the "vxdg init new_dg martin01=c2t0d0s2" command10. We just add the two disks.....
# vxdg -g new_dg adddisk martin01=c2t0d0s2
# vxdg -g new_dg adddisk martin02=c2t1d0s211. Reload the volume configuration stored in /tmp/movers
# vxmake -g new_dg -d /tmp/movers12. Re-start the volume
# vxvol -g new_dg init active data_vol0113. Mount the volume & check it's ok.....
# mount /dev/vx/new_dg/data_vol01 /martin1
# cd /martin1
# ls -l
total 414592 -rw-r-- 1 root other 2420736 Dec 5 14:03 etc.dir
-rw------T 1 root other 209715200 Dec 5 14:02 hello
drwx------ 2 root root 8192 Dec 5 14:01 lost+found 14. You now need to edit /etc/vfstab so the mount point is correct....
74. How do I import diskgroup's on dual ported SSA's ?
If SSA linked to two systems and one system fails
To list groups out there
# vxdiskadm
8 Enable access to (import) a disk group
list To force the import of a disk group
# vxdg -fC import disk_group To start the volumes
# vxvol -g disk_group -f start vol01 vol02 vol03 etc.. To mount volumes
# mount /dev/vx/dsk/disk_group/vol01 /data01To bring in rootdg disks on SSA into different group
# vxdg -tC -n "
75. How do I Start/Stop a disk tray on a SSA ?
Here's how to spin down and start up a disk try...
# ssaadm stop -t
for example "ssaadm stop -t 2 c3", will stop the 2nd tray on a ssa on controller 3
to restart the tray you use
# ssaadm start -t
for example "ssaadm start -t 2 c3", will start the 2nd tray on a ssa on controller 3
76. How do I get a plex out of being in a stale state ?
If you have a situation where one of the plexes has gone stale
in a Volume, the following *should* re-enable the plex and get you going
again....
# umount /filesystem - umount filesystem
# vxvol -g
# vxplex -g
# vxvol -g
# vxplex -g
77. How do I change the hostname info on the private regions ?
If you want it permanent, do this:see man vxdctl,
# vxdctl hostid
# vxdctl init
this will change the information on the private regions of all disks under VxVm control.
78. Can I encapsulate a disk that has no free space for a private region ?
You can encapsulate a partition with no private slice as follows :
c1t5d0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 20 10.34MB (21/0/0) 21168
1 unassigned wu 0 0 (0/0/0) 0
2 backup wm 0 - 2035 1002.09MB (2036/0/0) 2052288
3 unassigned wu 0 0 (0/0/0) 0
4 unassigned wu 21 - 41 10.34MB (21/0/0) 21168
5 unassigned wu 0 0 (0/0/0) 0
6 unassigned wu 0 0 (0/0/0) 0
7 unassigned wm 2032 - 2035 1.97MB (4/0/0) 4032# prtvtoc /dev/rdsk/c1t5d0s2
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 0 00 0 21168 21167
2 5 00 0 2052288 2052287
4 0 01 21168 21168 42335
7 0 00 2048256 4032 2052287
The following 4 commands adds disk c1t5d0s0 under VM control with no private
region, c1t5d0s0 is added as disk datadg04 in the datadg diskgroup
the vxassist and mount commands just prove everything works ok
# vxdisk -g datadg define c1t5d0s0 type=nopriv# vxdg -g datadg adddisk datadg04=c1t5d0s0
# /usr/sbin/vxassist -g datadg -U fsgen make vol01 10584k layout=nolog datadg04
# /usr/sbin/mount /dev/vx/dsk/datadg/vol01 /d4
79. How can I get iostat to report the disks as c#t#d# instead of sd# ??
In Solaris 2.6 you will have the command iostat -xn, till then....
p4m-ods% iostat -x 30
extended disk statistics
disk r/s w/s Kr/s Kw/s wait actv svc_t %w %b
fd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd1 0.0 0.0 0.0 0.1 0.0 0.0 27.8 0 0
sd12 0.0 0.0 0.0 0.0 0.0 0.0 16.7 0 0
sd24 0.0 0.0 0.0 0.0 0.0 0.0 9.4 0 0
sd29 0.0 0.0 0.0 0.0 0.0 0.0 4.2 0 0
sd3 0.0 0.0 0.0 0.3 0.0 0.0 47.9 0 0
sd32 0.0 0.0 0.0 0.0 0.0 0.0 10.6 0 0
sd34 0.0 0.0 0.0 0.0 0.0 0.0 10.6 0 0
sd39 0.0 0.0 0.0 0.0 0.0 0.0 15.6 0 0
sd7 0.0 0.0 0.0 0.0 0.0 0.0 10.5 0 0
p4m-ods%
Well you have to look at /etc/path_to_inst and work it out this way....
or you can use these 2 scripts written by Bede.Seymour@corp
------------------------- iostatctbl.sh ------------------------
#!/bin/sh
# iostatctbl.sh
#
# ("IOSTAT Create TaBLe")
# Script that creates a mapping between BSD/UCB names and SVR4 names
# of disk devices
rm -f /tmp/iostatctbl.tmp /var/tmp/iostatctbl.out
ls -l /dev/rdsk/*s0 > /tmp/iostatctbl.tmp
iostat -x | tail +3 | nawk '
Unknown macro: { dnameucb=$1 ucbprefix=substr(dnameucb,1,match(dnameucb,"[0-9]")-1) inst=substr(dnameucb,match(dnameucb,"[0-9]")) grepcmd=sprintf("grep "/%s@" /etc/path_to_inst | grep " %s$"n",ucbprefix,inst) printf("%s",dnameucb) system(grepcmd) }
' | nawk ' BEGIN
Unknown macro: {FS="""}
Unknown macro: { printf("%s ",$1) newgrepcmd=sprintf("grep %s /tmp/iostatctbl.tmpn",$2) system(newgrepcmd)}' | nawk '{ split($10,carray,"/") print $1,carray[4]}' > /var/tmp/iostatctbl.out\ \ echo "Table created - see /var/tmp/iostatctbl.out"rm -f /tmp/iostatctbl.tmpexit 0 --------------------------------- iostatx -------------------------------- #!/bin/sh\#\# iostatx - do iostat -x but substitute ucb names for svr4 names ./iostatctbl.shmv /var/tmp/iostatctbl.out /var/tmp/iostatctbl.out.oldcat /var/tmp/iostatctbl.out.old | sed s/fd0//g > /var/tmp/iostatctbl.out iostat -x 10 | nawk 'BEGIN{ i=1 ucblist="" while (getline Entry <"/var/tmp/iostatctbl.out"){ split(Entry,earray," ") ucbname=earray[1] svr4name[ucbname]=substr(earray[2],1,6) ucblist=sprintf("%s %s",ucblist,ucbname) }
}
Unknown macro: { if (match(ucblist,$1) != 0) printf("%-7s%sn",svr4name[$1],substr($0,8)) else print }
' exit 0
Save the 2 files and issue the command ./iostat and you'll get something looking like this.....
}p4m-ods% ./iostatx
Table created - see /var/tmp/iostatctbl.out
extended disk statistics
disk r/s w/s Kr/s Kw/s wait actv svc_t %w %b
fd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
c0t1d0 0.0 0.0 0.0 0.1 0.0 0.0 27.8 0 0
c1t1d0 0.0 0.0 0.0 0.0 0.0 0.0 16.7 0 0
c1t2d0 0.0 0.0 0.0 0.0 0.0 0.0 9.4 0 0
c1t3d0 0.0 0.0 0.0 0.0 0.0 0.0 4.2 0 0
c0t3d0 0.0 0.0 0.0 0.3 0.0 0.0 48.0 0 0
c1t3d3 0.0 0.0 0.0 0.0 0.0 0.0 10.6 0 0
c1t4d0 0.0 0.0 0.0 0.0 0.0 0.0 10.6 0 0
c1t5d0 0.0 0.0 0.0 0.0 0.0 0.0 15.6 0 0
c1t0d0 0.0 0.0 0.0 0.0 0.0 0.0 10.5 0 0
80. How can I get round the error volume locked by another utility when trying to detach a plex ?
I have found a way to clear the following error message WITHOUT
rebooting the machine or stopping access to any veritas volumes.vxvm:vxplex: ERROR: Plex vol01-02 in volume vol01 is locked by another utility
$ vxprint vol01
Disk group: datadg | TY | NAME | ASSOC | KSTATE | LENGTH | PLOFFS | STATE | TUTIL0 | PUTIL0 |
v vol01 fsgen ENABLED 3072384 - ACTIVE ATT1 -
pl vol01-01 vol01 ENABLED 3072384 - ACTIVE - -
sd trash02 vol01-01 ENABLED 1024128 0 - - -
sd trash01 vol01-01 ENABLED 1024128 0 - - -
sd trash03 vol01-01 ENABLED 1024128 0 - - -
pl vol01-02 vol01 ENABLED 3072448 - TEMP ATT -
sd datadg05-01 vol01-02 ENABLED 1536192 0 - - -
sd datadg04-01 vol01-02 ENABLED 1536192 0 - - - If you look at the TUTIL field you can see some flags set, what you need to do is clear these flags,
Hence if we try to detach the plex now we get the error
$ vxplex -g datadg det vol01-02
vxvm:vxplex: ERROR: Plex vol01-02 in volume vol01 is locked by another utility
the procedure to get this volume back up and running would be as
follows
$ vxmend clear tutil vol01-02
$ vxmend clear tutil vol01
$ vxplex -g datadg det vol01-02
$ vxrecover -s
Hey presto everything is back as it should be.81. Veritas Volume Manager Disaster Recovery
When to use this guide :
This guide will be useful when a customer has experienced file system corruption and is no longer
able to boot the system. If this system was under Volume Manager control (i.e encapsulated) and the
customer had data volumes in the root disk group, then this procedure is designed to help you recover
the configuration.
Step 1 : booting from underlying devices
o boot from cdrom to get a memory resident Solaris kernel
ok boot cdrom -sw
o the following steps needs to be followed to return to underlying devices
# mount /dev/dsk/c0t0d0s0 /a (where c0t0d0 is the system disk)
# cd /a/etc
# cp /etc/prevm.vfstab vfstab
- modify /etc/system and comment out the following lines
rootdev:/pseudo/vxio@0:0
set vxio:vol_rootdev_is_volume=1
# cd /a/etc/vx/reconfig.d/state.d
# rm root-done
# touch install-db
- note that install-db should be the only file in this directory
# cd /
# umount /a
ok boot
o At this point the customer could simply restore his filesystems from backups.
If this is possible, then restoring the data may be all that is required. This will
put back the modifications which we have made and all should be well. All that
will be required after the data restore is to reboot the machine. No modifications
will have been made to the Volume Manager configuration.
Step 2 : Re-enabling the Volume Manager configuration
o If the customer needs to re-install the Solaris OS, then we get a little more involved.
The customer will also have to install the Volume Manager software. This is still OK
since we will not be affecting his other data in rootdg.
- install the Solaris OS
- install the Volume Manager software
- install the relevant OS/Volume Manager patchespatch matrix
- reboot
o If we are lucky, the following set of commands may bring back our Volume Manager configuration.
However it is not guaranteed to work every time.
# rm /etc/vx/reconfig.d/state.d/install-db
# vxiod set 10
# vxconfigd -d
# vxdctl init
# vxdctl enable
# init 6
o If this has brought back the Volume Manager configuration, the we should be able to list the
disks/configuration.
# vxprint -Ath
# vxdisk list
You may have to start the volumes before being able to fsck/moun them.
# vxvol -g
# fsck -n /dev/vx/rdsk/
# mount -r /dev/vx/dsk/
o If it hasn't brought back the configuration, then we will need to create a new rootdg, temporarily
import the old rootdg and then export the volumes to a new disk group. This is quite an involved
procedure and you should inform the customer that this may take some time.
Step 3 : Re-encapsulating a new rootdg
o Firstly we need to do an encapsulation of the root disk. To do this, we must first return to
underlying devices as described in Step 1 above. Once this has completed, run the following :
# vxinstall
o Please use with caution. Use the "custom" installation; if your root disks in on controller 0 (c0),
when 'c0' disks are listed, tell vxinstall to do them individually; select 'encapsulation' for the bootable
disk only; select 'leave these disks alone' for all the rest on 'c0'. For all other controllers that are be
listed, tell vxinstall to 'leave these disks alone'. DO NOT BREAK OUT OF THIS UTILITY] (i.e.: control-C).
This will place the bootable disk as a rootdg disk and when the vxinstall is finished it will tell you to
reboot the system.
o When the system is rebooted, we will now have a new rootdg which simply contains our system disk.
Our next step is to import the old rootdg into our new rootdg and recover our volumes.
Step 4 : Importing the old rootdg
o Now we must first get the disk group ID. This is done with the command :
# vxdisk -s list
o This should give us something similar to :
dgname: rootdg
dgid: 793279366.1025.npgts59
o This information is then used to import the original rootdg into our new rootdg :
# vxdg -tC -n
- where -t indicates a temporary import name
- where -C clears import locks
- where -n specifies a temporary name for the rootdg to be imported so that it does
not conflict with the existing rootdg
o Sometimes this may fail with the error : disk c0t0d0s2 names rootdg but groupid differs.
We may also see the error on reboot regarding : insufficient config copies. This is because
Volume Manager can still only see the system disk (and perhaps mirror) in rootdg but no
other disks.
This can be resolved by using the -f flag (force) with the import.
# vxdg -tfC -n
o The rootdg should now hold the new rootdg and the old rootdg using a different name.
Step 5 : Recovering the data in old rootdg permanently
o At this point, if we rebooted the machine, we would loose our temporary imported old rootdg.
We need a way of keeping this diskgroup permanent. At this point we would suggest to our
customer to keep these volumes seperate from the rootdg, i.e. keep them in a datadg. Why ?
well from a support point of view, it makes recovery much easier.
o To do this, we first of all get a listing of the configuration as it is at the moment :
# vxprint -vpshmQq -g
# vxdisk list > /tmp/vxdisk.list
o Now that we have this configuration information, we deport the old rootdg and create a
brand new diskgroup,
# vxdg deport
o Now that the disk group is deported again, we must place the disks which were originally in the rootdg
into this new disk group. Referring to our /tmp/vxdisk.list file, ensuring the disks are using their
original accessname :
# vxdg init
o Add each of the other disks back into the diskgroup as folows :
# vxdg -g
o Repeat this for every disk in the disk group. Now, we remake our volume configuration.
# vxmake -g
o Next step is to restart the volumes. This step may or may not be necessary.
# vxvol -g
o Repeat this step for every volume. The 'startall' option sometimes doesn't appear to work at this point.
o Finally, simply fsck the volumes and mount them.
# fsck -n /dev/vx/rdsk/
# mount -r /dev/vx/dsk/
o If this is successful, then you simply configure the /etc/vfstab to reflect the changes and that completes
the recover.
o Remember to remove the /etc/vx/reconfig.d/state.d/install-db file as on reboot you may run into
problems such as "illegal vminor encountered".
________________________________________
Veritas Volume Manager - Miscellaneous
----82. Can I use prestoserve with the SSA ?
Yes you can. Follow this procedure :
exclude: drv/pr
2. edit /etc/init.d/vxvm-startup2
add
modload /kernel/drv/pr
presto -p > /dev/null
3. edit /etc/init.d/prestoserve
replace presto -u
with presto -u filesystems.....
NOTE: don't prestoserve / , /usr, /var, acceleartion of these filesystems
could lead to data corruption since the filesystems checks for / /usr,
/usr/kvm, /var and /var/adm will precede the flushing of prestoserve buffers
if you're using ODS see bug 121971383. Can I grow my root filesystem online ?
Yes you can. Here's what I did. I only had a root filesystem. On machines with /usr, /opt, /var you will have to
repeat certain stages but it should work the same.
Total disk cylinders available: 1151 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 1058 372.30MB (1059/0/0)
1 swap wu 1061 - 1150 31.64MB (90/0/0)
2 backup wm 0 - 1150 404.65MB (1151/0/0)
3 - wu 0 - 1150 404.65MB (1151/0/0)
4 - wu 1059 - 1060 0.70MB (2/0/0)
5 unassigned wm 0 0 (0/0/0)
6 unassigned wm 0 0 (0/0/0)
7 unassigned wm 0 0 (0/0/0)
Total disk cylinders available: 2733 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 1347 1000.47MB (1348/0/0)
1 swap wu 1348 - 1477 96.48MB (130/0/0)
2 backup wu 0 - 2732 1.98GB (2733/0/0)
3 - wu 0 0 (0/0/0)
4 - wu 0 0 (0/0/0)
5 unassigned wm 0 0 (0/0/0)
6 unassigned wm 0 0 (0/0/0)
7 unassigned wm 1478 - 2732 931.45MB (1255/0/0)
newfs the root filesystem.
install a boot block on the disk.
# /usr/sbin/installboot /usr/lib/fs/ufs/bootblk /dev/rdsk/c?t?d?s0
nvalias ssa /iommu/sbus/SUNW,soc@3,0/SUNW,pln@a0000000,777ec6/SUNW,ssd@0,0
set the boot-device from the ok prompt
setenv boot-device ssa
Remove the old rootvol and swapvol which are there but not mounted
choose: Encapsulate one or more disks
follow instructions
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/rootvol 962582 202482 663850 23% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
swap 90752 16 90736 0% /tmp
To remove these disks
(select the disk)
ADVANCED OPS=>DISK GROUP=>REMOVE DISKS
(/usr/sbin/vxdg -g rootdg rmdisk diskname)
84. Can I change the hostname of a machine without affecting Volume Manager ?
Here is what I have done to sucessfully reassociate a rootdg with a machine....
1) Find a disk in the rootdg.......
map flag 15 to the appropriate slice on disk
and plug that slice into the vxprivutil
2) Run the vxprivutil on the private region of the disk in rootdg.....
diskid: 794106338.2119.maggie
group: name=unix2dg id=795205483.1201.schwing
flags: private autoimport
hostid: schwing
version: 2.1
iosize: 512
public: slice=4 offset=0 len=2050272
private: slice=3 offset=1 len=2015
update: time: 795465445 seqno: 0.45
headers: 0 248
configs: count=1 len=1456
logs: count=1 len=220
3) Notice the hostid in the private region, I want it to belong to "maggie" not
"schwing".
4) So I change the hostid.......
5) Run the procedure in Appendix E................
85. Can I move Volumes from one diskgroup to another ?
Moving Populated Volume Manager Disks between Disk Groups
=========================================================
Roger B.A. Klorese 10/20/94
This is Totally UNSUPPORTED, but it is possible !!!
below is an example of how to do it.....
1) Assume I intend to move volumes vol02 and vol04 from the disk group olddg to a new group, newdg.
# dd of=/dev/vx/rdsk/olddg/vol02 conv=sync
This is the content of vol02.
^D
0+1 records in
1+0 records out
# dd of=/dev/vx/rdsk/olddg/vol04 conv=sync
This is the content of vol04.
^D
0+1 records in
1+0 records out
# dd if=/dev/vx/rdsk/olddg/vol02 count=1
This is the content of vol02.
1+0 records in
1+0 records out
# dd if=/dev/vx/rdsk/olddg/vol04 count=1
This is the content of vol04.
1+0 records in
1+0 records out
2) Get a list of disks in the disk group you intend to split.
3) Get the configuration.
dg olddg 782676710.2488.dustbuster
dm olddg01 c1t0d0s2 sliced 2015 2050272 /dev/rdsk/c1t0d0s4 -
dm olddg02 c1t2d0s2 sliced 2015 2050272 /dev/rdsk/c1t2d0s4 -
dm olddg03 c1t4d0s2 sliced 2015 2050272 /dev/rdsk/c1t4d0s4 -
dm olddg04 c1t1d0s2 sliced 2015 2050272 /dev/rdsk/c1t1d0s4 -
dm olddg05 c1t5d0s2 sliced 2015 2050272 /dev/rdsk/c1t5d0s4 -
dm olddg06 c1t0d1s2 sliced 2015 2050272 /dev/rdsk/c1t0d1s4 -
dm olddg07 c1t2d1s2 sliced 2015 2050272 /dev/rdsk/c1t2d1s4 -
dm olddg08 c1t4d1s2 sliced 2015 2050272 /dev/rdsk/c1t4d1s4 -
dm olddg09 c1t1d1s2 sliced 2015 2050272 /dev/rdsk/c1t1d1s4 -
dm olddg10 c1t5d1s2 sliced 2015 2050272 /dev/rdsk/c1t5d1s4 -
v vol01 gen ENABLED ACTIVE 4194304 SELECT -
pl vol01-01 vol01 ENABLED ACTIVE 4194304 CONCAT - RW
sd olddg01-01 vol01-01 olddg01 0 2050272 0 -
sd olddg02-01 vol01-01 olddg02 0 2050272 2050272 -
sd olddg03-01 vol01-01 olddg03 0 93760 4100544 -
v vol02 fsgen ENABLED ACTIVE 2050268 SELECT -
pl vol02-01 vol02 ENABLED ACTIVE 2050268 CONCAT - RW
sd olddg08-01 vol02-01 olddg08 0 4 LOG -
sd olddg08-02 vol02-01 olddg08 4 2050268 0 -
pl vol02-02 vol02 ENABLED ACTIVE 2050268 CONCAT - RW
sd olddg09-01 vol02-02 olddg09 0 4 LOG -
sd olddg09-02 vol02-02 olddg09 4 2050268 0 -
v vol03 fsgen ENABLED ACTIVE 1024000 SELECT -
pl vol03-01 vol03 ENABLED ACTIVE 1024000 CONCAT - RW
sd olddg10-01 vol03-01 olddg10 0 1024000 0 -
v vol04 fsgen ENABLED ACTIVE 4194304 SELECT vol04-01
pl vol04-01 vol04 ENABLED ACTIVE 4194304 STRIPE 4/128 RW
sd olddg04-01 vol04-01 olddg04 0 1048576 0/0 -
sd olddg05-01 vol04-01 olddg05 0 1048576 1/0 -
sd olddg06-01 vol04-01 olddg06 0 1048576 2/0 -
sd olddg07-01 vol04-01 olddg07 0 1048576 3/0 -
4) Determine which disks contain the volumes to be moved. Insure that all
volume allocations are self-contained in the set of disks to be moved.
In this case, my volumes are contained on disks olddg04 through olddg09,
with no unassociated plexes or subdisks, and no allocations which cross
out of this set of disks.
5) Save the configuration, in a format that can be plugged back into
the vxmake utility. Specify all volumes on the disks in question (plus
any unassociated plexes and their child subdisks, plus any unassociated
subdisks).
6) Unmount the appropriate file systems, and/or stop the processes
which hold the volumes open.
7) Stop the volumes.
8) Remove from the configuration database the definitions of the
structures (volumes, plexes, subdisks) to be moved. (NOTE that this
does not affect your data.)
9) Remove the disks from the original diskgroup.
10) Initialize the new diskgroup using one of your disks. DO NOT
reinitialize the disk itself. (vxdisk init). (If you are moving the disks
to a disk group that already exists, skip this step.) It is simplest to
keep their old names until a later step.
11) Add the rest of the moving disks to the new disk group.
12) See the disks in the new disk group.
13) Reload the object configuration into the new disk group.
14) Bring the volumes back on-line.
15) Observe the configuration of the new disk group.
dg newdg 782682285.2491.dustbuster
dm olddg04 c1t1d0s2 sliced 2015 2050272 /dev/rdsk/c1t1d0s4 -
dm olddg05 c1t5d0s2 sliced 2015 2050272 /dev/rdsk/c1t5d0s4 -
dm olddg06 c1t0d1s2 sliced 2015 2050272 /dev/rdsk/c1t0d1s4 -
dm olddg07 c1t2d1s2 sliced 2015 2050272 /dev/rdsk/c1t2d1s4 -
dm olddg08 c1t4d1s2 sliced 2015 2050272 /dev/rdsk/c1t4d1s4 -
dm olddg09 c1t1d1s2 sliced 2015 2050272 /dev/rdsk/c1t1d1s4 -
v vol02 fsgen ENABLED ACTIVE 2050268 SELECT -
pl vol02-01 vol02 ENABLED ACTIVE 2050268 CONCAT - RW
sd olddg08-01 vol02-01 olddg08 0 4 LOG -
sd olddg08-02 vol02-01 olddg08 4 2050268 0 -
pl vol02-02 vol02 ENABLED ACTIVE 2050268 CONCAT - RW
sd olddg09-01 vol02-02 olddg09 0 4 LOG -
sd olddg09-02 vol02-02 olddg09 4 2050268 0 -
v vol04 fsgen ENABLED ACTIVE 4194304 SELECT vol04-01
pl vol04-01 vol04 ENABLED ACTIVE 4194304 STRIPE 4/128 RW
sd olddg04-01 vol04-01 olddg04 0 1048576 0/0 -
sd olddg05-01 vol04-01 olddg05 0 1048576 1/0 -
sd olddg06-01 vol04-01 olddg06 0 1048576 2/0 -
sd olddg07-01 vol04-01 olddg07 0 1048576 3/0 -
16) Test the data. Remember that the device names have changed to refer
to newdg instead of olddg; you'll need to modify /etc/vfstab and/or your
database configurations to reflect this. Then you'd mount your file
systems, start your database engines, etc.
17) Note that the original database is intact, though the disk naming is
a bit odd. You *can* rename your disks and their subdisks to reflect the
change. This is optional.
dg olddg 782676710.2488.dustbuster
dm olddg01 c1t0d0s2 sliced 2015 2050272 /dev/rdsk/c1t0d0s4 -
dm olddg02 c1t2d0s2 sliced 2015 2050272 /dev/rdsk/c1t2d0s4 -
dm olddg03 c1t4d0s2 sliced 2015 2050272 /dev/rdsk/c1t4d0s4 -
dm olddg10 c1t5d1s2 sliced 2015 2050272 /dev/rdsk/c1t5d1s4 -
v vol01 gen ENABLED ACTIVE 4194304 SELECT -
pl vol01-01 vol01 ENABLED ACTIVE 4194304 CONCAT - RW
sd olddg01-01 vol01-01 olddg01 0 2050272 0 -
sd olddg02-01 vol01-01 olddg02 0 2050272 2050272 -
sd olddg03-01 vol01-01 olddg03 0 93760 4100544 -
v vol03 fsgen ENABLED ACTIVE 1024000 SELECT -
pl vol03-01 vol03 ENABLED ACTIVE 1024000 CONCAT - RW
sd olddg10-01 vol03-01 olddg10 0 1024000 0 -
# vxedit rename olddg10 olddg04
# vxprint -g olddg -s -e "name~/olddg10/"
TYPE NAME ASSOC KSTATE LENGTH COMMENT
sd olddg10-01 vol03-01 - 1024000
# vxedit rename olddg10-01 olddg04-01
# vxprint -g olddg -ht
DG NAME GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN PUBPATH FLAGS
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WDTH MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF FLAGS
dg olddg 782676710.2488.dustbuster
dm olddg01 c1t0d0s2 sliced 2015 2050272 /dev/rdsk/c1t0d0s4 -
dm olddg02 c1t2d0s2 sliced 2015 2050272 /dev/rdsk/c1t2d0s4 -
dm olddg03 c1t4d0s2 sliced 2015 2050272 /dev/rdsk/c1t4d0s4 -
dm olddg04 c1t5d1s2 sliced 2015 2050272 /dev/rdsk/c1t5d1s4 -
v vol01 gen ENABLED ACTIVE 4194304 SELECT -
pl vol01-01 vol01 ENABLED ACTIVE 4194304 CONCAT - RW
sd olddg01-01 vol01-01 olddg01 0 2050272 0 -
sd olddg02-01 vol01-01 olddg02 0 2050272 2050272 -
sd olddg03-01 vol01-01 olddg03 0 93760 4100544 -
v vol03 fsgen ENABLED ACTIVE 1024000 SELECT -
pl vol03-01 vol03 ENABLED ACTIVE 1024000 CONCAT - RW
sd olddg04-01 vol03-01 olddg04 0 1024000 0 -
18) Do the same for the disks in newdg and their subdisks.
# vxprint -g newdg -e "name~/olddg/"
TYPE NAME ASSOC KSTATE LENGTH COMMENT
sd olddg04-01 vol04-01 - 1048576
sd olddg05-01 vol04-01 - 1048576
sd olddg06-01 vol04-01 - 1048576
sd olddg07-01 vol04-01 - 1048576
sd olddg08-01 vol02-01 - 4
sd olddg08-02 vol02-01 - 2050268
sd olddg09-01 vol02-02 - 4
sd olddg09-02 vol02-02 - 2050268
# vxedit rename olddg04 newdg01
# vxedit rename olddg05 newdg02
# vxedit rename olddg06 newdg03
# vxedit rename olddg07 newdg04
# vxedit rename olddg08 newdg05
# vxedit rename olddg09 newdg06
# vxedit rename olddg04-01 newdg01-01
# vxedit rename olddg05-01 newdg02-01
# vxedit rename olddg06-01 newdg03-01
# vxedit rename olddg07-01 newdg04-01
# vxedit rename olddg08-01 newdg05-01
# vxedit rename olddg09-01 newdg06-01
# vxedit rename olddg08-02 newdg05-02
# vxedit rename olddg09-02 newdg06-02
# vxprint -g newdg -ht
DG NAME GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN PUBPATH FLAGS
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WDTH MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF FLAGS
dg newdg 782682285.2491.dustbuster
dm newdg01 c1t1d0s2 sliced 2015 2050272 /dev/rdsk/c1t1d0s4 -
dm newdg02 c1t5d0s2 sliced 2015 2050272 /dev/rdsk/c1t5d0s4 -
dm newdg03 c1t0d1s2 sliced 2015 2050272 /dev/rdsk/c1t0d1s4 -
dm newdg04 c1t2d1s2 sliced 2015 2050272 /dev/rdsk/c1t2d1s4 -
dm newdg05 c1t4d1s2 sliced 2015 2050272 /dev/rdsk/c1t4d1s4 -
dm newdg06 c1t1d1s2 sliced 2015 2050272 /dev/rdsk/c1t1d1s4 -
v vol02 fsgen ENABLED ACTIVE 2050268 SELECT -
pl vol02-01 vol02 ENABLED ACTIVE 2050268 CONCAT - RW
sd newdg05-01 vol02-01 newdg05 0 4 LOG -
sd newdg05-02 vol02-01 newdg05 4 2050268 0 -
pl vol02-02 vol02 ENABLED ACTIVE 2050268 CONCAT - RW
sd newdg06-01 vol02-02 newdg06 0 4 LOG -
sd newdg06-02 vol02-02 newdg06 4 2050268 0 -
v vol04 fsgen ENABLED ACTIVE 4194304 SELECT vol04-01
pl vol04-01 vol04 ENABLED ACTIVE 4194304 STRIPE 4/128 RW
sd newdg01-01 vol04-01 newdg01 0 1048576 0/0 -
sd newdg02-01 vol04-01 newdg02 0 1048576 1/0 -
sd newdg03-01 vol04-01 newdg03 0 1048576 2/0 -
sd newdg04-01 vol04-01 newdg04 0 1048576 3/0 -
#
86. Can I test the SOC card from the OK prompt ?
from open boot prom
OK>" /io-mmu@f---xx" select-dev
OK>soc-selftest
Output from command: there is a space between the " and the iommu path"
<#0> ok " /io-unit@f,e0200000/sbi@0,0/SUNW,soc@3,0" select-dev
<#0> ok soc-selftest
Selftest in progress...
checking forward pattern...
checking reverse pattern...
SOC External memory Test -- Passed
SOC POST Test -- Passed
test communications bits
test communications parameters
test communications parameters sram
test idle bit
test slave error bit
SOC Register Test -- Passed
SOC Port A Internal Transmit/Receive Test -- Passed
SOC Port B Internal Transmit/Receive Test -- Passed
SOC Port A OLC Transmit/Receive Test -- Passed
SOC Port B OLC Transmit/Receive Test -- Timeout reached waiting for SOC
Failed
<#0> ok87. Can I restore the rootdisk from backup ?
Providing only the boot disk is in the rootdg you can do the following...
1. restore data and installboot block
2. copy /etc/vfstab, and in the current vfstab, comment out all veritas mount points..
3. arrange vfstab so it mounts the /dev/dsk and /dev/rdsk dev's only
change
4. comment out the volume manager stuff in /etc/system, see below
5. touch /etc/vx/reconfig.d/state.d/install-db
6. reboot
7. run vxinstall, encapsulated the boot disk only !!
8. reboot
9. copy back the original /etc/vfstab
10. mountall
11. re-mirror rootdisk if required.
88. Can I make my SparcStation wait for the SSA to spin up ?
This program will be stored in the Boot PROM of the Sparc Station's
(non-volatile memory - NVRAM ), and will delay the boot sequence for 80 seconds.
This delay will give sufficient time for the power-on confidence test of the
SPARC Storage Array to be completed before the boot is attempted.
The program is written in the Forth programming language, as used by the Boot
PROM, and is entered using the "nvedit" editor.
at the "ok" boot prompt :
The non-volatile memory has probably already been programmed with a device
alias for the SSA (so that a boot command of "boot ssa" can be used, instead
of a complex full device name ).
To check this, enter
ok devalias <<< this will give a list of the standard aliases, and there probably
will be an additional one for the SSA
ok printenv use-nvramrc? <<< this should be say "true"
IF NOT, enter
ok setenv use-nvramrc? true
Then start the nvedit editor :
ok nvedit <<< this will display line 0 of the NVRAM memory, which will
probably contain the original command used to set up the
SSA device alias, such as :
0: devalias ssa /io-unit......etc.....etc
To leave this line undisturbed, enter Ctrl N ( = move to next line in
Editor )
You will then get line number 1 , which should be a blank line.
Enter the commands for the delay program ( 8 lines ), exactly as follows :
( " ^ " equals "spacebar" ) ( " C/R " equals "return" )
ok nvstore << to store Editor buffer into NVRAM chip
ok nvramrc eval << this will execute the stored program, i.e. the delay
will start, and count up to 79 on the screen, to test
that the program was keyed in correctly. It will not
boot the SSA at this point.
Then the system can be rebooted, from the SSA, including the delay, by entering :
ok reset
( In case of any errors whilst keying-in the program, here are some useful
command for the nvedit editor :
Ctrl B Back one character
Ctrl F Forward one character
Del Delete the previous character
Ctrl K Delete the next line
Ctrl N Move to next line
Ctrl P Move to previous line
Ctrl L List all lines
Ctrl C Exit the editor. )
89. Can I move a SSA to a new system and preserve the data ?
OK. It's easy to do and it's even documented (incompletely, but...)
in the SSA Volume Manager System Administrator's Guide (802-1242-10),
Appendix B, Topic 7 Reinstallation Recovery.
In essence, it's easiest if you already have a rootdg on the receiving system
and the volumes in question are in some other group. Nevertheless, I didn't
have that luxury so here is what to do. This also assumes I'm not going
to need to use the existing system after the SSA is moved or I'm going to
reinstall it. I also am not going to have an encapsulated root on the receiving
system, at least not initially.
Target System:
Receiving System (with same host name):
You should now issue "vxdisk list", "vxprint -SA", and "vxprint -g groupname"
to insure that all your disks are seen and that the configuration is
recognized.
The next parts are undocumented but necessary in order to automate startup
and update vfstab entries.
10. Change to multi-user status. (CTRL-D)
11. Bring up openwin and start vxva (volume manager)
12. Select world or group view.
13. Select volume to mount (refer to vxprint -SA)
14. Select Advanced->Volume-Start or START-all
15. Select Basic->Filesystem->Mount
16. Fill in pop-up menu for volume's mountpoint and select mount at startup
17. Do the same for all other volumes necessary.
18. Your mountpoints have now been created and the entries recreated in
/etc/vfstab.
90. Can I have a rootdg without encapsulating the root disk ?
SRDB ID: 11136
SYNOPSIS: How to setup a rootdg without encapsulating a disk
DETAIL DESCRIPTION:
In many cases it is not desirable to encapsulate a disk (usually the
bootdisk) to set up a rootdg disk group. The rootdg disk group is
mandatory with current releases of VXVM, this procedure bypasses
the need to encapsulate a disk but still allows a rootdg.
The procedure is as follows:
1. Set the initial operating mode to disable. This disables
transactions and creates the rendevous file install-db,
for utilities to perform diagnostic and initialization
operations.
vxconfigd -m disable
Verify with ps afterward:
(ps -ef | grep vxconfigd)
2. Initialize the database:
vxdctl init
3. Make the rootdg disk group:
vxdg init rootdg
4. Add a simple slice (usually about two cylinders in size):
vxdctl add disk cWtXdYsZ type=simple
Note: A warning message will appear here.
5. Add disk records:
vxdisk -f init cWtXdYsZ type=simple
6. Add slice to rootdg:
vxdg adddisk cWtXdYsZ
7. Enable transactions:
vxdctl enable
8. Remove this file; the volume manager will not activate if this
file exists.
rm /etc/vx/reconfig.d/state.d/install-db
91. Can I increase the size of the private region ?
The private region of a disk is specified by using the privlen option to the vxdisksetup
cammand. For example,
# vxdisksetup -i c1t0d0 privlen=2048
92. Cannot import Diskgroup - "No configuration copies"
This is a very rare occurrance, but is one of the most frustrating.
Why did this happen ?
The private data regions are accessed frequently by the Veritas kernel,
it is always updating status information in the private regions.
We cannot say exactly what causes this, nither can we definitively state
that all the private regions were totally bad.
What we can say is that this is very rare.
We have not been able to reproduce it, so it isn't easy to pinpoint for a
complete fix that would prevent it from ever happening.
The only way we can reproduce it is to physically overwrite all the private
regions on all the disks.
If even one disk is not overwritten, it can and will pull in the diskgroup.
How do we over come the problem
-------------------------------
The following proceedure needs an existing rootdg and volume manager running,
so it is not applicable for a lost rootdg.
To reconstruct the configuration
--------------------------------
To get the configuration back we would like to use a copy of the configuration
that was taken when the system was running ok with the commands.
# vxprint -hmQqspv -D - > /
# vxdisk list
This last command gives you a list of access name and media name
pairs.
If this happens and the customer does not have copies of the configuration
when the system was good, we have in tha past run the following command.
If this method is used the customer has to be able to check the configuration
and data as there is no garrantee that this is latest configuration.
# /etc/vx/diag.d/vxprivutil dumpconfig /dev/rdsk/cXtXdXs2 | \
vxprint -hmQqspv -D - > /
NB. You may well have to grep out the access name and media name
pairs from the output file.
Once you have the configuration from above you can create the group as follows.
Create the new disk group
-------------------------
NB. Disk names MUST correspond to the same disks exactly as they were
originally (see you backup copy vxdisk list output).
We also need a list of the names which equate to the physical disks,
this can be obtained be keeping the output from 'vxdisk list' or
it will have to be grep'ed out of the tempory file.
. Initalise the diskgroup, using one of the disks from the lost disk
group.
# vxdg init
NB. Substitute the disk group, disk access name and media name
from the saved vxdisk list output.
Example
# vxdg init datadg disk01=c2t0d0s2
. Add in the rest of the disks.
# vxdg -g new_data_dg adddisk
. Recreate the volume(s) configuration from the configuration file.
# vxmake -g
NB. If this fails saying input file too large, then split the
file up and run the above for each one.
In most cases it works, its just for very large configurations
and then we have only split it into two pieces.
You can use the above command with the -V option which will
go through the motions but not actually do anything.
. Now bring the volumes back online.
# vxvol -g
93. My volume is ENABLED/SYNC but doesn't appear to be syncing. What do I do ?
#vxvol -f -g [dg] resync [vol]
This will force the volume to resync.
94. How can I view the contents of my Private R egion ?
95. I need to change the hostname in my Private Regions and my /etc/vx/volboot file. How do I do it ?
96. Veritas has changed my VTOC layout when it encapsulated my rootdisk. How do I recover my original VTOC?
97. My volume won't start. I think it may be due to my volume not on a cylinder boundary. How can I determine if this is true ?
This block should then be divisable into the length and offset value which you get for a volume in a vxprint output from Veritas. If the offset value for the volume is not devisable by the number of blocks per cylinder found above, then the volume does not start on a cylinder boundary. If the length is not divisable by the number of blocks per cylinder, then it doesn't end on a cylinder boundary.
Note that on occasions, you will be left with an extra block. This is normal and is believed to be used for disk label preservation.
98. Why can't I simply mirror back my seconday rootdisk mirror to my primary rootdisk mirror if my primary disk fails ?
So, I think you now can guess what will happen when you resync your secondary mirror back to the primary. The private region gets written to the beginning of your disk, offsetting all your filesystems and rendering your saved VTOC as useless. Now you can never go back to underlying devices. Because of this, upgrades and future recoveries may not be possible.
There is an infodoc which details an alternate method using the vxmksdpart which can be used for putting back the VTOC on the mirrored root disk. The infodoc is 14820.
99. How can I make hot-relocation use ONLY spare disks ?
Beginning with SEVM 2.4, if the following value is set in the file '/etc/default/vxassist':
100. How do I enable debug mode on vxconfigd ?
101. How do I disable DMP, dynamic multi-pathing ?
INFODOC ID: 18314
STATUS: Issued
SYNOPSIS: How to disable dmp
DETAIL DESCRIPTION:
This infodoc will explain the 7 steps to disable DMP
*****NOTE*******
before these steps are done
1. umount all file systems created on volume manager volumes
2. Stop the Volume Manager (vxdctl stop)
Then continue:
3. Remove the vxdmp driver
forceload: drv/vxdmp
101. How do I take a disk out from under Veritas control ?
The vxdiskunsetup command undoes the configuration setup by vxdisksetup and makes the specified disks unusable by the Volume Manager. It can be applied only to disks that are not in active use within an imported disk group.
Note that the disk must not be a member of any disk group when this is done. To remove a disk from a diskgroup, see the answer to question 105.
103. Volume Manager has relayed out my VTOC after encapsulation. I now need to get back my original VTOC but there is no original in /etc/vx/reconfig.d/disk.d/vtoc. How can I get back my /opt filesystem ?
Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 410400 410399
1 14 01 0 4154160 4154159
2 5 00 0 4154160 4154159
4 7 00 1240320 819280 2059599
5 4 00 2059600 1024480 3084079
7 15 01 4152640 1520 4154159
Because of the sizes, we can see that slice 7 is the private region and that slice 1 is the public region. The private region has a tag of 15, the public region has a tag of 14. Now check the /etc/vfstab to see where /opt was originally mounted :
Now checking the rootvol volume from the vxprint -Ath output. We know that that root starts at 0 and ends at 410399. Add 1 to this gives us 410400. This takes into consideration the boot block cylinder. No other offset is required as the Private Region is at the end of the disk in this case.
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
sd rootdisk-01 rootvol-01 rootdisk 0 410399 1 c1t12d0 ENA
So we now know the Veritas Private Region is not at the start of the disk. Now we check vxprint -Ath for optvol as we need to know where it starts.
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v opt fsgen ENABLED ACTIVE 819280 ROUND -
pl opt-02 opt ENABLED ACTIVE 819280 CONCAT - RW
sd rootmirror-02 opt-02 rootmirror 1024480 819280 0 c3t14d0 ENA
pl opt-01 opt ENABLED ACTIVE 819280 CONCAT - RW
sd rootdisk-05 opt-01 rootdisk 421039 819280 0 c1t12d0 ENA
From the above we can tell that opt-01 starts at 421039 and has a length of 819280. Add one 421039 gives us 421040 so this the start cylinder for /opt.
Now to find the end cylinder 421040 + 819280 = 1240320. So 1240320 is the end cylinder for opt.
Now label slice 3 as 421040 to 1240320.
One labeled this fsck -n /dev/rdsk/c1t12d0s3 says last mounted as opt.
104. What are the different status codes in a 'vxdisk list' output ?
105. How do I remove a disk from a diskgroup ?
106. How can I fix "vxvm: WARNING: No suitable partition from swapvol to set as the dump device." ?
16646
107. After an A5000 disk failure, I lost my rootdg and now I get vxvm:vxdisk: ERROR: Cannot get records from vxconfigd: Record not in disk group when I run vxdisk list and vxvm:vxdctl: ERROR: enable failed: System error occurred in the client when I run vxdctl enable. How can I fix it ?
108. After some A5000/Photon loop offline/onlines, my volume now has one plex in STALE state and the other in IOFAIL. How can I fix this ?
109. Is there any VxVM limitation on the number of volumes which can be created on a system ?
This value can be changed by inserting the following line in /etc/systems :
On 2.6 systems the max minor number is 0x3fff (decimal 262143). Please
check the 2.5.1 max minor number info. I think they are the same.
110. Configuration copies explained
You can set the number by using :
when creating a new diskgrou
Veritas Volume Manager is also called (VVM or VxVM )
Features :
1) VVM is Available for - Windows. Linux, HP-UX, Solaris, AIX.
2) Versions (3.1, 3.2, 3.5, 4.0, 4.1, 5.0).
Installing Veritas Volume Manager
1. Insert the Veritas volume manager software cdrom into
the cdrom drive. If volume management is enabled, it will
automatically mount to /cdrom/volume_manager3.5
(depending on the precise release iteration, the exact path
may differ in your case):
2. Change to the directory containing the Veritas Volume Manager packages:
# cd /cdrom/volume_manager3.5/pkgs
3. Add the required packages.
Note that the order specified is
siginificant in that the VRTSvlic package must be first,
the VRTSvxvm package must be second, and then any
remaining packages:
#pkgadd -d . VRTSvlic VRTSvxvm VRTSvmdoc \
VRTSvmman VRTSob VRTSobgui VRTSvmpro \
VRTSfspro VRTSvxfs VRTSfsdoc
Once the Installation is complete as you see below:
** IMPORTANT NOTICE ***
This machine must now be rebooted in order to ensure
sane operation. Execute
shutdown -y -i6 -g0
and wait for the "Console Login:" prompt.
# shutdown -y -i6 -g0
Give the above command as it appears in the console.
Once the system reboots, apply any Veritas volume manager
patches. At the time of this writing, there are no patches
for neither volume manager or filesystem. However, future
patches (and there will be patches ;-) can be obtained from
http://seer.support.veritas.com.
Note that the patch installation instructions may require
that a reboot be performed after the patch is installed
2) How do I initialize disks in Solaris, so that I can Add to VxVM(Veritas Volume Manager) ?
#drvconfig; devlinks; disks
Also,
try the following, :
#devfsadm
#vxdctl initdmp
#vxdctl enable
Make sure you initialize disk , only then will you be able to add to Veritas Volume Manager.
3) How do you add/remove/replace a Disk to Veritas Volume Manager Control ?
There are 13 options available to choose, from the below command, like adding/removing of devices:
#/usr/sbin/vxdiskadm
4) Steps for setting up storage - Veritas Volume Manager ?
1) It is important to create a diskgroup, so that VVM can be
moved to a different hosts.
Disk Groups includes filesystems/disks of the applcations.
Commands (vxdiskadd or vxdg).
#vxdg init diskgroup diskname=device
example:
#vxdg init ABCdg ABCdg01=c0t0d1
2) Creating Volumes with vxassist:
# vxassist -g diskgroup make vol_name size
example:
#vxassist -g ABCdg make ABC01 8g
Note: Understanding the contents of the /etc/default/vxassist file is important, especially when striping disks.
3) Creating a VXFS filesystem:
#mkfs -F vxfs -o bsize=8192,largefiles /dev/vx/rdsk/ABCdg/ABC01
4) Mounting the VXFS file system.
Creating and mounting filesystems go hand in hand. You must be certain that any special flags
set at creation time are reflected in /etc/vfstab, or on the command line if there is no entry in vfstab for your filesystem.
mount -F vxfs -o largefiles /dev/vx/dsk/ABCdg/ABC01 /u03/oradata/ABC
4) How do I view the total number of Disks added to VXVM ?
First Check if Veritas Volume Manager has seen the Disks
that you have attached :
#vxdisk -o alldgs list
if not, try the following, and then repeat the previous step:
#devfsadm
#vxdctl initdmp
#vxdctl enable
This should be able to detect disks into VVM
#vxprint
Disk Group rootdg (default disk group for Veritas Volume Manager).
TY | Name | Assoc | Kstate | Length
dg | rootdg | rootdg | ----------- |
dm | disk01 | c2t1d0s2 | ----------- | 17678493
dm | disk02 | c2t2d0s2 | ----------- | 17678493
dm | disk03 | c2t6d0s2 | ----------- | 17678493
We have 3 VXVM disks named disk01, disk02, disk03,
They are labelled dm which represents VM disk.
The VM disks are a member of "rootdg" which is the default disk group.
The size of the disks can be determined by dividing Length by 2, which is actual KB.
5) What are Disk Groups ?
A collection of VM disks that share common configurtion like objects,
their attributes and connections.
Default disk group is rootdg.
A diskgroup name can be 31 characters long.
Diskgroups allow you to group disks in logical collections.
It can be moved as a unit from one host machine to another.
6) How do I view the List of existing Disk Groups ?
#vxdg list
To View more detail about a particular disk group :
#vxdg list (diskgroupName)
#vxdg list rootdg
7) How do I create a Disk Group ?
#vxdg init diskgroup diskname=devicename
For eg. to create a disk group name mktdg on device c1t0d0s2
#vxdg init mktdg mktdg01=c1t0d0s2
8) How do I remove a disk from the disk Group ?
#vxdg -g [groupname ] rmdisk [diskname]
For step 7 to be removed :
#vxdg -g mktdg rmdisk c1t0d0s2
9) What is a Sub-Disk ?
A VM Disks can be divided into one or more sub-disks.
The default name for VM disk is disk ## (such as disk01)
Default name for sub-disk is disk ## - ##
for eg. disk01-01 is the first sub-disk on the VMdisk named disk01.
10) What is Plex ?
You can organise sub-disks to form a plex by using below methods :
Concatenation
Striping (RAID - 0 )
Mirroring (RAID - 1)
Striping with Parity (RAID - 5)
11) Understaning Physical Disks in Sun o/s ?
c# Specifies the Controller
t# Specifies the Target ID
d# Specifies the Disk
s# Specifies the Partition or slice
For eg. c0t0d0s2 , is the entire hardisk connected to controller number 0 in the system,
with target ID of 0, and Physical Disk number 0.
------------------------------------------------------------------------------------
PART-2
1 how to disable IP forwarding between interfaces in Sun Solaris
To disable IP forwarding between interfaces in Sun Solaris:
# touch /etc/notrouter
2 /etc/defaultrouter - where you store the default router ip address in Sun Solaris
In Solaris, the default router ip address is found in the file:
#/etc/defaultrouter
3 /etc/release - how to find the release version of Sun Solaris.
To find which release and version of Sun Solaris you are running:
# cat /etc/release
4 /etc/system - how to find kernel configuration information in Sun Solaris.
/etc/system
5 /etc/system - how to recover a corrupt or bad system file in Sun Solaris.
If you modify your /etc/system file in Solaris and screw it up or it gets corrupt, when you try to reboot, the server will no longer startup.
To recover from this problem:
1) As the server starts booting, press Stop+A (at the same time)
2) At OK> prompt, type "boot -as"
3) Solaris will now go into an interactive boot and will ask you several things.
4) Answer using all the defaults until it asks for your system file.
5) Either specify the name of a backup system file (if you have one) OR type "/dev/null"
6) It will allow the system to boot with a vanilla kernel so that you can fix the broken /etc/system
7) Fix the /etc/system file
8) Reboot
Example
Stop+A; boot -as; /dev/null/; vi /etc/system; reboot
6 adb - how to query kernel variables in Sun Solaris.
To query kernel variables in Solaris using the adb command:
Example to query current maxuprc kernel parameter with adb:
# adb -k
physmem f74c
maxuprc/D (display maxuprc value in decimal)
maxuprc:
maxuprc: 250
maxuprc/X (display maxuprc value in hexadecimal)
maxuprc:
maxuprc: fa
^D (exit out of adb)
Note: running sysdef also shows the values of certain kernel tunables:
Example to dynamically adjust maxuprc with adb:
Note: maxuprc is a kernel tunable that defines the maximum number of concurrent processes per user ID. This value does not affect the root user.
The default maxuprc value is max_nprocs - reserved_procs.
# adb -kw
physmem f74c
maxuprc/D (display maxuprc value in decimal)
v+0x1c/W0x12c (set maxuprc to 300; 0x12c is hexademical for 300)
^D (exit out of adb)
# sysdef | grep v_maxup
300 maximum processes per user id (v.v_maxup)
Example
adb -k
7 administrative gui in Sun Solaris.
administrative gui in Sun Solaris
Description
The administrative gui in Sun Solaris:
# solstice
# admintool
In Solaris 8 +:
# smc
Example
solstice; admintool; smc
8 cfgadm - how to get configuration information in Sun Solaris.
Example to list all attachment points except dynamic attachment points.
# cfgadm
Example to list all current configurable hardware information, including those represented by dynamic attachment points:
# cfgadm -al
Example to list all attachment points whose class begins with scsi, ap_id begins with c and type field begins with scsi. The argument to the -s option is quoted to protect it from the shell.
# cfgadm -s "match=partial,select=class(scsi):ap_id(c):type(scsi)"
Example to list current configurable hardware information for ap-type system in verbose mode:
# cfgadm -v -l system
Example to test two occupants using the hardware specific extended test:
# cfgadm -v -o extended -t system:slot3 system:slot5
Example to configure an occupant in the failing state to the system using the force option:
# cfgadm -f -c configure system:slot3
Example to unconfigure an occupant from the system:
# cfgadm -c unconfigure system:slot4
Example to configure an occupant at an attachment point:
# cfgadm -c configure c0::dsk/c0t0d0
Example
cfgadm
9 coreadm - how to manage core files in Sun Solaris.
Description
To manage core files in Sun Solaris:
To display current configuration:
# coreadm
To disable global core dumps:
# coreadm -d global
To disable per-process core dumps:
# coreadm -d process
To enable global and per-process core dumps:
# coreadm -e global -e process
To generate a syslog message at core file creation:
# coreadm -e log
Example
coreadm
10 crle - how to configure runtime linking environment in Sun Solaris.
o configure runtime linking environment in Sun Solaris:
# crle [-64] [-a name] [-c conf] [-e env] [-E env] [-f flags] [-i name] [-I name] [-g name] [-G name] [-l dir] [-o dir] [-s dir] [-t [ ELF | AOUT] ] [-u] [-v]
Example to update a new default search path for ELF objects:
# crle -u -l /local/lib
Example to create a new default search path and new trusted directory for ELF objects:
# crle -l /local/lib -l /usr/lib -s /local/lib
Example to display search path:
# crle
Example of creation of a directory cache for ELF objects:
# crle -i /usr/dt/lib -i /usr/openwin/lib -i /usr/lib -c config
Example for creation of an alternative object cache for an ELF executable:
# crle -c /local/$HOST/.xterm/ld.config.xterm -f RTLD_REL_ALL -G /usr/openwin/bin/xterm
# ln -s /local/$HOST/.xterm/xterm /local/$HOST/xterm
# ldd /usr/local/$HOST/xterm
Example for setting replaceable and permanent environment variables:
# crle -e LD_LIBRARY_PATH=/local/lib -E LD_PRELOAD=preload.so.1
Example
crle
11 devfsadm - add devices without rebooting in Sun Solaris.
To add devices in Sun Solaris without rebooting:
devfsadm replaces the previous suite of devfs administration tools including drvconfig, disks, tapes, ports, audlinks, and devlinks in pre-Solaris 7.
# /usr/sbin/devfsadm [-C] [-c device_class] [-i driver_name] [ -n] [-r root_dir] [-s] [-t table_file] [-v]
where device_class = disk , tape , port , audio , and pseudo
To do the same in pre-Solaris 7:
# drvconfig
# devlinks
# disks
OR
# tapes
OR
# ports
Example
/usr/sbin/devfsadm -c disk
12 dfmounts - display mounted resource information in Sun Solaris.
To display mounted resource information in Sun Solaris:
# dfmounts [-F FSType] [-h] [-o specific_options] [restriction...]
Example: dfmounts
13 dfshares - to list available resources from remote or local systems in Sun Solaris.
To list available resources from remote or local systems in Solaris:
# dfshares [-F FSType] [-h] [-o specific_options] [server...]
Example
dfshares
14 dmesg - print or control kernel booting messages in Solaris, HP/UX and linux.
To print or control kernel booting messages in Solaris and (some) linux:
# dmesg [ -c ] [ -n level ] [ -s bufsize ]
Example
dmesg
15 eeprom - to read or set the obp (open boot prom) variables in Sun Solaris.
To read the values set in the obp in Solaris:
# /usr/sbin/eeprom
Some examples to set values in the obp in Solaris:
# /usr/sbin/eeprom diag-file="kernel/sparcv9/unix"
# /usr/sbin/eeprom diag-switch?=false
Example
/usr/sbin/eeprom
16 etherfind - to capture TCP/IP network information in linux
To capture TCP/IP network information in linux:
# etherfind [ -d ] [ -n ] [ -p ] [ -r ] [ -t ] [ -u ] [ -v ] [ -x ] [ -c count ] [ -i interface ] [ -l length ] expression
Note: etherfind was also available on SunOS. In Solaris, use snoop.Example
etherfind host badserver or proto icmp
17 exportfs - list the directory currently exported
To display the name of the directory currently being exported:
# exportfs -v
Example
exportfs -v
18 exportfs - unexports an NFS directory
To unexport the directories you specify:
# exportfs -u /directory_to_unexport
When used with the -a flag, unexports all directories listed in the /etc/exports file.
Example
exportfs -u /db2/satis
19 fmthard - how to populate VTOC on hard disks in Sun Solaris
To populate VTOC on hard disks in Sun Solaris:
# fmthard -d data| -n volume_name| -s datafile [-i] /dev/rdsk/c? [t?] d?s2
where:
-d : the data argument of this option is a string representing the information for a particular partition in the current VTOC. The string must be of the format part:tag:flag:start:size where part is the partition number, tag is the ID TAG of the partition, flag is the set of permission flags, start is the starting sector number of the partition, and size is the number of sectors in the partition.
-i : this option allows the command to create the desired VTOC table, but prints the information to standard output instead of modifying the VTOC on the disk.
-n : this option is used to give the disk a volume_name up to 8 characters long.
-s datafile with partition information
Note: You can save the output of a prtvtoc command to a file, edit the file, and use it as the datafile argument to the -s option.
Example to partition a disk using another disk (mirror):
# prtvtoc /dev/rdsk/c0t1d0s2 > /tmp/format.out
# fmthard -s /tmp/format.out /dev/rdsk/c0t0d0s2
Example
fmthard -s /tmp/format.out /dev/rdsk/c0t0d0s2
20 fold - how to create line breaks at maximum characters or bytes
To create line breaks on a line in a file using either the number of characters or bytes:
# fold [-bs] [ -w width| -width] [file]
where:
-b : count width in bytes rather than column positions.
-s : if a segment of a line contains a blank character within the first width column positions (or bytes), break the line after the last such blank character meeting the width constraints. If there is no blank character meeting the requirements, the -s option will have no effect for that output segment of the input line.
-w width|-width : specify the maximum line length, in column positions (or bytes if -b is specified). If width is not a positive decimal number, an error is returned. The default value is 80.
Example to put a line break after 80 characters on a line have been reached:
# fold -w 80 myfile
Example to put a line break after 100 bytes on a line have been reached:
# fold -b 100 myfile
Description: Fold utily will break the lines to have maximam char (-w option) or bytes (-b option).
Example
fold -w 80 myfile
21 format - how to label a disk in Sun Solaris
To label a disk in Solaris:
- As root, run the format command:
# format
- From the format menu, type "label" to select "label - write label to the disk"
- From the menu, type "quit" to exit the format menu.
Example
format; label; quit
22 format - how to partition a disk in Sun Solaris
To partition a disk in Solaris:
- As root, run the format command:
# format
- From the format menu, type "disk" to select "disk - select a disk"
- Select the disk you wish to partition
- From the format menu, type "partition" to select "partition - select (define) a partition table"
- Partition the disk as you wish, but remember:
1) Slice 2 is the full disk - don't change this partition information!
2) Make sure your start and end cylinders do not overlap between slices otherwise you may have big problems!
- From the format menu, type "save" to select "save - save new disk/partition definitions"
- From the menu, type "quit" to exit the format menu.
Example
format; disk; partition; save; quit
23 fsck - how to run a filesystem check
To run a filesystem check:
# fsck [-y] filesystem
Example in Sun Solaris (use raw device name):
# fsck /dev/rdsk/c0t0d0s0
Example in IBM AIX:
# fsck /dev/hd1
Note: use -y flag if you want to answer "yes" to all questions asked by fsck (be careful!)
Example
fsck /dev/rdsk/c0t0d0s0
24 fwtmp - how to manipulate connect-time accounting records.
fwtmp manipulates connect-time accounting records by reading binary records in wtmp format from standard input, converting them to formatted ASCII records. The ASCII version is useful when it is necessary to edit bad records.
# fwtmp [-ic]
where :
-ic : denotes that input is in ASCII form, and output is to be written in binary form.
Example to convert a binary record in wtmp format to an ASCII record called dummy.file, enter:
# fwtmp < /var/adm/wtmp > dummy.file
Example to convert an ASCII dummy.file to a binary file in wtmp format called /var/adm/wtmp, enter the fwtmp command with the -ic switch:
# fwtmp -ic < dummy.file > /var/adm/wtmp
Note: Depending on your flavour of Unix, the file may be called wtmpx or wtmp.
Example
fwtmp < /var/adm/wtmp > dummy.file
25 getconf - how to get configuration values in Sun Solaris
To get configuration values in Sun Solaris:
# getconf [-v specification] system_var
# getconf [-v specification] path_var pathname
# getconf -a
Example of writing the value of a variable NGROUPS_MAX:
# getconf NGROUPS_MAX
Example of writing the value of a variable, NAME_MAX, for a specific directory, /usr:
# getconf NAME_MAX /usr
Example
getconf -a
26 grpck - how to check the group file in Solaris.
grpck verifies all entries in the group file. This verification includes a check of the number of fields, group name, group ID, whether any login names belong to more than NGROUPS_MAX groups and that all login names appear in the password file. The default group file is /etc/group.
# grpck [filename]Example
grpck
27 hostid - prints the numeric identifier of the current host
Description
To print the numeric identifier of the current host:
# hostid
Example
hostid
28 how can you tell if a Sun Solaris system is already running the 64-bit kernel.
To determine if your server is running Solaris using the 64-bit kernel:
# /usr/bin/isainfo -kv
64-bit sparcv9 kernel modules
Example
/usr/bin/isainfo -kv
29 how to add a virtual interface (alias) on a network card in Sun Solaris
To add a virtual interface (alias) on a network card in Sun Solaris:
1) Plumb the interface:
# ifconfig hme0:1 plumb
2) Add the alias to the interface:
# ifconfig hme0:1 10.23.36.2/24 up
3) Setup the file /etc/hostname.hme0:1 for the second ip address (alias)
# echo "newhostname" > /etc/hostname.hme0:1
4) Add the new entry in the /etc/hosts file:
# echo "10.23.36.2 newhostname" >> /etc/hosts
5) Verify:
# ifconfig -a
Note : second IP on the interface must be on the same vlan as the primary
Example
ifconfig hme0:1 inet 10.10.1.2 netmask 255.255.255.0 broadcast 10.10.1.255 up
30 how to assign individual mac addresses to multi port network cards in Sun Solaris
To assign individual mac addresses to multi port network cards in Sun Solaris:
# /usr/sbin/eeprom local-mac-address?=true
# reboot
Example
/usr/sbin/eeprom local-mac-address?=true; reboot
31 how to change network address information in Sun Solaris
To change network address information in Solaris, you must modify some or all of the following files:
- /etc/hosts
- /etc/resolv.conf
- /etc/hostname.*
- /etc/netmasks
- /etc/nodename
- /etc/dumpadm.conf
- /etc/net/*/hosts
Then you must restart for the changes to take effect:
# sys-unconfig
# reboot
Example
sys-unconfig; reboot
32 how to change the default 256 virtual ip addresses of an interface in Sun Solaris.
To change the default 256 virtual ip addresses of an interface in Sun Solaris:
# ndd -set /dev/ip ip_addrs_per_if ####
where #### must be between 1 and 8192
Example
ndd -set /dev/ip ip_addrs_per_if 8192
33 how to change the destination address for a route in Sun Solaris
To change the destination address for a route in Sun Solaris:
# route change [ net | host ] destination gateway [args]
Example to change the gateway for network 172.26.13.0/24 via 172.26.13.2:
# route change net 172.26.13.0 172.26.13.2 1
Example to change the gateway for host 172.26.14.5 via 172.26.13.2:
# route change host 172.26.14.5 172.26.13.2 1
Example
route change net 172.26.13.0 172.26.13.2 1
34 how to change the maximum number of users in Solaris
To change the maximum number of users in Solaris:
- Edit /etc/system file and add the line:
set maxusers=1024
- Reboot
# init 6
Note: Be careful what you set this value to otherwise you may not be able to boot. The maximum value allowed differs by version of Solaris.
Example
vi /etc/system; set maxusers=1024
35 how to change the MTU of a network interface card
To change the MTU of a network interface card:
# ifconfig eth0 mtu 1500
Example
ifconfig eth0 mtu 1500
36 how to check LUN information in Solaris 10
The fcinfo command shows FC and connected LUN details on Solaris 10.
To lookup HBA WWN:
# fcinfo hba-port -l
To lookup remote port WWN:
# fcinfo remote-port -slp {HBA_PORT_WWN}
This command shows LUNs device address, then after that you can check these devices on /dev/rdsk directory.
NOTE : in Solaris 9 use:
# prtpicl -v | grep ww
Example
fcinfo hba-port -l
37 how to check the number of used and unused network cards on Solaris system
To check the number of used and unused network cards on Solaris system:
# prtpicl -c network -v | egrep ':driver-name|:instance'
Example
prtpicl -c network -v | egrep ':driver-name|:instance'
38 how to clone partition tables in Sun Solaris
If you need to partition many identical disk in Sun Solaris, here is how to do it:
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
Example
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
39 how to determine which network interface will be used to contact a host in Sun Solaris
To determine which network interface will be used to contact a host in Sun Solaris:
# route get [hostname]
Example
route get sun1
40 how to disable autoboot in Sun Solaris
To disable autoboot in Solaris from the operating system:
# /usr/sbin/eeprom auto-boot? false
To disable autoboot from the OK prompt:
OK> setenv auto-boot? false
Example
/usr/sbin/eeprom auto-boot? false;
41 how to display the cached arp table in Sun Solaris
To display the cached arp table in Sun Solaris:
# ndd /dev/arp arp_cache_reportExample
ndd /dev/arp arp_cache_report
42 how to do a reconfigure boot or reboot in Sun Solaris
To do a reconfigure boot in Solaris from the openboot prom (OK prompt):
OK> boot -r
To do a reconfigure reboot from within Solaris:
# reboot -- -r
OR
# touch /reconfigure
# init 6
Example
boot -r; reboot -- -r; touch /reconfigure; init 6
43 how to find and set the maximum number of groups in Sun Solaris
To find the maximum number of groups in Solaris:
# getconf NGROUPS_MAX
To change the value of NGROUPS_MAX to 32 (the max possible), add the following line in /etc/systems:
set ngroups_max = 32
Notes:
1. Don't forget to reboot.
2. This setting may give rise to NFS interoperability problems, as typical NFS servers only support 16 groups when using AUTH_SYS/AUTH_UNIX.
Example
getconf NGROUPS_MAX; set ngroups_max = 32
44 how to find disk usage by users in Sun Solaris
To find how much disk space is used by users in kilobytes in Solaris:
# quot -af
where:
-a : generate a report for all mounted file systems.
-f: display three columns giving, for each user, the number of blocks owned, the count of number of files, and the user name.
Example
quot -af
45 how to find the file where all the filesystem descriptions are in Sun Solaris
Description
The file which lists all the local filesystems in Solaris is called /etc/vfstab.Example
/etc/vfstab
46 how to find the location of the Sun Solaris kernel
The location of the Solaris kernel is:
/kernel/genunix/platform/`uname -m`/kernel/unix
In Solaris version 7+:
/kernel/unix/platform/`uname -m`/kernel/sparcv9/unix
Example
/kernel/genunix/platform/`uname -m`/kernel/unix
47 how to find the name resolution order
The file which lists the name resolution order (hosts, bind, nis) in HP/UX, Sun Solaris or linux is called /etc/nsswitch.confExample
/etc/nsswitch.conf
48 how to find the NFS share definitions in Sun Solaris
The NFS share definitions in Solaris can be found in the file /etc/dfs/dfstab.
Example
/etc/dfs/dfstab
49 how to find which filesystem is causing your df command to hang in Solaris
If you type "df -k" in a terminal window, and the command hangs (does not return), to find which filesystem is causing the hang:
1) Type mount -p to print the list of mounted filesystems:
# mount -p
2) Now type your df command again:
# df -k
Compare the output of the two commands, the filesystem missing from the df output is likely causing your hang. Verify why and correct. Possible reasons could be remote server down or filesystem no longer exported.
Example
mount -p; df -k
50 how to grow a UFS filesystem in Solaris
You can grow but not shrink a UFS filesystem in Sun Solaris with the command:
# /usr/lib/fs/ufs/mkfs -G -M /current/mount /dev/rdsk/cXtYdZsA newsize
Specifying the current mount point and raw device as well as the new size in 512 byte blocks.
You can do this even when the filesystem is mounted and in use.
Example
mkfs -G -M /prod /dev/rdsk/c0t0s0s3 1024
51 how to identify which package a file belongs to in Sun Solaris
To identify which package a file or binary belongs to in Solaris:
# /usr/sbin/pkgchk -l -p /usr/bin/ls
Example
/usr/sbin/pkgchk -l -p /usr/bin/ls
52 how to increase the tcp receive buffers in Sun Solaris
To increase the tcp receive buffers in Sun Solaris:
# ndd -set /dev/tcp tcp_recv_hiwat 65535
Example
ndd -set /dev/tcp tcp_recv_hiwat 65535
53 how to increase the tcp transmit buffers in Sun Solaris
To increase the tcp transmit buffers in Sun Solaris:
# ndd -set /dev/tcp tcp_xmit_hiwat 65535
Example
ndd -set /dev/tcp tcp_xmit_hiwat 65535
54 how to list filesystem inode information in Solaris
To list filesystem inode information in Solaris:
# df -o i
Example
df -o i
55 how to list the tunable kernel parameters in Sun Solaris
To list the tunable kernel parameters in Solaris:
# /usr/ccs/bin/nm -x /dev/ksyms | grep OBJ
Example
/usr/ccs/bin/nm -x /dev/ksyms | grep OBJ
56 how to lock a user's account in Sun Solaris
To lock a user's account in Sun Solaris:
# passwd -l username
Note: This inserts the string "*LK*" in the encrypted column field in /etc/shadow file.
Example
passwd -l username
57 how to make a mirror of your boot disk in Sun Solaris
To make a copy of your boot disk in Solaris:
# dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=4096
Don't forget to add the bootblock on the mirror disk otherwise you will not be able to boot off of it:
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
Example
dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=4096
58 how to monitor routing table lookup misses and changes in Sun Solaris
To monitor routing table lookup misses and changes in Sun Solaris:
# route monitor
Example
route monitor
59 how to mount a cdrom manually in Sun Solaris
To mount a cdrom manually in Sun Solaris:
The target number in a solaris device pathname is the SCSI ID, generally 6 for the CDROM drive.
# mount -o ro /dev/dsk/c0t6d0s1 /mnt/cdrom
Example
mount -o ro /dev/dsk/c0t6d0s1 /mnt/cdrom
60 how to mount a metadevice in Solaris Volume Manager
To mount a metadevice in Solaris Volume Manager:
First create the mount point:
# mkdir /work0
Then mount as follows:
# mount -F ufs /dev/md/dsk/d0 /work0
If you want to mount automatically after a reboot, add this line in your /etc/vfstab:
/dev/md/dsk/d0 /dev/md/rdsk/d0 /work0 ufs 2 yes -
Note: Solaris Volume Manager was previously known as Solstice Disksuite. This command should work for both.
Example
mkdir /work0; mount -F ufs /dev/md/dsk/d0 /work0
61 how to mount an ISO9660 cdrom manually in Sun Solaris
how to mount an ISO9660 cdrom manually in Sun SolarisDescription
To mount an ISO9660 cdrom manually in Sun Solaris:
# mount -F hsfs -o ro /dev/sr0 /cdromExample
mount -F hsfs -o ro /dev/sr0 /cdrom
62 how to move the data in a partition to another filesystem using ufsdump and ufsrestore in Sun Solaris
Here is a one-liner to move data from a partition to another filesystem in Solaris:
# ufsdump 0f - /dev/rdsk/c0t0d0s0 | (cd /restore_dir; ufsrestore xv -)
Example
ufsdump 0f - /dev/rdsk/c0t0d0s0 | (cd /restore_dir; ufsrestore xv -)
63 how to remount a filesystem and turn on UFS logging in Sun Solaris
To remount a filesystem and turn UFS logging on in Solaris:
# mount -o remount,logging /fsExample
mount -o remount,logging /fs
64 how to remount the root filesystem to make it writable in Sun Solaris
To remount the root filesystem when the system has failed to boot and you need modify some files on root which is mounted in readonly mode in Solaris:
# mount -F ufs -o rw,remount /
Example
mount -F ufs -o rw,remount /
65 how to run a filesystem check (fsck) using an alternate block in Sun Solaris
To run a filesystem check (fsck) using an alternate block in Sun Solaris:
1) First get the list of alternate blocks:
# newfs -Nv /dev/rdsk/c0t0d0s0
2) The run fsck using one of the alternate blocks determined from the previous command:
# fsck -F ufs -o b=97472 /dev/rdsk/c0t0d0s0
Example
newfs -Nv /dev/rdsk/c0t0d0s0; fsck -F ufs -o b=97472 /dev/rdsk/c0t0d0s0
66 how to see all the services controlled by the service manager in Solaris 10
To see the list of all the services controlled by the service manager in Solaris 10:
# svcs -a
Example
svcs -a
67 how to see the list of all services not running in Solaris 10
To see the list of all the services controlled by the service manager in Solaris 10:
# svcs -a
Example
svcs -a
68 how to set network interface settings in Sun Solaris (ce type adapters)
To see the list of all services not running and the reason why they are down in Solaris 10:
# svcs -xExample
svcs -x
69 how to set network interface settings in Sun Solaris (non-ce type adapters)
To set network interface setting in Solaris in ce type adapters:
The normal /etc/system settings for nics are not supported for configuring ce-type ethernet adapters during system startup.
To solve this problem, you can simply create an rc script with your ndd commands or create a /platform/sun4u/kernel/drv/ce.conf file (more complicated).
Sample script with ndd commands:
Script: /etc/init.d/nddconfig
#!/bin/sh
ndd -set /dev/ce instance 0
ndd -set /dev/ce adv_1000fdx_cap 0
ndd -set /dev/ce adv_1000hdx_cap 0
ndd -set /dev/ce adv_100fdx_cap 1
ndd -set /dev/ce adv_100hdx_cap 0
ndd -set /dev/ce adv_10fdx_cap 0
ndd -set /dev/ce adv_10hdx_cap 0
ndd -set /dev/ce adv_autoneg_cap 0
Now, create a sym link in rc2.d like this:
# ln -s /etc/init.d/nddconfig /etc/rc2.d/S31nddconfig
Example
/etc/init.d/nddconfig; ln -s /etc/init.d/nddconfig /etc/rc2.d/S31nddconfig
70 how to show extended interface info, collisions, errors, framing issues in Sun Solaris
To set network interface setting in Solaris in non-ce type adapters:
Example with hme0:
1. Make the changes to the running system:
# ndd -set /dev/hme adv_100hdx_cap 0
# ndd -set /dev/hme adv_100fdx_cap 1
# ndd -set /dev/hme adv_autoneg_cap 0
2. Make kernel parameter changes to preserve the speed and duplex settings after a reboot:
# vi /etc/system
Add:
set hme:hme_adv_autoneg_cap=0
set hme:hme_adv_100hdx_cap=0
set hme:hme_adv_100fdx_cap=1
Example
ndd -set /dev/hme adv_100hdx_cap 0; ndd -set /dev/hme adv_100fdx_cap 1; ndd -set /dev/hme adv_autoneg_cap 0
71 how to show network interface information in Sun Solaris
This is an undocumented feature of the netstat command in Solaris.
# netstat -k hme0
This command shows extended interface info, collisions, errors, framing issues, etc.
Example
netstat -k hme0
72 how to show the arp table without name resolution
To show network interface information in Sun Solaris:
# ifconfig -a
OR
# netstat -in
OR in Solaris 8+
# kstat -n hme0 | egrep "ifspeed|duplex"
Note: replace hme0 with your interface nameExample
ifconfig -a; kstat -n hme0 | egrep "ifspeed|duplex"
73 how to view the superblocks available on a filesystem in Sun Solaris
To show the contents of your arp table without name resolution:
# netstat -npExample
netstat -np
74 installboot - make a disk bootable in Sun Solaris
To view the superblocks available on a filesystem in Solaris:
# newfs -Nv /dev/rdsk/cxtxdxsx
Example
newfs -Nv /dev/rdsk/c0t0d0s1
75 intrstat - how to report interrupt statistics in Solaris 10
The intrstat utility gathers and displays run-time interrupt statistics in Solaris 10. The output is a table of device names and CPU IDs, where each row of the table denotes a device, and each column of the table denotes a CPU. Each cell in the table contains both the raw number of interrupts for the given device on the given CPU, and the percentage of absolute time spent in that device's interrupt handler on that CPU.
# intrstat [-c cpulist| -C processor_set_id] [interval [count]]
where:
-c cpulist : displays data for the CPUs specified by cpulist.
cpulist can be a single processor ID (for example, 4), a range of processor IDs (for example, 4-6), or a comma separated list of processor IDs or processor ID ranges (for example, 4,5,6 or 4,6-8).
-C processor_set_id : displays data for the CPUs in the processor set specified by processor_set_id.
intrstat modifies its output to always reflect the CPUs in the specified processor set. If a CPU is added to the set, intrstat modifies its output to include the added CPU. If a CPU is removed from the set, intrstat modifies its output to exclude the removed CPU. At most one processor set can be specified.
count : indicates the number of intervals to execute before exiting.
interval : indicates the number of seconds to be executed before exiting.
Example
intrstat
76 iostat - get hardware configuration in Sun Solaris
To get hardware information in Sun Solaris:
# iostat -En
Example
iostat -En
77 iostat - how to determine drive information in Sun Solaris
To determine drive information (including cdrom and dvd) in Sun Solaris:
# iostat -EExample
iostat -E
78 ipcrm - how to clear a shared memory segment which ipcrm says does not exist
If you run the following command to remove a shared memory segment and you get this error:
# ipcrm -m 65537
ipcrm: 0515-020 shmid(65537) was not found.
However, if you run the ipcs command, you still see the segment there:
# ipcs | grep 65537
m 65537 0x00000000 DCrw------- root system
If you look carefully, you will notice the "D" in the forth column. The "D" means:
D If the associated shared memory segment has been removed. It disappears when the last process attached to the segment detaches it.
So, to clear the shared memory segment, find the process which is still associated with the segment:
# ps -ef | grep process_owner
where process_owner is the name of the owner using the shared segment
Now kill the process found from the ps command above
# kill -9 pid
Running another ipcs command will show the shared memory segment no longer exists:
# ipcs | grep 65537
Example
ipcrm -m 65537
79 ipcs - calculate the memory used by a user hiding in shared memory
Traditional UNIX tools like topas, top or nmon won't show the memory consumed by a process if the memory is in a shared segment, to calculate the memory consumed in MB in shared memory by a user:
# ipcs -m -a | awk '/user/ {i+=$10} END { print i/1024/1024 }'
Example
ipcs -m -a | awk '/db2q510/ {i+=$10} END { print i/1024/1024 }'
80 isainfo - describe instruction set architectures in Sun Solaris
To get instruction set architecture information in Sun Solaris:
# isainfo [-v] [-b | -n | -k]
Examples:
# isainfo -v
32-bit i386 applications
# isainfo -k
i386
# isainfo -n
sparc
# isainfo -v
32-bit sparc applications
# isainfo -kv
32-bit sparc kernel modules
Example
isainfo -v
81 kstat - how to display kernel statistics in Sun Solaris
To display kernel statistics in Sun Solaris:
# kstat [-lpq] [-T u| d ] [-c class] [-m module] [-i instance] [-n name] [-s statistic] [interval [count]]
# kstat [-lpq] [-T u| d ] [-c class] [module:instance:name:statistic…] [interval [count]]
where:
-c class : displays only kstats that match the specified class.
-i instance : displays only kstats that match the specified instance.
-l : lists matching kstat names without displaying values.
-m module : displays only kstats that match the specified module.
-n name : displays only kstats that match the specified name.
-p : displays output in parseable format. All example output in this document is given in this format. If this option is not specified, kstat produces output in a human-readable, table format.
-q : displays no output, but return appropriate exit status for matches against given criteria.
-s statistic : displays only kstats that match the specified statistic.
-T d | u : displays a time stamp before each statistics block, either in ctime(3C) format ('d') or as an alphanumeric representation of the value returned by time(2) ('u').
Examples to get the average cpu run-times:
# kstat -p -m unix -i 0 -n system_misc -s 'avenrun*'
# kstat -p -s 'avenrun*'
# kstat -p 'unix:0:system_misc:avenrun*'
# kstat -p ':::avenrun*'
# kstat -p ':::/^avenrun_/d+min$/'
Examples to get the cpu interrupts:
# kstat -p -m cpu_stat -s 'intr*'
# kstat -p cpu_stat:::/^intr/
Examples to get the cpu states and average run-times:
# kstat -p :::state ':::avenrun*'
# kstat -p :::state :::/^avenrun/
Example
kstat -p -s 'avenrun*'
82 ld - how to check if you have a particular library installed in Sun Solaris
To check if you have a particular library installed in Solaris:
# ld -l libname
where:
libname = library name without the "lib" part
Example to find check if you have libX.so installed:
# ld -l X.so
Note: If the library is found, there is nothing return. If the library is not found, you will get an error.
Example
ld -l X.so
83 ldd - how to list dynamic dependencies of executable files or shared objects in Sun Solaris
To list dynamic dependencies of executable files or shared objects in Sun Solaris:
# ldd [-d | -r ] [ -f ] [ -i ] [ -l ] [ -s ] [ -v ] filename ...
where:
-d : check references to data objects.
-r : check references to both data objects and functions.
-f : force ldd to check for an executable file that is not secure. An executable is not considered secure if the interpretor it specifies does not reside under /usr/lib or /etc/lib, or if the interpretor cannot be determined.
-i : displays the order of execution of initialization sections.
-l : forces the immediate processing of any filters so that all filtees, and their dependencies, are listed.
-s : displays the search path used to locate shared object dependencies.
-v : displays all dependency relationships incurred when processing filename. This options also displays any dependency version requirements.
Example
ldd /path/filename
84 lofiadm - how to mount an ISO image in Solaris
Given an ISO image in /export/temp/software.iso, a loopback file device (/dev/lofi/1) is created with the following command:
# lofiadm -a /export/temp/software.iso /dev/lofi/1
The lofi device creates a block device version of a file. This block device can be mounted to /mnt with the following command:
# mount -F hsfs -o ro /dev/lofi/1 /mnt
These commands can be combined into a single command:
# mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt
To view your lofi device mappings:
# lofiadm
To delete a lofi device:
# lofiadm -d /dev/lofi/1
Example
mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt
85 m64config - how to change the resolution of the M64 graphics accelerator in Sun Solaris
o change the resolution of the M64 graphics accelerator in Sun Solaris:
# m64config -res 'video_mode'
To get a list of valid video modes:
# m64config -res '?'
Example
m64config -res 'video_mode'
86 m64config - how to print the current values of all M64 options in Solaris
To print the current values of all M64 options in the OWconfig file in Solaris:
# /usr/sbin/m64config -propt
Example
/usr/sbin/m64config -propt
87 m64config - how to print the M64 Graphics hardware configuration in Sun Solaris
To print the M64 Graphics hardware configuration in Sun Solaris:
# m64config -prconfExample
m64config -prconf
88 m64config - how to print the M64 hardware configuration in Solaris
In Solaris, to print the M64 hardware configuration:
# /usr/sbin/m64config -prconf
Example
/usr/sbin/m64config -prconf
89 m64config - how to print the M64 hardware configuration in Sun Solaris
To check your current config of the M64 graphics accelerator in Sun Solaris:
# m64config -prconf
Example
m64config -prconf
90 m64config - how to set the screen depth of the M64 graphics accelerator in Sun Solaris
To set the screen depth of the M64 graphics accelerator in Sun Solaris:
# m64config -depth 8|24
Example to set to 8-bits per pixel:
# m64config -depth 8
Example
m64config -depth 8
91 meminfo.sh - script to find memory usage in Sun Solaris
Here is a small script to find memory usage in Sun Solaris when you don't have top installed:
#!/bin/sh
totalmb=`/usr/sbin/prtconf|/usr/bin/grep "Memory size"|/usr/bin/awk '{print $3}'`
freekb=`/usr/bin/vmstat 1 2|/usr/bin/tail -1|/usr/bin/awk '{print $5}'`
freemb=`/usr/bin/echo $freekb/1024 | /usr/bin/bc`
usedmb=`/usr/bin/echo $totalmb-$freemb|/usr/bin/bc`
/usr/bin/echo "Total Memory : $totalmb MB"
/usr/bin/echo "Used Memory : $usedmb MB"
/usr/bin/echo "Free Memory : $freemb MB"
Example
meminfo.sh
92 mkfile - to create a large file in Sun Solaris
To create a large file in Solaris:
# mkfile [-nv] size [g | k | b | m] filenameExample
mkfile 500m bigfile
93 mkfs - how to construct a file system in Sun Solaris
To construct a file system in Sun Solaris of type UFS, use the newfs command.
If the fstype is not UFS, or you simple want to use another command, then try mkfs:
# mkfs [ -F FSType ] [ generic_options ] [ -o FSType-specific_options ] raw_device_file [ operands ]
where:
-F : specifies the FSType to be constructed.
-V : echoes the complete command line, but does not execute the command.
-m : returns the command line which was used to create the file system. The file system must already exist.
-o : specify FSType-specific options.
Example:
# mkfs -F ufs /dev/rdsk/c0t0d0s0 4192965
where 4192965 = total number of blocks in the partitionExample
mkfs -F ufs /dev/rdsk/c0t0d0s0 4192965
94 modinfo - how to display kernel module information in Sun Solaris
To display kernel module information in Sun Solaris:
# /usr/sbin/modinfo [-i]
where:
-i : can be used to specify a particular module
Example to display information about module 11:
# /usr/sbin/modinfo -i 11
Example
/usr/sbin/modinfo -i 11
95 modload - how to load a kernel module in Sun Solaris
To load a kernel module in Sun Solaris:
# /usr/sbin/modload modulename
Example
modload /usr/kernel/drv/ipf
96 modunload - how to unload a kernel module in Sun Solaris
To unload a kernel module in Sun Solaris:
# /usr/sbin/modunload -i module_id
Note: You can find module_id using the modinfo command.
Example
/usr/sbin/modunload -i 11
97 ndd - how to get and set driver configuration parameters in Sun Solaris
To get and set driver configuration parameters in Sun Solaris:
# ndd [ -set ] driver parameter [ value ]
Example to get parameters supported by the TCP driver:
# ndd /dev/tcp \?
Example to set the value of the parameter ip_forwarding in the dual stack IP driver to zero. This disables IPv4 packet forwarding.
# ndd -set /dev/ip ip_forwarding 0
Example to view the current IPv4 forwarding table, use the following command:
# ndd /dev/ip ipv4_ire_status
Example to determine nic speed and duplex:
# ndd -get /dev/hme link_mode
Interpretation:
0 -- half-duplex
1 -- full-duplex
# ndd -get /dev/hme link_speed
Interpretation:
0 -- 10 Mbit
1 -- 100 Mbit
1000 -- 1 Gbit
Example
ndd -get /dev/hme link_mode; ndd -get /dev/hme link_speed
98 newfs - how to construct a new UFS file system in Sun Solaris
To construct a new UFS file system in Sun Solaris:
# newfs [ -Nv ] [ mkfs-options ] raw-device
where valid mkfs-options include:
-a : the number of alternate blocks per cylinder (SCSI devices only) to reserve for bad block replacement. The default is 0.
-b : the logical block size of the file system in bytes (either 4096 or 8192). The default is 8192.
-c : the number of cylinders per cylinder group (ranging from 16 to 256)
-d : rotational delay
-f : the smallest amount of disk space in bytes to allocate to a file. The values must be a power of two selected from the range 512 to the logical block size.
-i : the number of bytes per inode. The default for nbpi is as follows:.
Disk size Density
-1GB 2048
-2GB 4096
-3GB 6144
3GB- 8192
-m : the minimum percentage of free space to maintain in the file system (between 1% and 99%,
inclusively). This space is off-limits to normal users. Once the file system is filled to this
threshold, only the super-user can continue writing to the file system.
-n : the number of different rotational positions in which to divide a cylinder group. The default is 8.
-o : (space or time). The file system can either be instructed to try to minimize the time spent allocating blocks, or to try to minimize the space fragmentation on the disk. The default is time.
-r : the speed of the disk in revolutions per minute. The default is 3600.
-s : the size of the file system in sectors. The default is to use the entire partition.
-t : the number of tracks per cylinder on the disk. The default is taken from the disk label.
-C : the maximum number of blocks, belonging to one file, that will be allocated contiguously before inserting a rotational delay.
Example to create a filesystem with 1% minfree and inode density:
# newfs –m1 –i81920 /dev/rdsk/c0t0d0s0Example
newfs –m1 –i81920 /dev/rdsk/c0t0d0s0
99 newfs - how to create a filesystem on a metadevice in Solaris Volume Manager
To create a filesystem on a metadevice in Solaris Volume Manager:
# newfs -i 8192 /dev/md/rdsk/d0
Note: Solaris Volume Manager was previously known as Solstice Disksuite. This command should work for both.Example
newfs -i 8192 /dev/md/rdsk/d0
100 pagesize - how to print out the default size of all hardware address translations in Sun Solaris
To print out the default size of all hardware address translations in Sun Solaris:
# pagesize -a
Note: Valid in Solaris v9+
Example
pagesize -a
101 patchadd - how to apply a software patch to a Sun Solaris server
To apply a patch package to a system running Solaris:
# patchadd [-d] [-u] [-B backout_dir] [-C net_install_image | -R client_root_path | -S service] patch
# patchadd [-d] [-u] [-B backout_dir] [-C net_install_image | -R client_root_path | -S service] -M patch_dir | patch_id... | patch_dir patch_list
# patchadd [-C net_install_image | -R client_root_path | -S service] -p
where:
-B : saves backout data to a directory other than the package database. Specify backout_dir as an absolute path name.
-C : patches the files located on the mini root on a Net Install Image created by setup_install_server.
-d : does not back up the files to be patched. The patch cannot be removed.
-M : specifies the patches to be installed. Specify patches to the -M option in one of the following ways:
1. By directory location and patch number.
2. By directory location and the name of a file containing a patch list.
-p : displays a list of the patches currently applied.
-R : locates all patch files generated by patchadd under the directory client_root_path.
-S : specifies an alternate service.
-u : turns off file validation. Applies the patch even if some of the files to be patched have been modified since their original installation.
Example to install a patch:
# patchadd /var/spool/patch/104945-02
Example to install a patch to a client from the server's console:
# patchadd -R /export/root/client1 /var/spool/patch/104945-02
Example to install a patch to a service from the server's console:
# patchadd -S Solaris_2.3 /var/spool/patch/104945-02
Example to install multiple patches:
# patchadd -M /var/spool/patch 104945-02 104946-02 102345-02
Example to install multiple patches specifying a file with the list of patches to install:
# patchadd -M /var/spool/patch patchlist
Example to install multiple patches to a client and saves the backout data to a directory other than the default:
# patchadd -M /var/spool/patch -R /export/root/client1-B /export/backoutrepository 104945-02 104946-02 102345-02
Example to display the patches installed on a client:
# patchadd -R /export/root/client1 -p
Example
patchadd -M /var/spool/patch 104945-02 104946-02 102345-02
102 pax - how to copy a directory more efficiently
pax - how to copy a directory more efficiently
Description
To copy a directory to another name more efficiently than using cp:
# pax -rw /oldir /newdir
Example
pax -rw /oldir /newdir
103 pfiles - to report fstat(2) and fcntl(2) information for all open files in each process in Sun Solaris
To report fstat(2) and fcntl(2) information for all open files in each process in Sun Solaris:
# pfiles pid
Example
pfiles 204
104 pgrep and pkill - how to terminate processes
You can use the pgrep and pkill commands to identify and stop command processes that you no longer want to run. These commands are useful when you mistakenly start a process that takes a long time to run.
To terminate a process:
a. pgrep - to find out the PID(s) for the process(es).
b. pkill - followed by the PID(s).
The following example illustrates how to find all the processes with a specific name (xterm) and terminate the xterm process that was started last.
# pgrep xterm
17818
17828
17758
18210
# pkill -n 18210
Note: If you need to forcibly terminate a process, use the -9 option to the pkill command.
Example
pkill -9 -n xterm
105 ping and ping -s do not report same result in Solaris
On Solaris servers, if the DNS servers used to resolve hostnames are unavailable, the results of a "ping" versus a "ping -s" command will be different.
The command "ping myhost" will say the host is alive and "ping -s myhost" will say the host does not respond.
To avoid this problem and to get the same results, do a "ping -sn" on the IP address or if you have an entry in your /etc/hosts file, you may use the hostname.
The -n flag will show network addresses as numbers. ping normally does a reverse name lookup on the IP addresses it extracts from the packets received. The -n option blocks the reverse lookup, so ping prints IP addresses instead of host names.
Example:
# ping -sn 172.26.25.34
# ping -sn myhost
Example
ping -sn 172.26.25.34
106 pkgadd - how to install software packages on a Sun Solaris server
To install software packages on a Sun Solaris server:
# pkgadd [-nv] [-a admin] [-d device] [ [-M] -R root_path] [-r response] [-V fs_file] [pkginst... | -Y category[,category...]]
# pkgadd -s spool [-d device] [pkginst... | -Y category[,category...]]
The following options are supported:
-a : define an installation administration file, admin, to be used in place of the default administration file.
-d : install or copy a package from device.
-M : instruct pkgadd not to use the $root_path/etc/vfstab file for determining the client's mount points.
-n : installation occurs in non-interactive mode.
-r: identify a file or directory which contains output from a previous pkgask session.
-R : define the full path name of a directory to use as the root_path. All files, including package system information files, are relocated to a directory tree starting in the specified root_path.
-s : write the package into the directory spool instead of installing it.
-v : trace all of the scripts that get executed by pkgadd, located in the pkginst/install directory.
-V : specify an alternative fs_file to map the client's file systems.
-Y : install packages based on the value of the CATEGORY parameter stored in the package's pkginfo file.
Example to install a package from a Solaris 2.6 CD. You will be prompted for which package to add:
# pkgadd -d /cdrom/cdrom0/s0/Solaris_2.6
Example
pkgadd -d /cdrom/cdrom0/s0/Solaris_2.6 SUNWaccr
107 pkgchk - how to check software package installation accuracy in Sun Solaris
To check software package installation accuracy in Sun Solaris:
# pkgchk [-l | -acfnqvx] [-i file] [-p path...] [-R root_path] [ [ -m pkgmap [-e envfile]] | pkginst... | -Y category,category...]
# pkgchk -d device [-l | -fv] [-i file] [-M] [-p path...] [-V fs_file] [pkginst... | -Y category[,category...]]
The following options are supported:
-a : audit the file attributes only and do not check file contents. Default is to check both.
-c : audit the file contents only and do not check file attributes. Default is to check both.
-d : specify the device on which a spooled package resides.
-e : request that the package information file named as envfile be used to resolve parameters noted in the specified pkgmap file.
-f : correct file attributes if possible. If used with the -x option, this option removes hidden files. When pkgchk is invoked with this option, it creates directories, named pipes, links, and special devices if they do not already exist. If the -d option calls out an uninstalled package, the -f option will only take effect if the package is in directory (not stream) format. All file attributes will be set to agree with the entries in the pkgmap file except that setuid, setgid, and sticky bits will not be set in the mode.
-i : read a list of path names from file and compare this list against the installation software database or the indicated pkgmap file. Path names which are not contained in file are not checked.
-l : list information on the selected files that make up a package. This option is not compatible with the -a, -c, -f, -g, and -v options.
-m : check the package against the package map file, pkgmap.
-M : instruct pkgchk not to use the $root_path/etc/vfstab file for determining the client's mount points.
-n : do not check volatile or editable files' contents.
-p : only check the accuracy of the path name or path names listed.
-q : quiet mode. Do not give messages about missing files.
-R : define the full name of a directory to use as the root_path.
-v : verbose mode. Files are listed as processed.
-V : specify an alternative fs_file to map the client's file systems.
-x : search exclusive directories, looking for files which exist that are not in the installation software database or the indicated pkgmap file.
-Y : check packages based on the value of the CATEGORY parameter stored in the installed or spooled package's pkginfo file.
Example to displays package installation information for /usr/bin/ls:
# pkgchk -l -p /usr/bin/ls
Example
pkgchk -l -p /usr/bin/ls
108 pkginfo - to display software package information in Sun Solaris
# pkginfo [-q | -x | -l] [-p | -i] [-r] [-a arch] [-v version] [-c category...] [pkginst...]
# pkginfo [-d device] [-R root_path] [-q | -x | -l] [-a arch] [-v version] [-c category...] [pkginst...]
The -p and -i options are meaningless if used in conjunction with the -d option.
The options -q, -x, and -l are mutually exclusive.
where:
-a : specify the architecture of the package as arch.
-c : display packages that match category.
-d : defines a device, device, on which the software resides.
-i : display information for fully installed packages only.
-l :specify long format, which includes all available information about the designated package(s).
-p : display information for partially installed packages only.
-q : do not list any information. Used from a program to check whether or not a package has been installed.
-r : list the installation base for relocatable packages.
-R : defines the full path name of a directory to use as the root_path.
-v : specify the version of the package as version.
-x : designate an extracted listing of package information.
Example:
# pkginfo -d /cdrom/solaris_2_5_sparc/s0/Solaris_2.5 SUNWaccr
system SUNWaccr System Accounting, (Root)
Example
pkginfo -d /cdrom/solaris_2_5_sparc/s0/Solaris_2.5 SUNWaccr
109 pkgrm - how to remove a software package from a Sun Solaris server
To remove a software package from a Sun Solaris server:
# pkgrm [-nv] [-a admin] [ [-A | -M] -R root_path] [-V fs_file] [pkginst... | -Y category[,category...]]
# pkgrm -s spool [pkginst... | -Y category[,category...]]
The following options are supported:
-a : use the installation administration file, admin, in place of the default admin file.
-A : remove the package files from the client's file system, absolutely. If a file is shared with other packages, the default behavior is to not remove the file from the client's file system.
-M : instruct pkgrm not to use the $root_path/etc/vfstab file for determining the client's mount points.
-n : non-interactive mode.
-R : defines the full path name of a directory to use as the root_path.
-s : remove the specified package(s) from the directory spool.
-v : trace all of the scripts that get executed by pkgrm, located in the pkginst/install directory.
-V : specify an alternative fs_file to map the client's file systems.
-Y : remove packages based on the value of the CATEGORY parameter stored in the installed or spooled package's pkginfo file.
Example for removing all instances of SUNWjunk from client1:
# pkgrm -R /export/root/client1 SUNWjunk*
Example
pkgrm -R /export/root/client1 SUNWjunk*
110 pmap - how to find address space map a process occupies in Sun Solaris
To find address space map a process occupies in Sun Solaris:
# /usr/proc/bin/pmap pid
Example
/usr/proc/bin/pmap pid
111 poweroff - how to shutdown the processor and remove power in Solaris
The poweroff utility writes any pending information to the disks and then stop the processor. The poweroff utility will have the machine remove power, if possible.
# poweroff [-dlnqy]
where:
-d : force a system crash dump before rebooting.
-l : suppress sending a message to the system log daemon.
-n : prevent the sync(1M) before stopping.
-q : Quick halt. No graceful shutdown is attempted.
-y : Halt the system, even from a dialup terminal.
Example
poweroff
112 prodreg - a GUI viewer for Sun Solaris Product Registry
To view the Solaris Product Registry:
# /usr/bin/prodreg [subcommand]
The following subcommands are supported:
swing : starts up the viewer using the default Java 2, SDK, Standard Edition, Swing GUI. This is the same as prodreg with no arguments.
awt : starts up the viewer using a Java AWT GUI.
help : pints a usage message.
version : prints the current version of the prodreg program.
Example
/usr/bin/prodreg
113 prstat - to report active process statistics in Sun Solaris
To report active process statistics in Solaris:
# prstat [ -acJLmRtTv ] [ -C psrsetlist ] [ -j projlist ] [ -k tasklist ] [ -n ntop[,nbottom] ] [ -p pidlist ] [ -P cpulist ] [ -s key | -S key ] [ -u euidlist ] [ -U uidlist ] [ interval [count] ]Example
prstat -u root -n 5 -P 1,2 1 1
114 prtconf - to get hardware information in Sun Solaris
To get hardware information in Sun Solaris:
# prtconf -v
Example
prtconf -v
115 prtconf - to get OBP (open boot prom) revision in Sun Solaris
To get the OBP (open boot prom) revision in Sun Solaris:
# prtconf -VExample
prtconf -V
116 prtdiag - to list hardware configuration in Sun Solaris
To list hardware configuration in Sun Solaris:
# /usr/platform/`uname -i`/sbin/prtdiag -v
Note: works on sun4u and sun4d only
Example
/usr/platform/`uname -i`/sbin/prtdiag -v
117 prtpicl - how to find the scsi sync speed in Sun Solaris
To to find the scsi sync speed in Sun Solaris:
# prtpicl -v | grep sync-speedExample
prtpicl -v | grep sync-speed
118 prtvtoc - how to get information about disk geometry and partitioning in Sun Solaris
To get information about disk geometry and partitioning in Sun Solaris:
# prtvtoc [-fhs] [-t vfstab] [-m mnttab] device
where:
-f : reports on the disk free space, including the starting block address of the free space, number of blocks, and unused partitions.
-h : omits the headers from the normal output.
-s : omits all headers but the column header from the normal output.
-t : use vfstab as the list of filesystem defaults, in place of /etc/vfstab.
-m : use mnttab as the list of mounted filesystems, in place of /etc/mnttab.
Example:
# prtvtoc /dev/rdsk/c#t#d#s2
Example
prtvtoc /dev/rdsk/c0t3d0s2
119 prtvtoc - to read a disk label in Sun Solaris
To read a disk label in Sun Solaris:
# prtvtoc
Example
prtvtoc
120 psradm - how to change processor operational status in Sun Solaris
The psradm utility changes the operational status of processors in Solaris. The valid states for the processor are on-line, off-line and no-intr.
# psradm -f | -i | -n [-v] processor_id
# psradm -a -f | -i | -n [-v]
The following options are supported:
-a : perform the action on all processors, or as many as possible.
-f : take the specified processors off-line.
-i : set the specified processors no-intr.
-n : bring the specified processors on-line.
-v : output a message giving the results of each attempted operation.
where processor_id is the processor ID of the processor to be set on-line or off-line or no-intr.
Example to set processors 2 and 3 off-line:
# psradm -f 2 3
Example to set processors 1 and 2 no-intr:
# psradm -i 1 2
Example to set all processors on-line:
# psradm -a -n
Example
psradm -a -n
121 psrinfo - display information about processors in Sun Solaris
To display information about processors in Sun Solaris:
# psrinfo [-v] [processor_id...]
# psrinfo -s processor_id
Without the processor_id operand, psrinfo displays one line for each configured processor, displaying whether it is on-line, non-interruptible (designated by no-intr), off-line, or powered off, and when that status last changed. Use the processor_id operand to display information about a specific processor.
The -v flag displays info about all configured processors in verbose mode.
Example
psrinfo 1
122 ptree - how to find the parent/child process 'tree' of a process in Sun Solaris
To find the parent/child process 'tree' of a process in Solaris:
# /usr/proc/bin/ptree pid>
Example
/usr/proc/bin/ptree 666
123 pwck - how to check the password file in Solaris
pwck scans the password file and notes any inconsistencies. The checks include validation of the number of fields, login name, user ID, group ID, and whether the login directory and the program-to-use-as-shell exist. The default password file is /etc/passwd.
# pwck [filename]
Example
pwck
124 pwdx - how to find the working directory of a process in Sun Solaris
To find the working directory of a process in Sun Solaris:
# /usr/proc/bin/pwdx pidExample
/usr/proc/bin/pwdx 666
125 share - to export NFS filesystems in Sun Solaris
To export NFS filesystems in Solaris:
To share a single filesystem:
# share [-F FSType] [-o specific_options] [-d description] [pathname]
Example to share filesystem /disk in readonly:
# share -F nfs -o ro /disk
To share all filesystems in /etc/dfs/dfstab:
# shareall
Example
share -F nfs -o ro /disk; shareall
126 showrev - how to show machine, software revision, and patch revision information in Sun Solaris
To show machine, software revision, and patch revision information in Sun Solaris:
# /usr/bin/showrev [-a] [-p | -p -R root_path] [-w] [-c command] [-s hostname]
where:
-a : print all system revision information available. Window system and patch information are added.
-c : print the revision information about command.
-p : print only the revision information about patches.
-R : define the full path name of a directory to use as the root_path.
-s : perform this operation on the specified hostname.
-w : print only the OpenWindows revision information.
Example to show the revision information for patches:
# showrev -p
Example
showrev -p
127 smpatch - how to manage patches in Sun Solaris 9
The smpatch command manages patch installation on single or multiple machines, analyzes patch requirements, and downloads required patches.
/usr/sadm/bin/smpatch subcommand [auth_args ] -- [subcommand_args]
Example to install patches 102893-01, 106895-09, and 106527-05 on the machines lab1 and lab2. The patches are located in the /files/patches/s9 shared directory on the machine fileserver:
# /usr/sadm/bin//smpatch add -H myhost -p mypasswd -u root -- \
-i 102893-01 -i 106895-09 -i 106527-05 \
-d fileserver:/files/patches/s9 \
-n lab1 -n lab2
Example which specifies the /tmp/patch/patch_file to install patches on the machines lab1 and lab2. The patches are located in the NFS network-mounted directory /net/fileserver/export/patchspool/Solaris9:
# /usr/sadm/bin/smpatch add -H myhost -p mypasswd -u root -- \
-x mlist=/tmp/patch/patch_file \
-d /net/fileserver/export/patchspool/Solaris9 \
-n lab1 -n lab2
Example to install the patches listed in /tmp/patch/patch_file on the machines listed in /tmp/patch/machine_file. The patches are located in the default /var/sadm/spool directory on the default machine myhost:
# /usr/sadm/bin/smpatch add -H myhost -p mypasswd -u root -- \
-x mlist=/tmp/patch/patch_file \
-x mlist=/tmp/patch/machine_file
Example that analyzes the lab1 machine and downloads the assessed patches from the Sunsolve Online database to the default patch spool directory:
# /usr/sadm/bin/smpatch download -p mypasswd -u root -- -n lab1
Example which downloads the 102893-01 and 106895-09 patches from the Sunsolve Online Database to the /files/patches/s8 directory located on the default machine:
# /usr/sadm/bin/smpatch remove -p mypasswd -u root -- -i 10283-01
Example to remove patch 102893-01:
# /usr/sadm/bin/smpatch remove -p mypasswd -u root -- -i 10283-01
Example
/usr/sadm/bin/smpatch download -p mypasswd -u root -- -n lab1
128 snoop - to capture TCP/IP network information in Sun Solaris
o capture TCP/IP (sniff) network information in Solaris:
# snoop [ -aPDSvVNC ] [ -d device ] [ -s snaplen ] [ -c maxcount ] [ -i filename ] [ -o filename ] [ -n filename ] [ -t [ r | a | d ] ] [ -p first [ , last ] ] [ -x offset [ , length ] ] [ expression ]
Example to capture all packets and display them as they are received:
# snoop
Example to view only RPC summary lines:
# snoop -i rpc.cap -V | grep RPC
Example to capture packets with host funky as either the source or destination and display them as they are received:
# snoop funky
Example to capture packets between funky and pinky and save them to a file:
# snoop -o cap funky pinky
Then inspect the packets using times (in seconds) relative to the first captured packet:
# snoop -i cap -t r | more
To look at selected packets in another capture file:
# snoop -i pkts -p99,108
To look at packet 101 in more detail:
# snoop -i pkts -v -p101
Example to view just the NFS packets between sunroof and boutique:
# snoop -i pkts rpc nfs and sunroof and boutique
Example
snoop
129 sotruss - how to trace shared library procedure calls in Sun Solaris
To trace shared library procedure calls in Sun Solaris:
# /usr/bin/sotruss [ -f ] [ -F bindfromlist ] [ -T bindtolist ] [ -o outputfile ] executable [ execut able arguments ... ]
where:
-F bindfromlist : a colon-separated list of libraries that are to be traced.
-T bindtolist : a colon-separated list of libraries that are to be traced. Only calls to these libraries will be traced.
-o : sotruss output will be directed to the outputfile.
-f : follow all children created by fork() and print truss output on each child process.
Example to show the tracing of a simple ls command:
# sotruss ls
Example
sotruss ls
130 svcadm - how to manage services in Solaris 10
The svcadm command allows you to manage services in Solaris 10. svcadm issues requests for actions on services executing within the service management facility. Actions for a service are carried out by its assigned service restarter agent. The default service restarter is svc.startd
# /usr/sbin/svcadm [-v] enable [-rst] {FMRI | pattern}…
# /usr/sbin/svcadm [-v] disable [-st] {FMRI | pattern}…
# /usr/sbin/svcadm [-v] restart {FMRI | pattern}…
# /usr/sbin/svcadm [-v] refresh {FMRI | pattern}…
# /usr/sbin/svcadm [-v] clear {FMRI | pattern}…
# /usr/sbin/svcadm [-v] mark [-It] instance_state {FMRI | pattern}…
# /usr/sbin/svcadm [-v] milestone [-d] milestone_FMRI
# /usr/sbin/svcadm [-v] restarter_FMRI {FMRI | pattern}…
where:
-v : print actions verbosely to standard output
-r : enables/disables each service instance and recursively enables/disables its dependencies
-s : enables/disables each service instance and then waits for each service instance to enter the online/offline or degraded state
-t : temporarily enables each service instance until reboot
Example
svcadm disable http
131 swap - how to add a swapfile in Sun Solaris
To add a swapfile in Solaris:
# swap -a /new/swapfile
Note: you must frst create the swapfile (100 MB in our case) with the mkfile command:
# mkfile -v 100m /new/swapfile
If you want to make this swapfile permanent, you must add a line in /etc/vfstab like so:
/new/swapfile - - swap - no -Example
swap -a /new/swapfile
132 swap - how to delete a swapfile in Sun Solaris
To delete a swapfile in Solaris:
# swap -d /dev/dsk/c0t0d0s4
If this a swap space which was added using a swapfile, you must remove the file manually.
# swap -d /new/swapfile
# rm /new/swapfile
Note: The swapfile will be removed when there is no more activity on it. Use swap -l to see when it is no longer in use.
Example
swap -d /dev/dsk/c0t0d0s4
133 swap - to get swap information in Sun Solaris
To get swap information in Sun Solaris:
Long listing:
# swap -l
Swap summary:
# swap -s
Example
swap -s; swap -l
134 sys-unconfig - how to clear or reset network information in Sun Solaris
To clear or reset network information in Sun Solaris:
# sys-unconfigExample
sys-unconfig
135 sysdef - to find the current and maximum value of file descriptors in hexadecimal in Sun Solaris
To output system definition in Solaris:
# /usr/sbin/sysdef [-n namelist]
# /usr/sbin/sysdef [-h] [-d] [-D]
To find the current and maximum value of file descriptors in hexadecimal:
# sysdef | grep descriptors
Example
sysdef | grep descriptors
136 trapstat - how to report trap statistics in Solaris
The trapstat utility gathers and displays run-time trap statistics on UltraSPARC-based systems. The default output is a table of trap types and CPU IDs, with each row of the table denoting a trap type and each column of the table denoting a CPU.
# /usr/platform/ platform-name /sbin/trapstat [-t| -T| -e entry] [-C processor_set_id| -c cpulist] [-P] [-a] [-r rate] [[interval[count]]| command| [args]]
# /usr/platform/ platform-name /sbin/trapstat -l
Example
trapstat
137 truss - how to trace system calls and signals in Sun Solaris
To trace system calls and signals in Sun Solaris:
# truss [-fcaeildD] [ - [tTvx] [!] syscall ,...] [ - [sS] [!] signal ,...] [ - [mM] [!] fault ,...] [ - [rw] [!] fd ,...] [ - [uU] [!] lib ,... : [:] [!] func ,...] [-o outfile] command | -p pid...
where:
-p : interprets the command arguments to truss as a list of process-ids for existing processes rather than as a command to be executed.
-f : follows all children created by fork() or vfork() and includes their signals, faults, and system calls in the trace output.
-c : counts traced system calls, faults, and signals rather than displaying the trace line-by-line. A summary report is produced after the traced command terminates or when truss is interrupted.
-a : shows the argument strings that are passed in each exec() system call.
-e : shows the environment strings that are passed in each exec() system call.
-i : do not display interruptible sleeping system calls.
-l : includes the id of the responsible lightweight process (LWP) with each line of trace output.
-d : includes a time stamp on each line of trace output.
-D : includes a time delta on each line of trace output.
-t : system calls to trace or exclude.
-T : system calls that stop the process.
-v : verbose.
-x : displays the arguments to the specified system calls (if traced by -t) in raw form, usually hexadecimal, rather than symbolically.
-s : signals to trace or exclude.
-S : signals that stop the process.
-m : machine faults to trace or exclude.
-M : machine faults that stop the process.
-r : shows the full contents of the I/O buffer for each read() on any of the specified file descriptors.
-w : shows the contents of the I/O buffer for each write() on any of the specified file descriptors.
-u : user-level function call tracing.
-U : user-level function calls that stop the process.
-o : file to be used for the trace output. By default, the output goes to standard error.
Example trace of the find command:
# truss find . -print >find.out
Example trace of the open, close, read, and write system calls:
# truss -t open,close,read,write find . -print >find.out
Example trace of the spell.sh script on the file truss.out:
# truss -f -o truss.out spell.sh document
Example to verbosely trace the system call activity of process #1, init:
# truss -p -v all 1
Example
truss -p 1234
138 uadmin - how to sync filesystems and reboot in Sun Solaris
To sync filesystems and reboot in Solaris:
# /sbin/uadmin x x
Example to sync the filesystems and powers off the system:
# /sbin/uadmin 2 6
Example to sync the filesystems and reboots to multi-user mode:
# /sbin/uadmin 2 1
Example to sync the filesystems and reboots to single-user mode:
# /sbin/uadmin 2 3
Note: If you substitute a 1 for the 2, the system will not sync before doing the other actions.
Example
/sbin/uadmin 2 6
139 uname - to determine the system type in Sun Solaris
To determine the system type in Sun Solaris:
# uname -i
Example
uname -i
140 unshare - to unexport NFS filesystems in Sun Solaris
To unexport NFS filesystems in Solaris:
To unshare a single filesystem:
# unshare [-F FSType] [-o specific_options] [pathname | resourcename]
Example to share filesystem /disk in readonly:
# unshare -F nfs -o ro /disk
To unshare all filesystems in /etc/dfs/dfstab:
# unshareall
Example
unshare -F nfs -o ro /disk; unshareall
141 useradd - add a new user to a Solaris, linux or HP/UX server
# useradd [-c comment] [-d home_dir] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]]
[-m [-k skeleton_dir] | -M] [-n] [-o] [-p passwd] [-r] [-s shell] [-u uid] login
Example
useradd -c "First Lastname" -d /home/user1 -g staff -s /usr/bin/ksh -u 888 newguy
142 userdel - delete a user from a Solaris, linux or HP/UX server
To delete a user from a Solaris, linux or HP/UX server:
# userdel [-r] login
Example
userdel -r newguy
143 who - to find the runlevel of the OS
To find the runlevel of the OS on AIX, Solaris, HP/UX:
# who -r
Example
who -r
144 wtmpfix - how to examine and correct utmpx/wtmpx format files
wtmpfix examines the standard input or named files in utmpx format, corrects the time/date stamps to make the entries consistent, and writes to the standard output. A hyphen (-) can be used in place of file to indicate the standard input.
# wtmpfix [file]
Note: Depending on your flavour of Unix, the file may be called wtmpx or wtmp.
Example
wtmpfix /var/adm/wtmpx
No comments:
Post a Comment