Sei sulla pagina 1di 4

10/23/2020 Document 1477405.

1
Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

Solaris Volume Manager (SVM): How to Replace a Physical Disk Containing Soft Partitions
(Doc ID 1477405.1)

In this Document

Goal
Solution
Background
How to Replace a Physical Disk with Unmirrored Soft Partitions
How to Replace a Physical Disk with Mirrored Soft Partitions
References

APPLIES TO:

Sun Solaris Volume Manager (SVM) - Version 11.9.0 to 11.11 [Release 11.0]
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on SPARC (32-bit)
Oracle Solaris on x86-64 (64-bit)
Oracle Solaris on x86 (32-bit)

GOAL

There are several ways to make use of the Solaris Volume Manager (SVM) soft partition feature. These are described in
Document 1417827.1 Solaris Volume Manager (SVM): Best Practices for Creation and Implementation of Soft Partitions.
Briefly, you can configure a large mirror metadevice and create soft partitions from it, or you can create individual soft
partitions and then optionally mirror them in pairs.

Replacing a disk that is configured using the former method, one large mirror metadevice, is simple and follows all the
normal steps for replacing any mirrored disk. If the latter method is used, with individual soft partitions, either unmirrored
or mirrored in pairs, disk replacement becomes more complex. This article addresses this latter scenario.

SOLUTION

Background

Soft partitions are unlike all other metadevices in that configuration data is written directly to the data storage area. All
other metadevices are only pointers to locations on physical storage, and these pointers are tracked in the SVM state
database, contained in state database replicas distributed over several disks.

Soft partition configuration information is tracked in the state database, but markers called "extent headers" are also
written to disk to separate soft partitions. When a disk fails, the replacement disk does not contain the extent headers and
is not yet usable for soft partitions. The metarecover command can be used to examine the state database and compare
it to the on-disk extent headers. If there is a mismatch, metarecover can rewrite extent headers to match what is in the
state database. Click here to view the man page for metarecover.

Below are two procedures. The first addresses the scenario where soft partitions are created from a large Solaris slice and
no mirror exists. In that case, you can recreate the soft partition configuration as it was before the disk replacement, but
you must restore data from backup. In the second scenario, the soft partitions on the failed disk are mirrored, so no need
to restore from backup.

How to Replace a Physical Disk with Unmirrored Soft Partitions

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_266&id=1477405.1 1/4
10/23/2020 Document 1477405.1

This example gives the steps to replace the disk c1t1d0, which has soft partitions.

1. Record the SVM configuration and the disk layout.

# metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s1
a p luo 16 8192 /dev/dsk/c1t1d0s1
a p luo 8208 8192 /dev/dsk/c1t2d0s1
a p luo 8208 8192 /dev/dsk/c1t3d0s1

# metastat -p
d101 -p c1t1d0s3 -o 1 -b 8395200
d102 -p c1t1d0s3 -o 8395202 -b 8395200
d103 -p c1t1d0s3 -o 16790403 -b 4202688
d104 -p c1t1d0s3 -o 20993092 -b 4202688
d105 -p c1t1d0s3 -o 25195781 -b 16780224

# prtvtoc /dev/rdsk/c1t1d0s2 partition map


...
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 12587712 12587711
1 0 00 12587712 81408 12669119
2 5 01 0 143349312 143349311
3 0 00 29469696 80329344 109799039

2. Delete state database replica(s).

# metadb -d c1t1d0s1

3. Unmount any filesystems that use the soft partitions.

4. Replace the failed disk. Consult your system documentation for the correct procedure.

5. Use the format command to recreate the disk partitions of the original disk.

6. Make sure device relocation information is updated. Review


Document 2090016.1 Solaris Volume Manager (SVM) the 'metadevadm -u' Command Shows "New device reloc
information" or "Invalid device relocation information detected" But DevID Is Not Updated
7. Replace state database replica(s).

# metadb -a c1t1d0s1

8. Use the metarecover command to take the information in the state database and write soft partition extent headers
on the newly replaced disk.

# metarecover c1t1d0s3 -p -m
c1t1d0s3: Soft Partition metadb configuration is valid

WARNING: You are about to overwrite portions of c1t1d0s3


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


c1t1d0s3: Soft Partitions recovered from metadb

9. Confirm that the soft partition configuration is correct.

