Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Metainit or swap

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
US
With the help of this forum, I have finally mirrored all my mount points on my Solaris 9 sun v100 and was looking to finish it off by mirroring swap.

clptcmissun058 root : more /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 -
/dev/dsk/c0t2d0s4 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no logging
/dev/md/dsk/d60 /dev/md/rdsk/d60 /usr ufs 1 no logging
/dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no logging
/dev/md/dsk/d70 /dev/md/rdsk/d70 /export/home ufs 2 yes logging
/dev/md/dsk/d50 /dev/md/rdsk/d50 /opt ufs 2 yes logging
/dev/md/dsk/d10 /dev/md/rdsk/d10 /usr/openwin ufs 2 yes logging
swap - /tmp tmpfs - yes -

I then went to create the submirror but recieved error:

clptcmissun058 root : metainit -f d41 1 1 c0t2d0s4
metainit: clptcmissun058: c0t2d0s4: overlaps with device in metadevice state database

I see that there is a swap being mounted as /tmp but I am not sure what that does. I may have made a mistake and ran a metadb -a c0t2d0s4 when I was first started this. Is there anyway to query the state database and find all entries of c0t2d0s4? I ran a format on the disk and there is no overlaps that I can tell..... metastat looks golden too....
 
The error message refers to the fact you ran metadb on c0t2d0s4. metadb -i inquires the metadb and will show this. Call metadb -d c0t2d0s4 to clear it and then mirror swap - not sure if you need to reboot after clearing metadb to get rid of it from kernel.

/tmp is automatically mounted on your swap partition to enable a fast tmpfs filesystem for temporary files (like a ramdisk since often the files in swap will be memory resident). /tmp is cleared on reboot because swap is reinitialised. Leave the last line in your vfstab alone.
 
When I run "metadb -i" there is no mention of c0t2d0s4:

clptcmissun058 root : metadb -i
flags first blk block count
a m p luo 16 8192 /dev/dsk/c0t2d0s2
a u 16 8192 /dev/dsk/c0t0d0s2

Is that because I did it against s2 and that is the whole drive and it used a free area in s4?
 
well, thinking about it, mirroring all and then a slice of the same disk could be defined as "overlap"
why it does not show up in your first post?
Either mirror the whole disk ( :-(
or mirror each slice as usual, and skip "backup" (s2)

see whether that works

matt
 
hi,

i'm thinking that you have made a general mistake.

solaris expects slice 2 as the whole disk, means from cyl 0 to the last cyl of the disks.

you have your metadb in slice 2. so the message

metainit: clptcmissun058: c0t2d0s4: overlaps with device in metadevice state database

is correct.

i think you have 2 possibilieties:

1. you reorganize your disk, carefull :)
2. you have to install your system again.

i would prefer point 2.
and think about your systemlayout. perhaps you should follow this:

slice Filesystem
0 / (includes /usr and /usr/openwin
1 swap
5 /var
6 /export/home

leave 10-20 mb free on the disk for the sds state database later.

patch solaris with the recommended and security patchcluster from sunsolve.sun.com

install the sds software and the sds-patch
sds version 4.2.1 patch 108693-14 (from sunsole too)

reboot
create the slice for the statedatabase on your rootdisk

#prtvtoc /dev/rdsk/(your rootdisk s2) > /tmp/rootdisk
#fmthard -s /tmp/rootdisk /dev/rdsk/<your mirrordisk s2>

# metadb -a -c3 -f <your rootdisk s7>
# metadb -a -c3 <your mirrordisk s7>

create the simple metadevices for all of your slices, except slice 2
metainit -f d10 1 1 <your rootdisk s0>
metainit -f d11 1 1 <your rootdisk s1>
...

do the same for the metadevices on the second disk
metainit -f d10 1 1 <your mirrordisk s0>
metainit -f d11 1 1 <your mirrordisk s1>
...

create the single sided mirrors:
metainit d0 -m d10
metainit d1 -m d11
...

run
metaroot

edit vfstab

run
lockfs -a
reboot

add the spare side of the mirrors
metattach d0 d20
metattach d1 d21
...

create devicealiases in the obp this enables you to boot from the mirror disk.
nvalias sds-disk <hardware path of your disk0>
nvalias sds-mirror <hardware path of your disk1> Note:This can vary on your system
nvstore

change the bootdevice to your devicealiases, for example sds-disk sds-mirror net
do the same with the diag-device

setenv auto-boot? false

reset

try to boot from sds-disk and the mirror

don't forget to set auto-boot? to true again when all works fine.

I' hope this helps.

bye




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top