How to do MIRRORING under SVM (Solaris Volume Manager) in Solaris.

Yogesh Raheja

Yogesh working as a Consultant in Unix Engineering by profession. And he has multiple years experience in Solaris, Linux , AIX and Veritas Administration. He has been certified for SCSA9, SCSA10, SCNA10, VXVM, VCS, ITILv3. He is very much passionate about sharing his knowledge with others. Specialties: Expertize in Unix/Solaris Server, Linux (RHEL), AIX, Veritas Volume Manager, ZFS, Liveupgrades, Storage Migrations, Cluster deployment (VCS and HACMP) and administration and upgrade on Banking, Telecom, IT Infrastructure, and Hosting Services.

Loading Facebook Comments ...

33 Responses

  1. Andy Paton says:

    As always an excellent guide, but I think you have failed to mention two steps/points.

    1) Setting up OBP to automatically boot from mirror disks
    2) Booting with 50% of available replicas is possible/optional with the /etc/system setting “set md:mirrored_root_flag=1”

    Andy

  2. Yogesh Raheja says:

    Thanks @Andy, yes you are right I forgot these two points. Setting up disks and qourum entry in system file. Thanks for bringing these into notice. :-)

  3. Gowtham says:

    Very useful article..  thank you Yogesh..

    can i practice solaris  in online.. is any website providing this… let us know.. Thanking you..

  4. Yogesh Raheja says:

    @Gawtham, You are most welcome!!…you need SUN server to perform all these tasks.

  5. Rajjat says:

    can we dp mirroring on intel version of solaris 10 (on my laptop)? I am still searching for the job in solaris administration. Since I do not have any hands on so will it be possible to perform these activites on virtual box from my laptop(intel version of soalris 10)

  6. Yogesh Raheja says:

    @Rajjat, yes you can do the mirroring on virtual machine but you have to make some new changes in the menu.lst file in order to boot your server from second disk. Also you need to find the disk from Grub menu, which you will amend in the menu.lst. But yes you can play with the SVM part (i.e SVM commands in order to do your hands on).

  7. Saurabh says:

    Yogesh, could you pls provide the steps for VMware to boot from second disk as you have mentioned menu.lst file above?

  8. Yogesh.Raheja says:

    @Saurabh, mirror the disk and then in Grub Menu (at grun prompt) find the disk by findroot command, it will give you disk entry like (hd0,0) and then boot the server from root disk and edit menu.lst with the same entry which you got.
    Also remember its different than Linux and some modification also needs to be done on eeprom. Then you will be able to boot from both the disks.

  9. Rajjat says:

    @Saurabh, thnx for putting up this question. @ Yogesh,thnx for helping in it..looking forward to get some good hands on this aspect..thanx again…

  10. Yogesh Raheja says:

    @Rajjat, you are most welcome.

  11. Michael says:

    on looking on the metastat output can anyone say whtr it is concat or stripe .. I see SVM has a bug here for which SVM cannot differntiate concat or stripe thats the reason why we always end up with an output concat/stripe setup  .This can be said whtr it concat or stripe based on the disk involved intially so the number 1 1 , 2 1 which forms a part of a syntax metainit determines it here …. does anyone have any other solution here …. 

    • Ramdev says:

      @hi micheal – Concat/stripe text is not a bug, but it is a type which is superset of three different simple metadevices those are concat , stripe or ‘concatenation of stripes’. Whenever we have only one metadevice made up of single slice, there is no sense in differentiating them as concat/stripe, because we know those concepts were introduced for the purpose of device expansion using multiple sub components. again you might ask me ” why they are called as concat instead of stripe?”, the answer is ” the striping must require interlacing, and we normal dont set interlacing on single device , so they are called as concat.

      point 2: if you have meta devices made up of multiple slices, and you want to know what type it is .. it is easy to find from metastat.

      >>>>> if you see interlace value after the size of device it is striped device, and normally they appear like

      concat/stripe
      stripe
      device 0
      device 1

      >>> for concat devicese there is no interlace value and the format looks like

      concat/ stripe
      stripex
      devicex
      stripey
      devicey

      pls let me know if it doesn’t answer your question.

  12. Yogesh.Raheja says:

    Nice explanation Ram.

  13. Michael says:

    @Ram 

    Thanks for the reply but i  agree on it but still i could say SVM cannot diffrentiate concat and stripe  if you check out the metainit syntax also u define metainit … and moreover to be precise i could say to increase a stripe volume we need to build a concatenated stripe volume … here 

  14. Michael says:

    For those who need a to find out how much free space is existing on the mirror so that the FS on soft partition  could be extended to the desired value when needed 

    metarecover -v -n -p -m |grep -i free 

  15. Michael says:

    metarecover -v -n -p -m |grep -i free   correction to the above

  16. Michael says:

    ooops sorry for multilpe post above i tried postin it in but couldn here is the correct one 
    metarecover -v -n mirror name -p -m |grep -i free

    • Ramdev says:

      @micheal – having conflicting openions is good and it improves reasoning ability.
      For now, we dont need to stop here for immediate answers, we will just move on from here keeping the points discussed in mind. I am sure we will find the right answers at somepoint on our way.

  17. Yogesh Raheja says:

    @Michael, I agreed with you. Its a new thing to work upon now. Though we will find many theoritical differences between concate & stipe. But pratically both landed on same ground. I tried to make diferent combinations but unable to find any differences. I really appreciate your close view on this. hatsoff to your thinking Mr. Michael.

  18. Also its more simpler in VXVM to create & identify the concat/stripe volume types. and the same is much simpler to understand with practical concept.

    ROOT@yogeshtest1:/root # vxprint -thv yogeshconcat
    Disk group: mydg

    V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
    PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
    SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    DC NAME PARENTVOL LOGVOL
    SP NAME SNAPVOL DCO
    EX NAME ASSOC VC PERMS MODE STATE

    v yogeshconcat – ENABLED ACTIVE 1024000 SELECT – fsgen
    pl yogeshconcat-01 yogeshconcat ENABLED ACTIVE 1024000 CONCAT – RW
    sd mydisk1-02 yogeshconcat-01 mydisk1 10485760 1024000 0 c1t0d0 ENA
    pl yogeshconcat-02 yogeshconcat ENABLED ACTIVE 1024000 CONCAT – RW
    sd mydisk2-01 yogeshconcat-02 mydisk2 10485760 1024000 0 c1t2d0 ENA ROOT@yogeshtest1:/root #

    ROOT@yogeshtest1:/root # vxprint -htv yogeshstripe
    Disk group: mydg

    V NAME RVG/VSET/CO KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
    PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
    SC NAME PLEX CACHE DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    DC NAME PARENTVOL LOGVOL
    SP NAME SNAPVOL DCO
    EX NAME ASSOC VC PERMS MODE STATE

    v yogeshstripe – ENABLED ACTIVE 1024000 SELECT yogeshstripe-01 fsgen
    pl yogeshstripe-01 yogeshstripe ENABLED ACTIVE 1024000 STRIPE 2/128 RW
    sd mydisk1-03 yogeshstripe-01 mydisk1 11509760 512000 0/0 c1t0d0 ENA
    sd mydisk2-02 yogeshstripe-01 mydisk2 11509760 512000 1/0 c1t2d0 ENA

  19. Michael says:

    @ Ram , Yogesh … Thanks for your responses and support yes we need work it upon SVM has lots of pros and cons …. we need to figure it out and with ZFS in place looks like SVM would be given a second thought soon …… 

    Has anyone had a root or the boot  Fs mirroed and when sometimes it happens for us to boot the system into maintainence state for some system activity in this we end up always with the metastat output showing mirrors in “Needs Maintainence” state this is beacuse as you boot the system “metasync” command which runs as a part of normal boot process is intrupted when the system boots to single user mode and hence we get this situiation od “needs maintainence”  nothing to panic here on this as you again boot the system to multiuser mode the metasync would get executed and resyncronisation starts again …..

    • Ramdev says:

      @ micheal – abt metasync point, i believe the reason for the ” needs maintenance” is because of incomplete disc sync before reboot, but not because of interruption of metasync during reboot. If you look at svm.sync startup script , you can find that metasync initiates only during rc level 2, until then the sync won’t start.

      Abt the solution, running metasync -r will fix the issue, provided that the disk had no real error blocks.

  20. Yogesh Raheja says:

    @Michael, to be very frank. I havent came across such situation. But again I will try this today on my test machine to check the results. Thanks for the info.

  21. Michael says:

    @ Yogesh this will never occur when u do an clean shutdown and boot it single user mode from OBP …. 

    @Ram ill have a look at it …. seems to be like that but m not sure on it let me check Thanks for the info :) 

  22. Yogesh Raheja says:

    @Michael, yes you are right.

  23. Santosh says:

    Hi Yogesh,
    nice post and well explained..
    can you let me know the same task in VxVM?

  24. Yogesh Raheja says:

    @Santosh, sure I will make a post on VXVM mirroring for you.

  25. Pedro Alvarez says:

    Hi Yogesh Nice to meet you… excelent post now a question, 
    have you a procedure to growfs a mirrored root partition ???

    Best Regards ???

  26. Darian says:

    Hi Pedro nice to see you here you can find the solution here 
    http://gurkulindia.com/main/2011/05/solaris-svm-grow-mirrored-root-under-sds-svm/

  27. Yogesh Raheja says:

    @Darian, thanks for this :).
    @Pedro, the above mentioned link will provide with the step by step approach to grow root FS under SVM. :)

  28. seema says:

    Hi can i create SVM raid 5 volume on my boot disk. ….. oracle doc says it can be created on an existing file systems , …. i wanted to have RAID 5 for /,/usr and swap with 3 disks.
    Is there a solution …?

  29. seema says:

    typo error ” cannot * ” be created

Leave a Reply

Your email address will not be published.

[contact-form to='ramkumar.ramadevu@gmail.com' subject='New Learning Request Submitted'][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Learning Request' type='textarea' required='1'/][contact-field label='Are you Looking for ' type='radio' required='1' options='Paid Training,Free Training'/][/contact-form]

What is your Learning Goal for Next Six Months ? Talk to us