Showing posts with label SVM. Show all posts
Showing posts with label SVM. Show all posts

Oneway mirror Need Maintenance state and connectivity lost issue in Storage

Wednesday, October 10, 2012 at 7:38 AM

If you encounter onway mirror issue with Storage disk. If the disk status is okay but problem to clear the Need maintenance state and to avoid this problem in future the below is the solution.


Configuration and the submirror status:



d8: Mirror

Submirror 2: d28
State: Needs maintenance
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1715358144 blocks


d28: Submirror of d8


State: Needs maintenance


Invoke: after replacing "Maintenance" components:

metareplace d8 c2t0d1s0
Size: 1715365632 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t0d1s0 0 No Last Erred

# umount /local

# umount /test2


If the file systems cannot be unmounted then you will have to reboot into single user mode before continuing with the below commands.

# fsck -F ufs -y /dev/md/rdsk/d215

# fsck -F ufs -y /dev/md/rdsk/d230

# metaclear d215

# metaclear d230

# metaclear -rf d8


# metainit d8 1 1 c2t0d1s0

# metainit d215 -p d9 -o 87666101 -b 743486015 -o 853202938 -b 76379648 -o 930764284 -b 182452224 -o 1117410814 -b 85983232
# metainit d230 -p d9 -o 46833323 -b 3774156 -o 843685879 -b 3807232


# mount /local

# mount /test2


d8: Mirror

Submirror 2: d28
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 1715358144 blocks


d28: Submirror of d8

State: Okay
Size: 1715365632 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t0d1s7 0 No Okay

Soft Partition error and recover

Friday, July 13, 2012 at 7:18 AM
Error State:

d304: Soft Partition

Component: d7
State: Errored
Size: 6291456 blocks
Extent Start Block Block count
0 104867779 6291456

Action to clear the Error:
# metarecover d20 -p -m



20: Soft Partition metadb configuration is valid


WARNING: You are about to overwrite portions of 20 with soft partition metadata. The extent headers will be written to match the existing metadb configuration. If the device was not previously setup with this configuration, data loss may result.


Are you sure you want to do this (yes/no)? yes


d20: Soft Partitions recovered from metadb # metastat d304


d304: Soft Partition
Component: 20
State: Okay
Size: 6291456 blocks
Extent Start Block Block count
0 104867779 6291456




d20: Mirror
Submirror 0: d17
State: Okay
Submirror 1: d27
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 286678272 blocks



d17: Submirror of d20
State: Okay
Size: 286678272 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c1t2d0s0 0 No Okay
c1t3d0s0 10176 No Okay



d27: Submirror of d20
State: Okay
Size: 286678272 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c1t4d0s0 0 No Okay
c1t5d0s0 10176 No Okay

#


Error Message: metainit: node: "d74": unit not found

Thursday, February 23, 2012 at 2:15 AM
node:/root# metainit -s nfsdg d74 -p d80 100g
metainit: node: "d74": unit not found
node:/root#
Identify the devfsadm process ID and kill it.

node:/root# ps -ef grep -i devfsadm
root 3099 1472 0 10:38:14 pts/1 0:00 grep -i devfsadm
root 15066 1 0 11:25:41 ? 58:46 /usr/lib/devfsadm/devfsadmd
node:/root# kill -9 15066
node:/root#
Now try it should work now
node:/# metainit -s nfsdg d74 -p d80 100g
d74: Soft Partition is setup
node:/#

Failed root disk replacement in SVM

