Solaris Volume Manager

dee43
dee43 used Ask the Experts™
on
Can someone give me step by step instructions from the command line on how to mirror existing file systems using SVM in OS9?  There is no data on these file systems.

   

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Before you get into creating the actual mirror there are some vital steps you need to do.

First, you need to have copies of the metastatedatabase
on disk. The metadb livs in memory and keeps track of what
logical devices you have, which partitions used, hotspares etc.
If you dont have a copies on disk you will get a supprise
if the system reboots ( everything is gone )

You need to have a dedicated partition or use the partition that you will use for the new mirror.
Best is to have both.
Note that you CAN NOT create replicas on partitions containing
filesystems. They will be destroyed.

You can create more than one replica on a partition but remember, half of the replicas must be alive otherwise the system will panic.
Half of the replicas + 1 must be available if you need to reboot the system.
Depending on how your disks looks like it is also a good idea to have one more disk to put a replica on.

Create the replicas with:

metadb -a -f -c 2 /dev/dsk/cXdXtXsX
and two replicas is created, now create two more
metadb -a -c 2 /dev/dsk/AnotherSlice

Now you have 2 + 2 replicas which means that if one of the disks crash
your system will stay up. But you want be able to reboot.
For this you need 4/2 + 1  thats why its good to create a 5 replica on yet another disk.

And then, you can start mirrioring as in the docs pointed out by yuzh above.
If you need help with this, come back

HTH
Good advise besky !

Thanks.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Commented:
Thanks yuzh
I know, I teach this stuff for a living.
That is why I get a little nervous when the
other "experts" gives advice which might create
a major problem in the future.

Author

Commented:
Besky,

Could you give me step by step instructions on how to perform all of the above you mentioned?

This is my first time doing this type of thing, however, the system is not in production so if I screw this up I can start over.

I have two 36gb drives. I formated the second drive and it took 332 minutes-- is that normal?

What should I do next?

Dee


 

Commented:
No that is not normal.
On the other hand,
scsi disks normally doesnt have to be formatted.

So two disks, but no data on the filesystems  that will be mirrored.


If you have created the relicas as I mentioned above, continue with:   if not, print out info of the first disk and send it ( that is the partitiontable)

metainit -f d1 1 1 /dev/dsk/c0t0d0sX   X is the slice no.
metainit d2 1 1 /dev/dsk/c0t1d0sX      on disk 2
metainit d0 -m d1 d2    ( this is ONLY if d1 has no data since no resyncing between mirrors will be done in this case )

now do a umount of the filessystem on the d1 metadevice
umount /dev/dsk/c0t0d0sX ( or /data or what you have )

edit the /etc/vfstab file and replace
/dev/dsk/c0t0d0sX with /dev/md/dsk/d0
and
/dev/rdsk/c0t0d0sX with /dev/md/rdsk/d0
save the file and do a
newfs /dev/md/rdsk/d0
mount "name of mountpoint ( /data or whatever )

So, are you ok with this ?

Author

Commented:
besky,  

I haven't create the relicas.  Here's my disk info.
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN36G 24620 alt 2 hd 27 sec 107>    
/pci@9,600000/SUNW,q1c@2/fp@0,0/ssd@w21000004cf9666db,0




Commented:
OK, can you do a
prtvtoc /dev/rdsk/c0t0d0s0

that gives the partition info.

What filesystem do you want to mirror ?

Author

Commented:
Here's the FS
Filesystem kbytes   used    avail  capacity  Mounted on
/dev/dsk/c1t0d0s0  3096423 1344297  1690198    45%    /
/dev/dsk/c1t0d0s3  18539608 1028186  17326026   6%    /usr
/proc                 0       0     0           0%    /proc
/mnttab              0       0     0      0%    /etc/mnttab
fd                         0       0     0       0% /dev/fd
/dev/dsk/c1t0d0s4  9758783 33817   9627379     1%    /var
/swap         15496808    48      15496760    1%    /var/run
/swap          15497096    336      15496760    1%    /tmp
/dev/dsk/c1t0d0s5  3096423 9      3034486     1%    /export
--------------
Is this correct?

metadb -a -f -c 2 /dev/dsk/c1t0d0s3
metadb -a -c 2 /dev/dsk/c1t0d0s4

