Tuesday, March 12, 2013

Cleaning up the Operating System device tree after removing LUNs - Solaris 10



You must clean up the device tree after removing LUNs. The OS commands may vary for Solaris versions. This procedure uses Solaris 10 .

To clean up the device tree after you remove LUNs

1. The removed devices show up as drive not available in the output of the format command:

2. "413. c3t5006048ACAFE4A7Cd252 drive not available
/pci@1d,700000/SUNW,qlc@1,1/fp@0,0/ssd@w5006048acafe4a7c,fc"


3. After the LUNs are unmapped using Array management or the command line, Solaris also displays the devices as either unusable or failing.

4. bash-3.00# cfgadm -al -o show_SCSI_LUN | grep -i unusable

5. c2::5006048acafe4a73,256 disk connected configured unusable
c3::5006048acafe4a7c,255 disk connected configured unusable
bash-3.00# cfgadm -al -o show_SCSI_LUN | grep -i failing
c2::5006048acafe4a73,71 disk connected configured failing
c3::5006048acafe4a7c,252 disk connected configured failing


6. If the removed LUNs show up as failing, you need to force a LIP on the HBA. This operation probes the targets again, so that the device shows up as unusable. Unless the device shows up as unusable, it cannot be removed from the device tree.

luxadm -e forcelip /devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0:devctl

7. To remove the device from the cfgadm database, run the following commands on the Solaris

8. cfgadm -c unconfigure -o unusable_SCSI_LUN c2::5006048acafe4a73
cfgadm -c unconfigure -o unusable_SCSI_LUN c3::5006048acafe4a7c
                                              
                                                     OR
cfgadm -o unusable_FCP_dev -c unconfigure c2::5006048acafe4a73

9. Repeat step 2 to verify that the LUNs have been removed.

10. Clean up the device tree. The following command removes the /dev/rdsk... links to /devices.

$devfsadm -Cv

--------------------------------------------------------------------------------------------------------------------

Monday, January 14, 2013

Check and change Solaris Locale

To check and change Solaris Locale. Below document is from Sunsolve.

How to view the current locale setting

The current locale setting can be viewed with:
# locale
LANG=en_US
LC_CTYPE= "en_US"
LC_NUMERIC= "en_US"
LC_TIME= "en_US"
LC_COLLATE= "en_US"
LC_MONETARY= "en_US"
LC_MESSAGES= "en_US"
LC_ALL=en_US
How to change the locale setting

Locales can be set or changed in 3 ways:

Via the CDE login locale

As a user-specific locale

As a system default locale

To change the current locale setting, first confirm that the desired locale is installed on the system with:

# locale -a
de
en_AU
en_CA
en_UK
C
If the desired locale is not in the list, you will need to install the appropriate packages for that locale. (See the Note below for more information about locale packages.)

How to change the locale via the CDE login locale

To change the locale for a new CDE session by selecting a different locale from the CDE login screen:

On the CDE login banner:

Choose options - languages

Under languages - choose the new locale

The CDE banner will re-cycle and then you can login to the selected locale.

Note: If a user has a different default locale set in their environment, then that locale setting will override the selected CDE login locale.

How to set a user-specific locale

Note: The syntax for setting the locale variables (LANG and LC_*) is shell dependent.

For sh, ksh:

# LANG=; export LANG
# LC_ALL=; export LC_ALL
Example:

# LANG=C; export LANG
# LC_ALL=C; export LC_ALL
For csh:

# setenv LANG
# setenv LC_ALL
Example:

# setenv LANG C
# setenv LC_ALL C
Note: To set a default locale for a user's environment, set the LANG or LC_* variables in a user's shell initialization file such as $HOME/.profile or $HOME/.cshrc

How to change the locale by setting the system default locale

To set or change the system default locale, edit the /etc/default/init file and set the LANG and LC_* variables.

LANG=C
LC_ALL=C
Example from the /etc/default/init file:

# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, or any of the LC_* environment variables.
LANG=C
LC_ALL=C
Note: The system must be rebooted after making changes to the /etc/default/init file in order for the changes to take effect.

After setting or changing the locale, verify that the locale is set correctly:

Check if the locale is set correctly by running the locale command without any options:

# locale
LANG=C
LC_CTYPE= "C"
LC_NUMERIC= "C"
LC_TIME= "C"
LC_COLLATE= "C"
LC_MONETARY= "C"
LC_MESSAGES= "C"
LC_ALL=C