Friday, June 30, 2006

Monday, June 26, 2006

Another quick Solaris DiskSuite (SVM) How-to I wrote.

Disksuite/SVM Howto

Wrex Allen - 06.21.06
This one deals specifically with mirroring the boot disk, to another drive, when you only have two disks available.

---------------------------

(Foreword)
You can create identical partitioning on the second disk, prior to setup, by the following method:
Copying identical disk:
Create identical partitioning on the second disk
dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t1d0s2 count=16

-------------------

From CD Solaris 8 - “Solaris 8 Software 2 of 2”

Solaris 8 DiskSuite version is 4.2.1 .Following are the minimum required packages ..

SUNWmdr Solstice DiskSuite Drivers (root)
SUNWmdu Solstice DiskSuite Commands
SUNWmdx Solstice DiskSuite Drivers (64-bit)


Installing DiskSuite 4.2.1 in Solaris 8

# cd /cdrom/sol_8_401_sparc_2/Solaris_8/EA/products/DiskSuite_4.2.1/sparc/Packages

# pkgadd -d .

The following packages are available:
1 SUNWmdg Solstice DiskSuite Tool
(sparc) 4.2.1,REV=1999.11.04.18.29
2 SUNWmdja Solstice DiskSuite Japanese localization
(sparc) 4.2.1,REV=1999.12.09.15.37
3 SUNWmdnr Solstice DiskSuite Log Daemon Configuration Files
(sparc) 4.2.1,REV=1999.11.04.18.29
4 SUNWmdnu Solstice DiskSuite Log Daemon
(sparc) 4.2.1,REV=1999.11.04.18.29
5 SUNWmdr Solstice DiskSuite Drivers
(sparc) 4.2.1,REV=1999.12.03.10.00
6 SUNWmdu Solstice DiskSuite Commands
(sparc) 4.2.1,REV=1999.11.04.18.29
7 SUNWmdx Solstice DiskSuite Drivers(64-bit)
(sparc) 4.2.1,REV=1999.11.04.18.29
Select 1,3,4,5,6,7 packages .

Enter ‘yes’ for the questions asked during installation and reboot the system after installation .

Put /opt/SUNWmd/bin in root PATH as the DISKSUITE commands are located in this directory

Reboot the box.

The partition table of the mirrored drive should be identical to the boot drive. Copy the partition table of the boot drive to its mirror.

# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2



Creating State Database :

Metadb needs a dedicated disk slice so create partitions of about 5 Meg. on the disks for metadb. If there is no space available for metadb then it can be taken from swap . Having metadb on two disks can create problems as DISKSUITE looks for database replica number > 50% of total replicas and if one of the two disks crashes the replica falls at 50% . On next reboot system will go to single user mode and one has to recreate additional replicas to correct the metadb errors.

The following command creates three replicas of metadb on two disk slices.

#metadb -a -f -c 3 /dev/dsk/c1t0d0s6 /dev/dsk/c1t1d0s6

Create a simple Mirror:
Setup up RAID1 Mirrors:
ROOT:
# metainit -f d1 1 1 c1t0d0s0
# metainit d0 -m d1
# metainit d2 1 1 c1t1d0s0
# metattach d0 d2 (NOTE: There will be lots of disk I/O)

swap:
# metainit -f d6 1 1 c1t0d0s1
# metainit d5 -m d6
# metainit d7 1 1 c1t1d0s1
# metattach d5 d7 (NOTE: There will be lots of disk I/O)

/export/home:
# metainit -f d11 1 1 c1t0d0s7
# metainit d10 -m d11
# metainit d12 1 1 c1t1d0s7
# metattach d10 d12 (NOTE: There will be lots of disk I/O)

********* WAIT UNTIL ALL DISK I/O HAS STOPPED BEFORE CONTINUING!!!!! *********
do
# metastat|grep Resync
-or-
# metastat|grep %


** If we only have two mirrored root disks (DiskSuite 4.2.1, Solaris 8), put this setting in our /etc/system:
set md:mirrored_root_flag=1

Then do:
# metaroot d0

Then:
# lockfs -fa
# init 6


Then (if needed, actually d0 should already be done for you, due to metaroot command):
Make the following change in the /etc/vfstab file:
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no logging
/dev/md/dsk/d10 /dev/md/rdsk/d10 /export/home ufs 2 yes logging
/dev/md/dsk/d5 - - swap - no -

Then Do (This installs the boot loader on the mirrored disk):
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0


Creating alternate name for Mirrored boot disk

a.) Find physical path name for the second boot disk

# ls -l /dev/rdsk/c1t1d0s0

lrwxrwxrwx 1 root root 55 Sep 12 11:19 /dev/rdsk/c1t1d0s0 -> ../../devices/ssm@0,0/pci@18,600000/scsi@2/sd@1,0:a,raw

b.) Create an alias for booting from disk2

(At the boot PROM)

ok> nvalias bootdisk2 /ssm@0,0/pci@18,600000/scsi@2/sd@1,0:a,raw
( Issue a "show-disks" at the ok prompt to verify the correct path to the disk. Use "devalias" at the ok prompt to also give clues as to which device path to use. )

ok> setenv boot-device disk bootdisk2

ok> nvstore

ok> reset-all
--- OR ---
From the boot prompt, run
ok> show-disks
Pick your mirrored disk from the list and then setup an alias like so
ok> nvalias bootdisk2 ^y (that is a -y to paste the device path)
Change your boot-device to first try the normal disk alias, then use
your mirror disk
ok> setenv boot-device disk bootdisk2
Reset/reboot the server
ok> reset-all


--------------------------------
Misc. Notes:

metaclear -a (will remove setup).
metadetach to detach an MD:
# metadetach d10

Friday, June 16, 2006

Online bit converter

Very Handy:
http://www.t1shopper.com/tools/calculate/

Sunday, June 04, 2006

Today, I am coining a new phrase...

A new word, actually...

Episphincter: One who has risen to the highest level of buttholism.

I am nominating our backwoods, bible-thumpin, my-daddy-went-to-war-and-so-can-I butthole of a president.

For obvious reasons.

Carry on.