Wednesday, December 21, 2011 at 4:46 AM
Step1: Backup of the current SDS configuration:
[root]# metastat -p >> /etc/lvm/md.tab
removal of replicas stored on this disk
[root]# metadb -d c1t0d0s4
Step2: detach and deletion of sub mirror d11 (swap)
[root]# metadetach d1 d11 && metaclear d11
Step3: disk removal
[root]# luxadm remove_device /dev/rdsk/c1t0d0s2
WARNING!!! Please ensure that no file systems are mounted on these device(s). All data on these devices should have been backed up.
The list of devices which will be removed is:
1: Device name: /dev/rdsk/c1t0d0s2 Node WWN: 2000000c504fd050
Device Type: Disk device
Device Paths: /dev/rdsk/c1t0d0s2
Please verify the above list of devices and then enter c or to Continue or q to Quit. [Default: c]:c stopping: /dev/rdsk/c1t0d0s2.... Done
offlining: /dev/rdsk/c1t0d0s2.... Done
The drives are now off-line and spun down.
Physically remove the disk and press the Return key.
Hit after removing the device(s).
Note: Disk has to be physically removed before pressing "ENTER" when running luxadm remove_device; otherwise, picld will notify the kernel that the drive was not removed and WWN of this drive will remain in the loop -- and the FCAL subsystem may get confused, especially if recommended patches are out of date
[root]# devfsadm -C -c disk
Step4: Insertion of the new disk drive:
<<< physical insertion >>>
[root]# devfsadm -v
Step5: partitioning:[root]# prtvtoc /dev/rdsk/c1t1d0s2 fmthard -s - /dev/rdsk/c1t0d0s2
Step6: adding SDS replicas :
[root]# metadb -ac 3 c1t0d0s4
Step7: resynchronization :
[root]# metainit d11 && metattach d1 d11
[root]# for i in 0 3 6 ; do metareplace -e d$i c1t0d0s$i ; done

Disk test with dd command

Tuesday, October 11, 2011 at 5:59 AM
#dd if=/dev/dsk/c2t0d0 of=/dev/null bs=1024k
#dd if=/dev/dsk/c2t1d0 of=/dev/null bs=1024k

SVM(Solaris Volume Manager)

Saturday, August 8, 2009 at 9:08 AM
Solaris Volume Manager
Solaris Volume Manager is a software product that lets you manage large numbers of disks and the data on those disks. Although there are many ways to use Solaris Volume Manager

Include the following tasks:
Increasing storage capacity
Increasing data availability
Easing administration of large storage devices

Please refer the below sun site for all SVM details

RAID mirroring for V490 with storeEdge 3150

at 9:01 AM

Hardware Setup and Assumptions

This guide is intended primarily to get the basic Solaris 9 Operating Environment set up and to configure the FC3510 array for use. It stops short of setting up the partitioning scheme used by ON-Center, but leaves the system in a state where this is easily done as the next step.
This guide assumes that the FC3510 only has a single controller, and is connected to the host with a single Fibre Channel HBA. The HBA should be connected to Port 0 of the FC3510 controller.

Operating System Setup

This section guides you through the installation and configuration of Solaris 9.

Operating System Installation
Install Solaris 9 on the server. Keep the following in mind:

  • Just install Solaris - don't worry about Extra Value Software, the Software Companion, or any extra products.
  • Select "Entire Distribution plus OEM support" as the software group to install.
  • Allocate only system partitions during the install (/, /var, and swap). Choose Manual Layout and use the example below.
  • Use only the first disk for system partitions, as we will encapsulate and mirror these to the second disk later with Solaris Volume Manager.
  • The system should have two internal physical disks. Leave the bulk of the free space on the first disk unallocated. We can use this space for additional soft partitions later, if needed.

Example disk configuration for a system with two 146GB drives (this is just the first disk, we will set up the second disk after install):

Part Tag Size

Slice 0 root 30.00GB # /

Slice 1 swap 8.00GB # swap space

Slice 2 backup 146.35GB # whole disk

Slice 3 var 10.00GB # /var

Slice 4 unassigned 8.00GB # dump device

Slice 5 unassigned 0

Slice 6 unassigned 90.00GB # soft partitions mirror

Slice 7 unassigned 34.78MB # SVM state database

  • Configure networking on the server as appropriate.
  • Configure the network-based Service Processor for future administration. This is Highly Recommended.

Disk Configuration

We use Solaris Volume Manager (previously Solstice) to provide redunancy and management for our system. For this description, the first disk (primary mirror) is c1t0d0 and the second disk (secondary mirror) is c1t1d0.

  • Duplicate the slice layout of the boot disk on the drive that will be its mirror:

