DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

Solaris software RAID | Solaris system administration | Tech-Recipes

Started by qdideas · 9 months ago

No excerpt available. Jump to website »

9 comments

  • Shouldn't this:

    metadb -af -c 2 /dev/dsk/c0t0d0s3 /dev/dsk/c0t0d0s4
    metadb -af -c 2 /dev/dsk/c0t1d0s3 /dev/dsk/c0t0d0s4

    Be this:

    metadb -af -c 2 /dev/dsk/c0t0d0s3 /dev/dsk/c0t0d0s4
    metadb -af -c 2 /dev/dsk/c0t1d0s3 /dev/dsk/c0t1d0s4

    bubba AT bubba.org
  • Great catch! You are correct. The recipe has been fixed.

    Thank you for helping to make Tech-Recipes better!
  • got me out of a hole.

    Two comments
    why do you not put the metadb across 2 physical disks? Would that not be part of the ideal of mirroring? Or do the -af -c 2 done twice actually give you a -af -c 4 ?

    You say edit vfstab and turn on logging. For a linux person on solaris I aint too sure about that. Any clues?

    I would appreciate 10 seconds on lockfs -fa - why not just sync?

    Again nice article - it just works, thanks
  • on sol9:

    bash-2.05# metainit -f d0 d10
    metainit: srv-e4500: d0: "d10": syntax error

    ideas?
  • <ul id="quote"><h6>Anonymous wrote:</h6>on sol9:

    bash-2.05# metainit -f d0 d10
    metainit: srv-e4500: d0: "d10": syntax error

    ideas?</ul>

    from the metainit man page...

    metainit d0 -r d10
  • <ul id="quote"><h6>Anonymous wrote:</h6>on sol9:

    bash-2.05# metainit -f d0 d10
    metainit: srv-e4500: d0: "d10": syntax error

    ideas?</ul>

    metainit d0 -m d10
    metainit d0 -m d10

    the metattach further down should be left without the -f switch since it doesnt exsist in metaattach command

    should just be

    metattach d0 d20
    metattach d1 d21

    not metattach -f d0 d20

    otherwise it works like a charm :wink:
  • <ul id="quote"><h6>Reg wrote:</h6></ul><ul id="quote"><h6>Anonymous wrote:</h6>on sol9:

    bash-2.05# metainit -f d0 d10
    metainit: srv-e4500: d0: "d10": syntax error

    ideas?</ul>

    metainit d0 -m d10
    metainit d0 -m d10

    the metattach further down should be left without the -f switch since it doesnt exsist in metaattach command

    should just be

    metattach d0 d20
    metattach d1 d21

    not metattach -f d0 d20

    otherwise it works like a charm :wink:

    sry
    metainit d0 -m d10
    metainit d1 -m d11

    thats it

    reg
  • why do you use 64mb? is it enough for every disk size? i want to build raid1 with two 400gb disks, can i still use 64mb?
  • The quick way of making a stripe:

    partition each of your disks with a 10mb partition, (I use slice3) to hold your metadb's, assigning the rest of the space to slice 7

    Create you metadb's
    metadb -a -f -c 3 /dev/dsk/c1t1d0s3 /dev/dsk/c1t2d0s3 /dev/dsk/c1t3d0s3

    At the following to /etc/lvm/md.tab

    d0 3 1 dev/dsk/c1t1d0s7 1 /dev/dsk/c1t2d0s7 1 /dev/dsk/c1t3d0s7

    Build the stripe:

    metainit d0

    create the file system:

    newfs /dev/md/rdsk/d0

    mount the file system to check it works:

    mount /dev/md/dsk/d0 /mnt

    write to it, df it, fsck it, etc.

    then edit /etc/vfstab

    /dev/md/dsk/d0 /dev/md/rdsk/d0 /mnt ufs 2 yes quota

    This means the file system is mounted on /mnt at reboot, and will not be mounted in single user mode, change the 2 for 1 if you want it mounted when the kernel comes up.

    Note: it's usefull to keep the output from newfs somewhere, because if your disk ever dies, you need to know where your next super block is, (for use with fsck) and the output from newfs is the only way you have of knowing this.

    Note also, that if you ever screw your metadevice you can still mount the individual disks manually:

    mount /dev/dsk /dev/dsk/c1t1d0s7 /mnt

    It is frequently quicker to do this, back up the data, then rebuild your metadevice from scratch, then restrore the data, than it is to try to recover the metadevice.

    To build a mirror, same rules for partitions

    Edit /etc/lvm/md.tab

    d0 -m /dev/md/dsk/d1 /dev/md/dsk/d2
    d1 1 1 /dev/dsk/c1t1d0s7
    d2 1 1 /dev/dsk/c1t2d0s7

    The rest is the same.

    If ever a mirror disk goes bad, you can do a soft replace with the following command:

    metareplace -e d0 c1t2d0s7

    It will then try to resync the disk.

    If a mirrored disk dies and has to be replaced use the following:

    metadb -d /dev/dsk/c1t1d0s3 (to delete the state databases)
    replace physical disk (c1t1)
    prtvtoc /dev/rdsk/c1t2d0s2 | fmthard –s - /dev/rdsk/c1t1d0s2 (to mirror the partition table, working drive -> new drive)
    metadb -a -c 3 /dev/dsk/c1t1d0s3 (to rebuild the state databases)
    metareplace -e d0 c1t1d0s7 (to replace the failed mirror)

    Note:
    You can replace the disk on the fly, repartition and metareplace. *THEN* metadb -d & metadb -a -c 3 with the system up...

Add New Comment

Returning? Login