# metarecover -n c1t1d0s3 -p
c1t1d0s3: Soft Partition metadb configuration is valid
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_266&id=1477405.1 2/4
10/23/2020 Document 1477405.1
c1t1d0s3: Soft Partition metadb matches extent header configuration

10. Restore data from backup.

11. Remount any filesystems you had unmounted in step 3 above.

How to Replace a Physical Disk with Mirrored Soft Partitions

In this example, disk c1t2d0 has failed and contains soft partitions that are mirrored on c1t3d0. The most important
difference from the previous procedure is that there is no need to unmount anything, as the working side of the mirror
allows continuous operation. You must replace the disk c1t2d0 and repopulate the soft partition extent headers, then
resynchronize from the running side of the mirrors on c1t3d0. There is no need to restore from backup.

1. Record the SVM configuration and the disk layout.

This example was drawn from an actual production system with a large number of soft partitions, so the configuration is
not quite as regular in naming and so forth as it could be. Only one mirror device is shown, but the same treatment must
be done for each mirror involved. Note that the two soft partitions d110 and d107 do not have the same offset (the -o
value) and that is acceptable. It is required, however, that they have the same block count (the -b value) and they do.

#metadb
flags first blk block count
a m p luo 16 8192 /dev/dsk/c1t0d0s1
a p luo 16 8192 /dev/dsk/c1t1d0s1
a p luo 16 8192 /dev/dsk/c1t2d0s1
a p luo 16 8192 /dev/dsk/c1t3d0s1

#metastat -p
d100 -m d106 d133 1
d106 1 1 d110
d110 -p c1t3d0s3 -o 87452553 -b 10074240
d133 1 1 d107
d107 -p c1t2d0s3 -o 10491458 -b 10074240

# prtvtoc /dev/rdsk/c1t1d0s2 partition map


...
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 12587712 12587711
1 0 00 12587712 81408 12669119
2 5 01 0 143349312 143349311
3 0 00 29469696 80329344 109799039

2. Delete state database replica(s).

# metadb -d c1t2d0s1

3. Detach submirrors on c1t2d0. Keep a record of your actions so you know what to reattach later.

# metadetach d100 d133


(etc)

The metadetach may not work when <submirror> is in "Need maintenance" state. In that case use -f (force) option
with metadetach command.
For example:
# metadetach -f <mirror> <submirror>

4. Replace the failed disk. Consult your system documentation for the correct procedure.

5. Make the partition table of the newly replaced disk match its counterpart on the running disk. You can do this manually
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_266&id=1477405.1 3/4
10/23/2020 Document 1477405.1

using the format command or use the method described in Document 1386408.1 Solaris Volume Manager (SVM): How To
Copy The Partition Table From One Disk To Another.
# prtvtoc /dev/rdsk/c1t3d0s2 | fmhard -s - /dev/rdsk/c1t2d0s2
fmthard: New volume table of contents now in place.

6. Make sure device relocation information is updated. Review


Document 2090016.1 Solaris Volume Manager (SVM) the 'metadevadm -u' Command Shows "New device reloc
information" or "Invalid device relocation information detected" But DevID Is Not Updated
7. Replace state database replica(s).

# metadb -a c1t2d0s1

8. Use the metarecover command to take the information in the state database and write soft partition extent headers on
the newly replaced disk.

# metarecover c1t2d0s3 -p -m
c1t2d0s3: Soft Partition metadb configuration is valid

WARNING: You are about to overwrite portions of c1t1d0s3


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


c1t2d0s3: Soft Partitions recovered from metadb

9. Confirm that the soft partition configuration is correct.

# metarecover -n c1t2d0s3 -p
c1t2d0s3: Soft Partition metadb configuration is valid
c1t2d0s3: Soft Partition metadb matches extent header configuration

10. Use the metattach command to restore mirroring, using the record you made in step 3 above.

# metattach d100 d133

Please visit the Solaris Volume Manager Community to ask questions on this document or any other SVM related issues.

REFERENCES

NOTE:2090016.1 - Solaris Volume Manager (SVM) the 'metadevadm -u' Command Shows "New device reloc information"
or "Invalid device relocation information detected" But DevID Is Not Updated
NOTE:1417827.1 - Solaris Volume Manager (SVM): Best Practices for Creation and Implementation of Soft Partitions
Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_266&id=1477405.1 4/4

Potrebbero piacerti anche