# prtvtoc /dev/rdsk/c1t0d0s2 fmthard -s - /dev/rdsk/c1t1d0s2

  • Configure the new dedicated dump device. This is done so that we don't have to depend on a working swap mirror to retrieve a kernel core dump:

# dumpadm -d /dev/dsk/c1t0d0s4

  • Initialize the state database replicas for Solaris Volume Manager. This gives us four state replicas, two per disk:

# metadb -a -f -c 2 c1t0d0s7 # metadb -a -c 2 c1t1d0s7

  • Create the /, swap, and /var volumes as follows:

# metainit -f d10 1 1 c1t0d0s0

# metainit -f d11 1 1 c1t0d0s1

# metainit -f d13 1 1 c1t0d0s3

# metainit d20 1 1 c1t1d0s0

# metainit d21 1 1 c1t1d0s1

# metainit d23 1 1 c1t1d0s3

# metainit d0 -m d10

# metainit d1 -m d11

# metainit d3 -m d13

  • Set up the system to boot from the mirror: # metaroot d0
  • Change the entries for swap and /var in /etc/vfstab to point to their new locations (/dev/md/dsk/d1, /dev/md/dsk/d3). Don't forget to change the /dev/rdsk entries to /dev/md/rdsk as well.
  • Write down the name of the second disk in the mirror indicated in bold below:

# ls -l /dev/rdsk/c1t1d0s0 lrwxrwxrwx 1 root root 47 Feb 22 11:38 /dev/rdsk/c1t1d0s0 ->devices/pci@1c,600000/scsi@2/sd@1,0:a,raw

  • Halt the system:

# init 0

  • Create an OpenBoot PROM alias for the bootable disks. Some controllers require you to replace sd with disk; you can verify this with the show-disks command before running the nvalias commands. For the V210 and the V240, it appears we should make this substitution. Also, remove ,raw from the end of the device name. You can also look at the output of devalias for examples; in particular, look at disk0 and disk1.

ok nvalias bootdisk /pci@1c,600000/scsi@2/disk@0,0:a

ok nvalias mirrdisk /pci@1c,600000/scsi@2/disk@1,0:a

ok setenv boot-device bootdisk mirrdisk

ok boot
Once booted, attach the submirrors to complete the mirroring:

# metattach d0 d20

# metattach d1 d21

# metattach d3 d23

* Mirror the remaining free space on the disks for future soft partitions. Later, you can allocate soft partitions from d6 for whatever you like:

# metainit d16 1 1 c1t0d0s6

# metainit d26 1 1 c1t1d0s6

# metainit d6 -m d16

# metattach d6 d26

  • For example, to allocate a 10g soft partition that would be mounted at /data:

# metainit d100 -p d6 10g

# newfs -m 0 /dev/md/dsk/d100

# mkdir /data

  • Then, edit /etc/vfstab to include the new mountpoint and set it to mount during boot.

Patching

Now we will install the Solaris 9 Recommended and Security patches, last updated Feb 21, 2007. Download 9_Recommended_Security-20070221.zip. Once it's on the system, run the following commands to install:

# unzip -d 9_Recommended_Security-20070221 9_Recommended_Security-20070221.zip ... unzip output ...

# cd 9_Recommended_Security-20070221/9_Recommended

# ./install_cluster

Answer `y' to start installing patches.
Many of the patches will fail to install, but this is (usually) because the patch has already been applied or is not needed on the system. Check the patch log at /var/sadm/install_data/Solaris_9_Recommended_Patch_Cluster_log for details of the process.

FC3510 Setup

Here we install the software required to access the FC3510 storage array, and then we configure it.

SAN 4.4.12 Installation

Next we install the SAN software, which includes drivers for the Fibre Channel host adapter.

Download SAN 4.4.12: SAN_4.4.12_install_it.tar.Z. Once it's on the system, run the following commands to install:

# zcat SAN_4.4.12_install_it.tar.Z tar xvf - ... tar output ...

# cd cd SAN_4.4.12_install_it

# ./install_it

Answer `y' to start installing the software.
If the installation succeeds, reboot the system:

