tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Can I  break a mirror without getting cut?
@ 2000-12-03  1:47 Darryl Milczarek
  0 siblings, 0 replies; only message in thread
From: Darryl Milczarek @ 2000-12-03  1:47 UTC (permalink / raw)
  To: tru64-unix-managers

Again, thanks to Walter North and Howard Arnold for helping me understand
that this really can be done.

In essence, all it takes is preparation, a good backup, and courage.

The following is a DETAILED explanation of the steps taken. It was prepared
as a log of what I did to be used at the time I must once again 'undo' all
this and return back to the safety of the RAID 0+1 configuration. Most
likely, it is too detailed, but I share it in the hope that someone else may
find it of value, should they be faced with similar needs.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   

How to break the mirror and not get cut.

Premise: Need to break the mirror from a 6 disk raid 0+1 set because 
each disk group was configured to only use half of the available space.
Also needed to recover three of the disks for other uses.
Finally, I needed to NOT loose the data on the fileset!

Step 1, as always, was to back up the fileset to tape. Then I did the
following subsequent steps:

Un-mount the fileset:
umount /u03

Stop the volume:
volume -g oracledg stop oracle

Dis-associate the plex from the volume:
volplex -g oracledg dis oracle-01

Dis-associate the sub-disks from the plex:
volsd -g oracledg dis oracled03-01
volsd -g oracledg dis oracled02-01
volsd -g oracledg dis oracled01-01

Now I was ready to break the mirror.

I ran volplex with the '-o rm' option to dissociate and remove the plex
(and its associated subdisks) in the same operation. This made the space
used by those subdisks usable for new allocations.

volplex -g oracledg -o rm dis oracle-02

And I had to remove the disks from the oracledg disk group:
voldg -g oracledg rmdisk oracled04
voldg -g oracledg rmdisk oracled05
voldg -g oracledg rmdisk oracled06

Create a new disk group named testdg and add the newly released 
disks to a new disk group, testdg,

voldg -g test addisk testdg01=rz27

Then create subdisks using the entire available space on each disk:

volmake -g testdg sd test01-sd testdg01,0,35564032
volmake -g testdg sd test02-sd testdg02,0,35564032
volmake -g testdg sd test03-sd testdg03,0,35564032


Then I created a new volume 'test' to contain the 
new 'test-01' plex with three subdisks as members.

Next I used dxlsm to create a volume, then highlighted the three subdisks
and created a plex, using volume 'test'.

volmake -p -g testdg -o plex test-01 sd=testdg01,testdg02,testdg03
volmake vol test usetype=fsgen plex=test-01
volume start test

Finally, create the file domain and fileset and mount them to a new mount
point.

# mkfdmn /dev/vol/u06test
# mkfset u06test u06
# mount -t advfs u06test#u06 /u06

Now I checked my work:

# volprint -g testdg
TYPE NAME         ASSOC        KSTATE     LENGTH COMMENT
dg   testdg       testdg       -               -
dm   testdg01     rz27         -        35564040
dm   testdg02     rz28         -        35564040
dm   testdg03     rz29         -        35564040
sd   test01-sd    test-01      -        35564032
sd   test02-sd    test-01      -        35564032
sd   test03-sd    test-01      -        35564032
plex test-01      test         ENABLED  106692096
vol  test         fsgen        ENABLED  106692096

****

Note: I used dxlsm to ease the creation of volume, plex and subdisk, but it
could be done by hand thus:

volmake -U fsgen -g oracledg vol region writeback=on read_pol=SELECT
user=root group=system mode=0600 log_type=BLKNO len=53128704
volmake -g oracledg plex region-01 layout=STRIPE st_width=128
sd=oracled03-02,oracled02-02,oracled01-02
volsd -g oracledg assoc oracle-01 oracled01-01
volsd -g oracledg assoc oracle-01 oracled02-01
olsd -g oracledg assoc oracle-01 oracled03-01
volplex -g oracledg att oracle oracle-01
volplex -g oracledg att region region-01
volume -g oracledg start region

****

With the new fileset online, I copied the data from /u03 to /u06 using the
-pR option to preserve attributes
and copy all directory trees:
cp -pR /u03/* /u06/copy_of_u03

With the data safely copied, I was ready to re-size the sub-disks:

I used dxlsm, rt-click on a subdisk, copy the size from a subdisk in testdg,
as they are at maximum size.

Associate the subdisks to the plex:
volsd -g oracledg assoc oracle-01 oracled01-01
volsd -g oracledg assoc oracle-01 oracled02-01
volsd -g oracledg assoc oracle-01 oracled03-01

Attach the plex to the volume:
volplex -g oracledg att oracle oracle-01

Start the volume:
volume -g oracledg start oracle

Now the fileset needs to be rebuilt and mounted:

Remove the old fileset:
rmfset u03_oracle u03

Remove the old domain:
rmfdmn u03_oracle

Make the domain again:
mkfdmn /dev/vol/oracledg/oracle u03_oracle

Make the new fileset:
mkfset u03_oracle u03

Mount the fileset
mount -t advfs u03_oracle#u03 /u03

Check your work:

# df -k
Filesystem       1024-blocks        Used   Available Capacity  Mounted on
root_domain#root     1993584      127787     1858368     7%    /
/proc                      0           0           0   100%    /proc
usr_domain#usr       8032560     7727175      277656    97%    /usr
u03_domain#u03       1761056          16     1756592     1%    /u03/oradata
u01_domain#u01       1033168          16     1028792     1%    /u01/oradata
u02_apps#u02         1047720          16     1043336     1%
/u02/apps/logs
usr_var#usr_var      2048936          99     2042184     1%
/usr/var/spool
u05_domain#u05       4091896     3101911      981424    76%    /u05
u04_domain#u04       9560800     3839514     5684560    41%    /u04
u02_domain#u02       2022688          16     2018192     1%    /u02/oradata
temp#temp            2066344      168487     1891424     9%    /temp
u01root#u01root      4074488     1697725     2362984    42%    /u01
u02root#u02root      6563136     3492493     3051688    54%    /u02
u06test#u06         53346048    23383867    29863688    44%    /u06
u03_oracle#u03      53346048          16    53335280     1%    /u03

Restore data to /u03 which was backed up to /u06

cp -pR /u06/copy_of_u03/* /u03

Check your work once again, and you are done.

Darryl Milczarek
EMS 602 258-8545
darryl.milczarek@emsusa.com 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-03  1:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-03  1:47 SUMMARY: Can I break a mirror without getting cut? Darryl Milczarek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox