There is a lot of notes about the mirroring, but I always used this one:
4) Time to get our hands dirty!
The following steps should be done while in single usermode idealy.
4.1) Making both drives the same.
We start with slicing the second drive in the same way as our first
drive, the master.
# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
No need to newfs the second drive slices here, that will automaticaly
done by the mirror syncing later.
4.2) Metadbs
We can now setup our metadbs.
# metadb -a -f -c3 c1t0d0s7 c1t1d0s7
Since its the initial creation of the metadbs, we need to force it with
-f -a adds the metadbs, and -c tells it how many to create.
You can see the results with metadb -i.
metadb -i is a very handy tool to determine the state of your metadb
states.
4.3) Initializing the devices
Now we go to setup the initial metadevices.
# metainit -f d11 1 1 /dev/rdsk/c1t0d0s0;metainit -f d21 1 1 /dev/rdsk/c1t0d0s1;metainit -f d31 1 1 /dev/rdsk/c1t0d0s3;metainit -f d41 1 1 /dev/rdsk/c1t0d0s4;metainit -f d51 1 1 /dev/rdsk/c1t0d0s5;metainit -f d61 1 1 /dev/rdsk/c1t0d0s6
# metainit -f d12 1 1 /dev/rdsk/c1t1d0s0;metainit -f d22 1 1 /dev/rdsk/c1t1d0s1;metainit -f d32 1 1 /dev/rdsk/c1t1d0s3;metainit -f d42 1 1 /dev/rdsk/c1t1d0s4;metainit -f d52 1 1 /dev/rdsk/c1t1d0s5;metainit -f d62 1 1 /dev/rdsk/c1t1d0s6
Like metadb metainit must be forced with -f, but this time not because
its the initial creation, but because we work on mounted filesystems.
So, here we create a 1 way concatenation of our actual slices and form
the needed submirrors.
4.3) Mirroring fun part 1!
metainit d10 -m d11
metainit d20 -m d21
metainit d30 -m d31
metainit d40 -m d41
metainit d50 -m d51
metainit d60 -m d61
Here are the actualy mirroing intialized, the -m tells SDS that we want
to build a mirror with the name in the first colum and consiting of the
submirror in the third colum. We now have a one way mirror of our system
drive, but its not active yet.
4.4) Setting the root device
cp /etc/vfstab /etc/vfstab_pre_sds
cp /etc/system /etc/system_pre_sds
metaroot d10
4.5) Setting up /etc/vfstab
#device device mount FS fsck
mount mount #to mount to fsck point
type pass at boot options #
fd - /dev/fd fd - no -
/proc - /proc proc - no -
#
# sds drives
#
/dev/md/dsk/d0 - - swap - no -
/dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no logging
/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no logging,noatime
/dev/md/dsk/d40 /dev/md/rdsk/d40 /opt ufs 2 yes logging
/dev/md/dsk/d50 /dev/md/rdsk/d50 /export/home ufs 2 yes
logging #
# non sds drives
#
#/dev/dsk/c1t0d0s0 - - swap - no -
#/dev/dsk/c1t0d0s1 /dev/rdsk/c1t0d0s1 / ufs 1 no logging
#/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s2 /var ufs 1 no
logging,noatime #/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /opt ufs 2 yes
logging #/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /export/home ufs 2 yes
logging #
# swap slices
#
swap - /tmp tmpfs - yes -
4.6) Making sure we can boot in case of disk failure.
To make sure we can boot in case a disk fails, we need to tell the
kernel to ignore the quota on metadbs, otherwise we can't boot in a two
disk setup, because we can't never fullfill the requirments.
For that we add the following to /etc/system set
md:mirrored_root_flag=1
# echo "set md:mirrored_root_flag=1" >> /etc/system
4.7) Our first reboot!
Bring down the system to the OBP, don't reboot yet fully.
We need to setup the boot devices now.
OK setenv boot device disk0:b disk1:b
Make sure the devaliases of disk0 and disk1 are actualy pointing to the
correct hardware decives.
Now we boot our system up for the first time on the mirror.
If all went well we are up and running in a few seconds.
4.8) Mirroring fun part 2!
Now its time to hook up the second drive so we have actualy mirrored
slices.
metattach d10 d12
metattach d20 d22
metattach d30 d32
metattach d40 d42
metattach d60 d62
metattach d50 d52
This will take considereble amount of time.
Use metastat to check on the progress of the syncing
Example metastat d30
5) All done, enjoy
6) Troubleshooting
4) Time to get our hands dirty!
The following steps should be done while in single usermode idealy.
4.1) Making both drives the same.
We start with slicing the second drive in the same way as our first
drive, the master.
# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
No need to newfs the second drive slices here, that will automaticaly
done by the mirror syncing later.
4.2) Metadbs
We can now setup our metadbs.
# metadb -a -f -c3 c1t0d0s7 c1t1d0s7
Since its the initial creation of the metadbs, we need to force it with
-f -a adds the metadbs, and -c tells it how many to create.
You can see the results with metadb -i.
metadb -i is a very handy tool to determine the state of your metadb
states.
4.3) Initializing the devices
Now we go to setup the initial metadevices.
# metainit -f d11 1 1 /dev/rdsk/c1t0d0s0;metainit -f d21 1 1 /dev/rdsk/c1t0d0s1;metainit -f d31 1 1 /dev/rdsk/c1t0d0s3;metainit -f d41 1 1 /dev/rdsk/c1t0d0s4;metainit -f d51 1 1 /dev/rdsk/c1t0d0s5;metainit -f d61 1 1 /dev/rdsk/c1t0d0s6
# metainit -f d12 1 1 /dev/rdsk/c1t1d0s0;metainit -f d22 1 1 /dev/rdsk/c1t1d0s1;metainit -f d32 1 1 /dev/rdsk/c1t1d0s3;metainit -f d42 1 1 /dev/rdsk/c1t1d0s4;metainit -f d52 1 1 /dev/rdsk/c1t1d0s5;metainit -f d62 1 1 /dev/rdsk/c1t1d0s6
Like metadb metainit must be forced with -f, but this time not because
its the initial creation, but because we work on mounted filesystems.
So, here we create a 1 way concatenation of our actual slices and form
the needed submirrors.
4.3) Mirroring fun part 1!
metainit d10 -m d11
metainit d20 -m d21
metainit d30 -m d31
metainit d40 -m d41
metainit d50 -m d51
metainit d60 -m d61
Here are the actualy mirroing intialized, the -m tells SDS that we want
to build a mirror with the name in the first colum and consiting of the
submirror in the third colum. We now have a one way mirror of our system
drive, but its not active yet.
4.4) Setting the root device
cp /etc/vfstab /etc/vfstab_pre_sds
cp /etc/system /etc/system_pre_sds
metaroot d10
4.5) Setting up /etc/vfstab
#device device mount FS fsck
mount mount #to mount to fsck point
type pass at boot options #
fd - /dev/fd fd - no -
/proc - /proc proc - no -
#
# sds drives
#
/dev/md/dsk/d0 - - swap - no -
/dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no logging
/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no logging,noatime
/dev/md/dsk/d40 /dev/md/rdsk/d40 /opt ufs 2 yes logging
/dev/md/dsk/d50 /dev/md/rdsk/d50 /export/home ufs 2 yes
logging #
# non sds drives
#
#/dev/dsk/c1t0d0s0 - - swap - no -
#/dev/dsk/c1t0d0s1 /dev/rdsk/c1t0d0s1 / ufs 1 no logging
#/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s2 /var ufs 1 no
logging,noatime #/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /opt ufs 2 yes
logging #/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /export/home ufs 2 yes
logging #
# swap slices
#
swap - /tmp tmpfs - yes -
4.6) Making sure we can boot in case of disk failure.
To make sure we can boot in case a disk fails, we need to tell the
kernel to ignore the quota on metadbs, otherwise we can't boot in a two
disk setup, because we can't never fullfill the requirments.
For that we add the following to /etc/system set
md:mirrored_root_flag=1
# echo "set md:mirrored_root_flag=1" >> /etc/system
4.7) Our first reboot!
Bring down the system to the OBP, don't reboot yet fully.
We need to setup the boot devices now.
OK setenv boot device disk0:b disk1:b
Make sure the devaliases of disk0 and disk1 are actualy pointing to the
correct hardware decives.
Now we boot our system up for the first time on the mirror.
If all went well we are up and running in a few seconds.
4.8) Mirroring fun part 2!
Now its time to hook up the second drive so we have actualy mirrored
slices.
metattach d10 d12
metattach d20 d22
metattach d30 d32
metattach d40 d42
metattach d60 d62
metattach d50 d52
This will take considereble amount of time.
Use metastat to check on the progress of the syncing
Example metastat d30
5) All done, enjoy
6) Troubleshooting
Comments
Post a Comment