# shutdown -y -i6 -g0

It would be wise to watch the system console while it reboots in case errors appear during boot related to the new patches.

StorEdge 3000 Family Software Installation

The Sun StorEdge 3000 Family Software includes the command line utility (sccli) used to manage the external array.
Download the Sun StorEdge 3000 Family Software:
2.2_sw_solaris-sparc.zip and2.3_smis_provider.zip. Once on the system, run the following commands to install:

# unzip -d 2.2_sw_solaris-sparc 2.2_sw_solaris-sparc.zip ... unzip output ...

# pkgadd -d 2.2_sw_solaris-sparc/solaris/sparc Answer `all' to install all packages, and then `y' to any questions. # unzip -d 2.3_smis_provider 2.3_smis_provider.zip ... unzip output ... # pkgadd -d 2.3_smis_provider Answer `all' to install all packages, and then `y' to any questions.

FC3510 Firmware Upgrade

Now we will upgrade the firmware on the FC3510.
Download patch 113723-15:
113723-15.zip. Decompress the patch with unzip and read the section entitled "Patch Installation Instructions" inside of README.113723-15. This README documents the upgrade steps better than I could do here.

Array Configuration

We need to delete any existing LUN mappings, and then delete the logical drives themselves. Run sccli to enter the configuration tool. It should connect to the 3510 automatically.
First, display the current LUN mappings (this is an example and may not match what you see): sccli> show lun-maps

Ch Tgt LUN ld/lv ID-Partition Assigned Filter Map

-----------------------------------------------------------------0 40 0 ld0 1A6C4238-00 Primary
For each LUN mapping, run unmap Ch.Tgt.LUN. Do this starting with the highest numbered LUNs and work your way down to 0. For example, using the above output:

sccli> unmap 0.40.0

sccli>
Exit sccli and run the following:

# devfsadm -Cv ... output regarding device changes, if any ...

Now restart sccli, and display the logical drives:

sccli> show logical-drives

LD LD-ID Size Assigned Type Disks Spare Failed Status ------------------------------------------------------------------------

ld0 1A6C4238 58.59GB Primary RAID0 2 0 0 Good Write-Policy Default StripeSize 128KB

And delete each logical drive by running delete logical-drive LD for each logical drive. For example:

sccli> delete logical-drive ld0

This operation will result in the loss of all data on the logical drive.

Are you sure? y

sccli: ld0: deleted logical drive
Now we have a clean array, ready for a new configuration. We have 6 73GB drives in each array, we will configure 5 of the disks into a RAID5 configuration with a spare sixth disk. This should give us about 292GB of usable storage. Note the following examples were done using only 5 disks, so the size numbers will be less than a 6 disk system. Make sure that your configuration uses all but 1 disk for the RAID5 array and the last disk for a spare.

First, we configure SCSI channel 0. This setting should be the same as the default config, but we'll make sure:

sccli> configure channel 0 host pid 40 --reset

sccli: shutting down controller...

sccli: controller is shut down

sccli: resetting controller... sccli: controller has been reset

Now we will set the cache parameters for the array. Since this is a single-controller array, we need to make sure we're using write-through caching, as write-back caching is dangerous without a redundant controller. Also, we set the array to optimize for random access:

sccli> set cache-parameters random write-through

Changes will not take effect until controller is reset

Do you want to reset the controller now? y

sccli: resetting controller...

sccli: controller has been reset

Now we're ready to create our logical disk. Type the following commands into sccli to display the disks in the system, configure a RAID5 logical disk, and configure a global spare drive. Remember, make sure that your configuration uses all but 1 disk for the RAID5 array and the last disk for a spare:

sccli> show disks

Ch Id Size Speed LD Status IDs

Rev ----------------------------------------------------------------------------

2(3) 0 68.37GB 200MB NONE FRMT FUJITSU MAT3073F SUN72G 0602 S/N000513B02RF7 WWNN

500000E010FC3EF0

2(3) 1 68.37GB 200MB NONE FRMT FUJITSU MAT3073F SUN72G 0602 S/N 000512B02DYP WWNN 500000E010F8CF60