Commented:
NO, you cant create replicas on fs that contains data
(like usr and var. This will destroy your current
filesystems.

I see you have slice 6 unused on c1t0d0, is there any
unused space you kan use for that ?

Commented:
NO, you cant create replicas on fs that contains data
(like usr and var. This will destroy your current
filesystems.

I see you have slice 6 unused on c1t0d0, is there any
unused space you kan use for that ?

Author

Commented:
besky,

yes.  can we use some space from /usr?  

btw, thanks for being so patient with me.  

Commented:
NO, not if you already have a /usr on that partition.
If you create a replica there you will damage the beginning of the /usr UFS-filesystem and the whole /usr will be gone.

Commented:
What you can do is rezise your swap ( steal a liitle bit from it)
and use that space on an unused partition on the system disk.

The disk c1t0d0 seems to have s6 unused, that could be used
for this.

So, take the system to single user
# init s
# swap -d /dev/dsk/c1t0d0s1  ( guess your swap is here, check with "swap -l")
# format
choose this disk and type partition + RETURN
will give you this prompt:
partition>
type print + RETURN  and you will see the partitiontable
type 1
and youll be asked for a tag, just press return
youll be asked for flags, just press return
now comes "starting cylinder, this should be the same, press return
and now size, reduce it by som 20 - 50Mb from what you had before.

type print again to see the partitiontable
check the ending cylinder of slice 1 and the nearest used cyl
above this number, probably startcyl for s3

for example: if si ends at cyl 12220 and s3 starts at 15000

type 6+return  ( to change slice 6 )
tag and flag, just press return
starting cyl 12221
size 14999e

type print again and check that it looks ok.

type label to write the new partitiontable to disk

exit from format
do   "swap -a /dev/dsk/c1t0d0s1" to attach the swapspace again

and take the system up by typing "init 3"

Now you can create the replicas on /dev/dsk/c1t0d0s6

metadb -f -a -c 2 /dev/dsk/c1t0d0s6

I dont know how yur second disk looks but say that you have made a similar slice 6 on that disk
metadb -a -c 2 /dev/dsk/c1tXd0s6   X= target number

and you are set to create your mirror.

Long story but that's what it takes.

HTH

Commented:
Oh, btw I think I missed your question.

Yes, if /usr has a lot of free space it is possible to resize it the same way as swap BUT you will need to do
a backup of /usr first, create a new filesystem with newfs
after changing the cylindernumbers and then do a restore from the backup.

Much more work than taking it from swap.

Author

Commented:
besky,

This is what I did so far, before I proceed, could you check the cylinders for P6?  I don't feel comfortable with the starting and ending cylinders being the same.

Part Tag        Flag  Cylinders    Size     Blocks
0    root       wm    2541- 4718   3.00GB  (2178/0/0  6292242
1    swap       wu    0  - 327    462.69MB (328/0/0  947592
2    backup      wm    0  - 24619  33.92GB  (24620/0/0  71127180
3    usr     wm    11582-24619 17.96GB  (13038/0/0  19827207
4    var     wm    4719-11581   9.45GB  (6863/0/0   6292242
5    unassigned wm    363-  2540   3.00GB  (2178/0/0   2889
6    unassigned wm    11583-11583  1.41MB  (1/0/0       0
7    unassigned wm    0  -  0         0    (0/0/0       0

Commented:
No that is not right, and more the cyl 11583 is part of the /usr which is in slice 3 and starts on 11582.

BUT you have some unallocated cylinders between 328 and 362 you could use.

So let s6 start on 328 and end at 362

Author

Commented:
besky,

I've followed your instructions and now I think I'm ready to create the mirror, however, when I do a df -k, I do not see s6.  If I do a prtvtoc /dev/rdsk/c1t0d0s0-- i see it.

If you think I'm ready to create the mirror let me know and I will close this question.

Also, do the partitions on disk two need to be the same as disk one?

Commented:
Its ok, with df you only see the mounted filesystems.

No the two disk dont have to be identical, just make sure
that d2 is as big as d1.

Author

Commented:
Thanks for all your help!  I am going to try to create the mirror disk next week.  I may need your help, so check back next week.

Again, thanks!

Dee

Commented:
OK,and btw, you can see your replicas with
metadb -i


I'll be gone monday-tuesday,
going to help my daughter to rewire her house.

Until next time

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial