nsome
asked on
Solaris 9 Volume Manager - two disk system mirroring question
I've got a system with two 70gb scsi drives c0 & c1 with Solaris 9 04.
I've created hard partitions for the system disk including root /, /var, /opt, /usr on c0t0d0. I used c0t0d0s7 for the state database replica and created 4 on that slice. I created a slice for Solaris VM on c0t0d0s6 with the remainder of the disk drive. On that slice I created 3 separate soft partitions that each correspond to a different filesystem including /export/home and two application filesystems.
Is it possible to mirror this disk and its soft partitions to the c1t0d0 even though the system disk consists of hard partitions?
I've created hard partitions for the system disk including root /, /var, /opt, /usr on c0t0d0. I used c0t0d0s7 for the state database replica and created 4 on that slice. I created a slice for Solaris VM on c0t0d0s6 with the remainder of the disk drive. On that slice I created 3 separate soft partitions that each correspond to a different filesystem including /export/home and two application filesystems.
Is it possible to mirror this disk and its soft partitions to the c1t0d0 even though the system disk consists of hard partitions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please read this note for root disk mirroring (I wrote it for E250, the procedure
apply to Solaris 8/9, for Solaris 9 SVM install by default, and you don't need to add the Solstice DiskSuite 4.2.1)
Part Tag Flag Cylinders Size Blocks
0 root wm 1087 - 3260 4.88GB (2174/0/0) 10243888
1 var wm 3261 - 4130 1.95GB (870/0/0) 4099440
2 backup wm 0 - 7505 16.86GB (7506/0/0) 35368272
3 swap wu 0 - 1086 2.44GB (1087/0/0) 5121944
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 4131 - 7498 7.57GB (3368/0/0) 15870016
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 7499 - 7505 16.11MB (7/0/0) 32984
Note: slice 7 for metadatabase. (mirroring)
Disk 2 (identical to disk 1)
Boot Disk Mirroring Setup use Solaris Volume Manager (Solaris 9):
Note: for Solaris 8 need to install Solstice DiskSuite 4.2.1 from Software CD 2 of 2:
cd /cdrom/sol_8_401_sparc_2/S olaris_8/E A/products /Disksuite _4.2.1
pkgadd -d . (will install all packages including GUI)
Respond: all,y,y,y
Following are the minimum required packages:
SUNWmdr Solstice DiskSuite Drivers (root)
SUNWmdu Solstice DiskSuite Commands
SUNWmdx Solstice DiskSuite Drivers (64-bit)
Note: GUI tools /usr/opt/SUNW/md/sbin/meta tool &
1) Important to backup the following files:
cp -p /etc/system /etc/system.org
cp -p /etc/vfstab /etc/vfstab.org
In case /etc/system gets messed up, we can still use the command boot -a from the OK
prompt and specify by using:
/etc/system.org
2) Make sure that 2nd disk are identical to disk 1
3) copy the disk 1 layout to disk 2:
The VTOC (volume table of contents) on the root disk and root mirror must be the same.
Copy the VTOC using prtvtoc and fmthard.
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t8d0s2
4) Craete metadatabase on the small slice: ( on sds partion )
metadb -a -f -c 2 /dev/dsk/c0t0d0s7 /dev/dsk/c0t8d0s7
5) Create a mirror for each and every slice in the partion table:
for i in 0 1 3 5 ; do
metainit -f d1$i 1 1 c0t0d0s$i # disk 1
metainit -f d2$i 1 1 c0t8d0s$i # disk 2 for E250 use t8
metainit -f d$i -m d1$i # mirror device (one-way)
done
d10: Concat/Stripe is setup
d20: Concat/Stripe is setup
d0: Mirror is setup
d11: Concat/Stripe is setup
d21: Concat/Stripe is setup
d1: Mirror is setup
d13: Concat/Stripe is setup
d23: Concat/Stripe is setup
d3: Mirror is setup
d15: Concat/Stripe is setup
d25: Concat/Stripe is setup
d5: Mirror is setup
Set the metadevice d0 is the root device
metaroot d0
Note:
the metaroot command add the followings to /etc/system file:
* Begin MDD root info (do not edit)
forceload: misc/md_trans
forceload: misc/md_raid
forceload: misc/md_hotspares
forceload: misc/md_sp
forceload: misc/md_stripe
forceload: misc/md_mirror
forceload: drv/pcipsy
forceload: drv/glm
forceload: drv/sd
rootdev:/pseudo/md@0:0,0,b lk
* End MDD root info (do not edit)
and modify the following line in /etc/vfstab file:
from:
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
To:
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
6) Edit /etc/vfstab to mount the new mirrors on boot:
change /dev/dsk/c0t0d0s to /dev/md/dsk/d
change /dev/rdsk/c0t0d0s to /dev/md/rdsk/d
7) Reboot the system to swith to the metadevices.
verify the metadevice setup:
metastat
or
metastat -p
Suppress warning messages (optional):
metainit hsp001
8) Attach the 2nd submirrors to make 2-way mirrors:
for i in 0 1 3 5 ; do
metattach d$i d2$i
done
d0: submirror d20 is attached
d1: submirror d21 is attached
d3: submirror d23 is attached
d5: submirror d25 is attached
This will resync all mirrors simultaneously in the backgroud.
9) Enable the mirror disk to be bootable:
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
/dev/rdsk/c0t8d0s0
Note: in your case the 2nd might be /dev/rdsk/c0t1d0s0
In case you need to boot from the mirror disk, at OBP promt type in:
devalias
to find out the name of your 2nd disk, eg, disk1, then you can do:
boot disk1
to boot from the mirror disk
PS: you need to change the partion numbers to your read disk layout.
apply to Solaris 8/9, for Solaris 9 SVM install by default, and you don't need to add the Solstice DiskSuite 4.2.1)
Part Tag Flag Cylinders Size Blocks
0 root wm 1087 - 3260 4.88GB (2174/0/0) 10243888
1 var wm 3261 - 4130 1.95GB (870/0/0) 4099440
2 backup wm 0 - 7505 16.86GB (7506/0/0) 35368272
3 swap wu 0 - 1086 2.44GB (1087/0/0) 5121944
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 4131 - 7498 7.57GB (3368/0/0) 15870016
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 7499 - 7505 16.11MB (7/0/0) 32984
Note: slice 7 for metadatabase. (mirroring)
Disk 2 (identical to disk 1)
Boot Disk Mirroring Setup use Solaris Volume Manager (Solaris 9):
Note: for Solaris 8 need to install Solstice DiskSuite 4.2.1 from Software CD 2 of 2:
cd /cdrom/sol_8_401_sparc_2/S
pkgadd -d . (will install all packages including GUI)
Respond: all,y,y,y
Following are the minimum required packages:
SUNWmdr Solstice DiskSuite Drivers (root)
SUNWmdu Solstice DiskSuite Commands
SUNWmdx Solstice DiskSuite Drivers (64-bit)
Note: GUI tools /usr/opt/SUNW/md/sbin/meta
1) Important to backup the following files:
cp -p /etc/system /etc/system.org
cp -p /etc/vfstab /etc/vfstab.org
In case /etc/system gets messed up, we can still use the command boot -a from the OK
prompt and specify by using:
/etc/system.org
2) Make sure that 2nd disk are identical to disk 1
3) copy the disk 1 layout to disk 2:
The VTOC (volume table of contents) on the root disk and root mirror must be the same.
Copy the VTOC using prtvtoc and fmthard.
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t8d0s2
4) Craete metadatabase on the small slice: ( on sds partion )
metadb -a -f -c 2 /dev/dsk/c0t0d0s7 /dev/dsk/c0t8d0s7
5) Create a mirror for each and every slice in the partion table:
for i in 0 1 3 5 ; do
metainit -f d1$i 1 1 c0t0d0s$i # disk 1
metainit -f d2$i 1 1 c0t8d0s$i # disk 2 for E250 use t8
metainit -f d$i -m d1$i # mirror device (one-way)
done
d10: Concat/Stripe is setup
d20: Concat/Stripe is setup
d0: Mirror is setup
d11: Concat/Stripe is setup
d21: Concat/Stripe is setup
d1: Mirror is setup
d13: Concat/Stripe is setup
d23: Concat/Stripe is setup
d3: Mirror is setup
d15: Concat/Stripe is setup
d25: Concat/Stripe is setup
d5: Mirror is setup
Set the metadevice d0 is the root device
metaroot d0
Note:
the metaroot command add the followings to /etc/system file:
* Begin MDD root info (do not edit)
forceload: misc/md_trans
forceload: misc/md_raid
forceload: misc/md_hotspares
forceload: misc/md_sp
forceload: misc/md_stripe
forceload: misc/md_mirror
forceload: drv/pcipsy
forceload: drv/glm
forceload: drv/sd
rootdev:/pseudo/md@0:0,0,b
* End MDD root info (do not edit)
and modify the following line in /etc/vfstab file:
from:
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
To:
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
6) Edit /etc/vfstab to mount the new mirrors on boot:
change /dev/dsk/c0t0d0s to /dev/md/dsk/d
change /dev/rdsk/c0t0d0s to /dev/md/rdsk/d
7) Reboot the system to swith to the metadevices.
verify the metadevice setup:
metastat
or
metastat -p
Suppress warning messages (optional):
metainit hsp001
8) Attach the 2nd submirrors to make 2-way mirrors:
for i in 0 1 3 5 ; do
metattach d$i d2$i
done
d0: submirror d20 is attached
d1: submirror d21 is attached
d3: submirror d23 is attached
d5: submirror d25 is attached
This will resync all mirrors simultaneously in the backgroud.
9) Enable the mirror disk to be bootable:
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
/dev/rdsk/c0t8d0s0
Note: in your case the 2nd might be /dev/rdsk/c0t1d0s0
In case you need to boot from the mirror disk, at OBP promt type in:
devalias
to find out the name of your 2nd disk, eg, disk1, then you can do:
boot disk1
to boot from the mirror disk
PS: you need to change the partion numbers to your read disk layout.
ASKER
Before yuzh posted the above procedure, I began using tfewster's link http://www.brandonhutchinson.com/Mirroring_disks_with_DiskSuite.html
After init 6 reboot, for some reason mirror containing of slice 6 from each disk complained about a bad boot block and it couldn't get fisked. This slice was to contain application volumes - system filesystem mirrors seemed to be fine /, /usr,/var and /opt as they all were contained within a mirror instead of a slice.
Now I'm running into the following when trying to su. I can login fine on the console. As root on the console, I can su - uname to another username fine. From that username to root it behaves the same...which seems like a permissions issue after the mirror on usr or something else...
su: Unknown id: root
After init 6 reboot, for some reason mirror containing of slice 6 from each disk complained about a bad boot block and it couldn't get fisked. This slice was to contain application volumes - system filesystem mirrors seemed to be fine /, /usr,/var and /opt as they all were contained within a mirror instead of a slice.
Now I'm running into the following when trying to su. I can login fine on the console. As root on the console, I can su - uname to another username fine. From that username to root it behaves the same...which seems like a permissions issue after the mirror on usr or something else...
su: Unknown id: root
You need to use the Solaris CD to boot up the box to single user mode, the mount /dev/dsk/c0t0d0s0 and check if passwd shdow
files corrupted, if not check the vfstab file to make sure there is no typo in the file.
assume the mount point is /mnt, you need to look at /mnt/etc dir
for the files.
also check your real disk layout against the procedure, to make sure that you have done everything correctly.
Have a nice weekend to all of you, cheers!
files corrupted, if not check the vfstab file to make sure there is no typo in the file.
assume the mount point is /mnt, you need to look at /mnt/etc dir
for the files.
also check your real disk layout against the procedure, to make sure that you have done everything correctly.
Have a nice weekend to all of you, cheers!
Please post your /etc/vfstab plus the output of `metastat -p` and `prtvtoc dev/rdsk/cXtYd0s2` (fill in X and Y as appropriate, for the boot and mirror disk)
Is /usr mounted with the "nosuid" option?
Is /usr mounted with the "nosuid" option?
ASKER
It was an issue with nosuid on it!!
ASKER