2(3) 2 68.37GB 200MB NONE FRMT FUJITSU MAT3073F SUN72G 0602 S/N 000512B02E3S WWNN 500000E010F8D410

2(3) 3 68.12GB 200MB NONE NEW FUJITSU MAT3073F SUN72G 0602 S/N 000513B02RN8 WWNN 500000E010FC8500

2(3) 4 68.37GB 200MB NONE FRMT FUJITSU MAT3073F SUN72G 0602 S/N 000514B02VRY WWNN 500000E010FE8100

sccli> create logical-drive raid5 2.0,2.1,2.2,2.3 primary global-spare 2.4

sccli> map ld0 0.40.0 sccli> show disks

Ch Id Size Speed LD Status IDs

Rev ----------------------------------------------------------------------------

2(3) 0 68.37GB 200MB ld0 ONLINE FUJITSU MAT3073F SUN72G 0602 S/N 000513B02RF7 WWNN 500000E010FC3EF0

2(3) 1 68.37GB 200MB ld0 ONLINE FUJITSU MAT3073F SUN72G 0602 S/N 000512B02DYP WWNN 500000E010F8CF60

2(3) 2 68.37GB 200MB ld0 ONLINE FUJITSU MAT3073F SUN72G 0602 S/N 000512B02E3S WWNN 500000E010F8D410

2(3) 3 68.37GB 200MB ld0 ONLINE FUJITSU MAT3073F SUN72G 0602 S/N 000513B02RN8 WWNN 500000E010FC8500

2(3) 4 68.37GB 200MB GLOBAL STAND-BY FUJITSU MAT3073F SUN72G 0602 S/N 000514B02VRY WWNN 500000E010FE8100

sccli> show logical-drives

LD LD-ID Size Assigned Type Disks Spare Failed Status ------------------------------------------------------------------------

ld0 7D1F7008 204.35GB Primary RAID5 4 1 0 Good I Write-Policy Default StripeSize 32KB

sccli> show map
We are now done with the array configuration. Exit =sccli= and run:

# devfsadm -Cv

... output regarding device changes, if any ...

Host Configuration

We will now configure the drive array for access from the host system.

Slice Setup

Now, when you run format, you should see the new device and should be able to configure it:

# format

Searching for disks...done

c2t40d0: configured with capacity of 204.34GB

AVAILABLE DISK SELECTIONS:

0. c1t0d0 /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000011c63f6cd7,0 1. c1t1d0 /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w2100000c50010967,0 2. c2t40d0 /pci@9,600000/SUNW,qlc@1,1/fp@0,0/ssd@w216000c0ff88655a,0 Specify disk (enter its number): 2

selecting c2t40d0

[disk formatted]

Disk not labeled. Label it now? y

... format menu, choose `p' and `p' again ...
And there's the disk, right on target 40 where we put it. You should now see the slices in the new LUN. Reconfigure the slices such that all space is given to the first slice (i.e., it matches the s2 slice). It should look something like this:

partition> p

Current partition table (unnamed):

Total disk cylinders available: 52723 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 0 - 52722 20 4.34GB (52723/0/0)

428532544

1 unassigned wm 0 0 (0/0/0) 0

2 backup wu 0 - 52722 204.34GB (52723/0/0)

428532544

3 unassigned wm 0 0 (0/0/0) 0

4 unassigned wm 0 0 (0/0/0) 0

5 unassigned wm 0 0 (0/0/0) 0

6 unassigned wm 0 0 (0/0/0) 0

7 unassigned wm 0 0 (0/0/0) 0

label the disk and exit the format utility.

Solaris Volume Manager Setup

We need to add another set of SVM state replicas to the new disk and create an SVM submirror so we can allocate soft partitions:

# metadb -a -c 2 c2t40d0s0

# metainit d7 1 1 c2t40d0s0

