Skip to main content

Solaris mirroring

There is a lot of notes about the mirroring, but I always used this one:

4) Time to get our hands dirty!

     The following steps should be done while in single usermode idealy.
    

4.1) Making both drives the same.
    
     We start with slicing the second drive in the same way as our first
drive, the master.
    
     # prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
    
     No need to newfs the second drive slices here, that will automaticaly
done by the mirror syncing later.

    
4.2) Metadbs

     We can now setup our metadbs.
    
     # metadb -a -f -c3 c1t0d0s7 c1t1d0s7
    
     Since its the initial creation of the metadbs, we need to force it with
-f -a adds the metadbs, and -c tells it how many to create.
    
     You can see the results with metadb -i.
     metadb -i is a very handy tool to determine the state of your metadb
states.

    
4.3) Initializing the devices

     Now we go to setup the initial metadevices.
    
     # metainit -f d11 1 1 /dev/rdsk/c1t0d0s0;metainit -f d21 1 1 /dev/rdsk/c1t0d0s1;metainit -f d31 1 1 /dev/rdsk/c1t0d0s3;metainit -f d41 1 1 /dev/rdsk/c1t0d0s4;metainit -f d51 1 1 /dev/rdsk/c1t0d0s5;metainit -f d61 1 1 /dev/rdsk/c1t0d0s6

     # metainit -f d12 1 1 /dev/rdsk/c1t1d0s0;metainit -f d22 1 1 /dev/rdsk/c1t1d0s1;metainit -f d32 1 1 /dev/rdsk/c1t1d0s3;metainit -f d42 1 1 /dev/rdsk/c1t1d0s4;metainit -f d52 1 1 /dev/rdsk/c1t1d0s5;metainit -f d62 1 1 /dev/rdsk/c1t1d0s6
    
     Like metadb metainit must be forced with -f, but this time not because
its the initial creation, but because we work on mounted filesystems.
     So, here we create a 1 way concatenation of our actual slices and form
the needed submirrors.
     
4.3) Mirroring fun part 1!

metainit d10 -m d11
metainit d20 -m d21
metainit d30 -m d31
metainit d40 -m d41
metainit d50 -m d51
metainit d60 -m d61

     Here are the actualy mirroing intialized, the -m tells SDS that we want
to build a mirror with the name in the first colum and consiting of the
submirror in the third colum. We now have a one way mirror of our system
drive, but its not active yet.

4.4) Setting the root device

cp /etc/vfstab /etc/vfstab_pre_sds
cp /etc/system /etc/system_pre_sds
metaroot d10
   
   
4.5) Setting up /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 -
     #
     # sds drives
     #
     /dev/md/dsk/d0 - - swap - no -
     /dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no logging
     /dev/md/dsk/d30 /dev/md/rdsk/d30 /var ufs 1 no logging,noatime
     /dev/md/dsk/d40 /dev/md/rdsk/d40 /opt ufs 2 yes logging
     /dev/md/dsk/d50 /dev/md/rdsk/d50 /export/home ufs 2 yes
    logging #
     # non sds drives
     #
     #/dev/dsk/c1t0d0s0 - - swap - no -
     #/dev/dsk/c1t0d0s1 /dev/rdsk/c1t0d0s1 / ufs 1 no logging
     #/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s2 /var ufs 1 no
logging,noatime #/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /opt ufs 2 yes
   logging #/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /export/home ufs 2 yes
   logging #
     # swap slices
     #
     swap - /tmp tmpfs - yes -

4.6) Making sure we can boot in case of disk failure.

     To make sure we can boot in case a disk fails, we need to tell the
kernel to ignore the quota on metadbs, otherwise we can't boot in a two
disk setup, because we can't never fullfill the requirments.
    
     For that we add the following to /etc/system set
md:mirrored_root_flag=1

     # echo "set md:mirrored_root_flag=1" >> /etc/system
   

4.7) Our first reboot!

     Bring down the system to the OBP, don't reboot yet fully.
     We need to setup the boot devices now.
    
     OK setenv boot device disk0:b disk1:b
    
     Make sure the devaliases of disk0 and disk1 are actualy pointing to the
correct hardware decives.
     Now we boot our system up for the first time on the mirror.
    
     If all went well we are up and running in a few seconds.
       
    
4.8) Mirroring fun part 2!

     Now its time to hook up the second drive so we have actualy mirrored
slices.
metattach d10 d12
metattach d20 d22
metattach d30 d32
metattach d40 d42
metattach d60 d62
metattach d50 d52
         
     This will take considereble amount of time.
     Use metastat to check on the progress of the syncing
    
     Example metastat d30

    
5) All done, enjoy

6) Troubleshooting

Comments

Popular posts from this blog

Solaris. remove unusable scsi lun

Solaris remove unusable or failing scsi lun 1. The removed devices show up as drive not available in the output of the format command: # format Searching for disks...done ................      255. c1t50000974082CCD5Cd249 <drive not available>           /pci@3,700000/SUNW,qlc@0/fp@0,0/ssd@w50000974082ccd5c,f9 ................      529. c3t50000974082CCD58d249 <drive not available>           /pci@7,700000/SUNW,qlc@0/fp@0,0/ssd@w50000974082ccd58,f9 2. After the LUNs are unmapped Solaris displays the devices as either unusable or failing. # cfgadm -al -o show_SCSI_LUN | grep -i unusable # # cfgadm -al -o show_SCSI_LUN | grep -i failing c1::50000974082ccd5c,249       disk         connected    configured   failing c3::50000974082ccd58,249 ...

memory error detect XSCF uboot

If you see something like this when you poweron you server: memory error detect 80000008, address 000002d0 data 55555555 -> fbefaaaa capture_data hi fbefaaaa lo deadbeef ecc 1b1b capture_attributes 01113001 address 000002d0 memory error detect 80000008, address 000002d4 data aaaaaaaa -> deadbeef capture_data hi fbefaaaa lo deadbeef ecc 1b1b capture_attributes 01113001 address 000002d4 memXSCF uboot  01070000  (Feb  8 2008 - 11:12:19) XSCF uboot  01070000  (Feb  8 2008 - 11:12:19) SCF board boot factor = 7180     DDR Real size: 256 MB     DDR: 224 MB Than your XSCF card is broked. Replace it with new one. After that it will ask you for enter chassis number - located at front of the server XSCF promt to enter your chasses number ( is a S/N of your server ): Please input the chassis serial number : XXXXXXX 1:PANEL Please select the number : 1 Restoring data from PANEL to XSCF#0. Please wait for se...

SPARC OBP cheatsheet

Boot PROM Basics Boot PROM(programmable read only memory): It is a firmware (also known as the monitor program) provides: 1. basic hardware testing & initialization before booting. 2. contains a user interface that provide access to many important functions. 3. enables the system to boot from wide range of devices. It controls the system operation before the kernel becomes available. It provides a user interface and firmware utility commands known as FORTH command set. These commands include the boot commands, the diagnostic commands & the commands for modifying the default configuration. Command to determine the version of the Open Boot PROM on the system: # /usr/platform/'uname -m'/sbin/prtdiag -v (output omitted) System PROM revisions: ---------------------- OBP 4.16.4 2004/12/18 05:21 Sun Blade 1500 (Silver) OBDIAG 4.16.4.2004/12/18 05:21 # prtconf -v OBP 4.16.4 2004/12/18 05:21 Open Boot Architectures Standards: It is based on IEEE standard #1275, accord...