• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3266
  • Last Modified:

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?
0
nsome
Asked:
nsome
  • 3
  • 2
  • 2
1 Solution
 
nsomeAuthor Commented:
When creating a mirror for system filesystems, are you supposed to create individual concatenations for each (/, /var, /usr, /opt) or one containing all into a single concatenation that you want to mirror?
0
 
tfewsterCommented:
> Is it possible to mirror this disk and its soft partitions
Sure, the hard partitions just become simple Disksuite metadevices and the mirroring is done of one hard partition to an (equal sized) partition on one or more "spare" disks.

> are you supposed to create individual concatenations...
You _could_ have var, opt & usr as simple directories in a big /  filesystem on a big slice and then just mirror that slice - But I'd have them as seperate slices.

The links yuzh gave you in http:Q_21853096.html#16696329 are good reading, but for a simple recipe, check out http://www.brandonhutchinson.com/Mirroring_disks_with_DiskSuite.html  Actually, I find his naming convention confusing, so I create metadevices like so:
metainit -f dN1 1 1 c0t0d0sN
metainit -f dN2 1 1 c0t1d0sN
metainit dN0 -m dN1

i.e. dN0 is the mirrored metadevice with 2 sub-mirrors, dN1 and dN2;  The N roughly corresponds to the slice number, though there are restrictions on the names you can use for metadevices (I don't think Disksuite allows d01 or numbers > d150 for example).  But so long as you work out a convention & stick with it, it's easy to "read" later


0
 
yuzhCommented:
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/Solaris_8/EA/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/metatool &

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,blk
   * 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.

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
nsomeAuthor Commented:
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
0
 
yuzhCommented:
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!
0
 
tfewsterCommented:
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?
0
 
nsomeAuthor Commented:
It was an issue with nosuid on it!!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now