At this point we should have two SVM devices suitable for soft partition allocation: d6 and d7. d6 has the extra space from the disks internal to the server, and d7 has the entire RAID5 array from the FC3510. For example, to allocate a 50GB soft partition from the RAID5 array (we'll call it d101), you would run the following command:

# metainit d101 -p d7 50g
You could then run newfs on /dev/md/dsk/d101 and otherwise treat it as a standard block device.

Root Mirroring (Solaris Volume Manager) in the Solaris 9 and 10 OS

at 8:58 AM
Procedure for mirroring root with Solaris Volume Manager. For the Solaris 10 OS, SVM Version 3.0, REV=2005.01.09.21.19, and for the Solaris 9 OS SVM version 1.0, REV=2002.04.14.23.49. (Note: Results may vary.)

Step1:

Run the format command; below is an example of the output:

AVAILABLE DISK SELECTIONS:
0. c3t2d0
/pci@7b,0/pci1022,7458@11/pci1000,3060@2/sd@2,0
1. c3t3d0
/pci@7b,0/pci1022,7458@11/pci1000,3060@2/sd@3,0
In my example, I'm mirroring the root partitions along with the other partitions from the disk drive.

Drives c3t2d0 and c3t3d0.

Procedure for root Mirroring

First, partition your primary drive, typically the one that the Solaris OS is currently running on. (In my case, this is drive 0, c3t2d0.)

Transfer the partition table from one drive to another

prtvtoc /dev/rdsk/c3t2d0s2 | fmthard -s - /dev/rdsk/c3t3d0s2

Note: Notice the use of s2, which is typically the overlap partition; if you changed this on the disk, please substitute the proper slice in its place.

Step2:

Two disks looking the same, execute the following:

metadb -a -c 3 -f c3t2d0s7 c3t3d0s7

The -c 3 creates three copies of the metastat database in this space, just in case a single copy gets corrupted (which is never good).

Step3:

Initialize the disk that makes up the root partition by doing the following. Using s0 because this is root partition

metainit -f d11 1 1 c3t2d0s0
metainit -f d12 1 1 c3t3d0s0

Step4:

Create the actual mirror:

metainit d10 -m d11

completed the preceding steps, need to run the following command, which will automatically update /etc/system and /etc/vfstab to let it know that you are using a metadevice as your root disk.

metaroot d10

Step5:

Init 6
or
reboot

After you have executed the commands above, you need to reboot the machine before attaching the other half of the mirror to the root device. You can't attach a currently mounted device, or the machine will go crazy. In order to attach the device you will need to do the following:

Step6:

metattach d10 d12

To check on the status of the mirror, you can do the following:

metastat d10

You will want to update the Openboot with the prior alias for the boot devices. You can do this by doing the following:

ls -l /dev/dsk/c0t0d0s0

Your output will look similar to the following

lrwxrwxrwx 1 root root 42 Jul 12 2007 /dev/dsk/c0t0d0s0 -> ../../devices/pci@1e,600000/ide@d/sd@0,0:a

Step7:

You will need to update the bold part above, with your output. You will then run the following command from the OS

eeprom "nvramrc=devalias mirror /pci@1e,600000/ide@d/sd@0,0:a devalias mirror-a /pci@1e,600000/ide@d/sd@1,0:a"

eeprom boot-device="mirror mirror-a"

eeprom "use-nvramrc?=true"

The below commands for doing this are from the OK prompt, don't do this else wise.

"nvalias mirror /pci@1e,600000/ide@d/sd@0,0:a mirror-a /pci@1e,600000/ide@d/sd@1,0:a"

"setenv boot-device mirror mirror-a"

Step8:

If you are mirroring just the two internal drives, you will want to add the following line to /etc/system to allow it to boot from a single drive. This will bypass the SVM Quorum rule

set md:mirrored_root_flag = 1

Please note that if you are running a Sparc platform you can use the installboot command in order to install the boot blocks onto the head of the drive.

Step9:

For a UFS based File system you will use the below command.

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s0

And on a ZFS based File System you will use the below command

installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0

If you are on a X86 Platform you will want to use installgrub to do similar functions, below you will find references for that

/sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0



Solaris | Powered by Blogger | Entries (RSS) | Comments (RSS) | Designed by MB Web Design | XML Coded By Cahayabiru.com