SUMMARY: Accessing metadevices when booting from CDROM?

From: Guy D. <dy7t_at_yahoo.com>
Date: Sun Jul 24 2005 - 16:28:12 EDT
Thanks to everyone who responded:

"Santhakumar, Siva" <Siva.Santhakumar@navitaire.com> 
"Sandwich Maker" <adh@an.bradford.ma.us>
"Thomas M. Payerle" <payerle@physics.umd.edu>  
"Petri Kallberg" <Petri.Kallberg@Sun.COM> 

The definitive answer came from Petri who (probably
because of where he works) pointed me to a Sun
document that gives step-by-step directions on
performing this procedure.

It is Document ID: 75210 (Solaris[TM] Volume Manager
Software and Solstice DiskSuite[TM] Software: Mounting
Metadevices)  I am not sure if you need to have a Sun
support contract to read it (try searching at
sunsolve.sun.com for the document ID.)  I will just
copy it here for anyone who is interested:

---------------------------------------------------
Problem Statement:	Top

How can you access data which is located on a
mirrored, RAID5, or a concatenated metadevice when the
system is booted from a CD-ROM into a single user
mode?
(For example, reset the root password on a mirrored
root partition.)

Resolution:	Top

1) Boot to single user mode using Solaris[TM] 9 OE 1/2
CDROM (or DVD).

   ok boot cdrom -s
   ...

2) Find the Solaris[TM] Volume Manager md driver and
unload it.

	# modinfo | grep md
	 38  11d1703    ff9   -   1  md5 (MD5 Message Digest
Algorithm)
	113  12f1b02   1ecf  70   1  ramdisk (ramdisk driver
v1.15)
	127 705c2000  2375a  85   1  md (Solaris Volume
Manager base mod)
	# modunload -i 127

For Solaris 9 Operating System (Solaris OS)
metadevices:

3) Mount one of the sub-mirrors of your root
metadevice as read-only to get a copy of metadb
configuration information. NOTE: You'll need to mount
a regular disk device for this step.

	# mount -r /dev/dsk/c0t0d0s0 /a
	# cp /a/kernel/drv/md.conf /kernel/drv/md.conf
	# umount /a

For pre-Solaris 9 OS metadevices:

3) Before Solaris 9 OS, information about metadb's was
stored in the /etc/system file instead of in
/kernel/drv/md.conf and the format used was slightly
different.

   Mount one of the sub-mirrors of your root
metadevice as read-only to get a copy of metadb
configuration information. NOTE: You'll need to mount
a regular disk device for this step.

	# mount -r /dev/dsk/c0t0d0s0 /a
	# cp /a/etc/system /tmp/system
	# umount /a

   Find metadb information from /tmp/system, for
example:
   
   * Begin MDD database info (do not edit)
     set md:mddb_bootlist1="sd:7:16 sd:7:1050
sd:7:2084 sd:15:16
     sd:15:1050"
     set md:mddb_bootlist2="sd:15:2084"
   * End MDD database info (do not edit)

   This information can be converted into a format
that Solaris 9 OS understands simply by adding ":id0"
after each metadb identifier.  These lines are then
added to the end of /kernel/drv/md.conf.

   The previous example would then look like the
following:

   mddb_bootlist1="sd:7:16:id0 sd:7:1050:id0
sd:7:2084:id0 sd:15:16:id0
   sd:15:1050:id0";
   mddb_bootlist2="sd:15:2084:id0";

   NOTE: Remember to add ";" at the end of each line
!!!

4) Load the Solaris Volume Manager md driver and
synchronize meta devices

	# modload /kernel/drv/md
	# metasync -r

5) READY !! Now you're able to use your existing
metadevices as usual.  To view your metadevice
configuration and status, use the metastat command.

	# metastat

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

OK, I did not actually try this, but it looks like it
should work.  It still seems like way too much work
to me that I need to add a bunch of lines in cryptic
format to /kernel/drv/md.conf just so it can figure
out where the metadevice database replicates are
located.

Let me add one last story to this drama.  Earlier, I
booted the system using a Solaris 9 install CD.  But,
I forgot to boot the system with "boot cdrom -s" and
just used "boot cdrom"  So, the system booted off the
CD and started running the processes for installing a
new OS (asking me what language I want to use, etc.) 
I was using a graphics terminal, so I just ignored
that and opened another xterm window.  I was
astonished to see (after a unknown amount of time)
that when I entered "metadb" and "metastat" that I was
able to see all of my existing metadevice databases
and metadevices!  But, after another period of time, I
was not!  I figured that the Solaris installer must be
smart enough to probe for old metadevices and would
probably offer me the option to retain them if I
continuted to install the OS. 

One person assumed that I had a RAID-1 root
filesystem, and suggested that I boot from CD, mount
/dev/dsk/cXdXtXsX (directly specifying a known, good
root partition slice), then change the /etc/vfstab
file on that slice to indicate the root filesystem
should be mounted from /dev/dsk/cXdXtXsX rather than
/dev/md/dsk/dXX, then reboot into that slice.)

Two people pointed out that the default metadb size
became larger starting in Solaris 9 and were worried
that might be causing the trouble.  But, this turned
out not to be a factor.

Thanks again for everyone's help

My original question is below:

--- "Guy D." <dy7t@yahoo.com> wrote:

> Hello,
> 
> I have a Solaris 8 system with several RAID 0 and
> RAID
> 1 filesystems created with Solstice Disk Suite (SDS)
> 
> Now, I believe that SDS was incorporated into
> Solaris
> 9 & 10 (and renamed to Solaris Volume Manager.)  I
> was
> wondering how I could access my RAID filesystems if
> I
> lost the root filesystem and had to boot from CD.
> 
> The Solaris 8 CD does not support SDS (it was an
> optional package.)  But, I thought if I used a
> Solaris
> 9 or Solaris 10 install CD, I would be able to
> configure them to be able to access the SDS
> metadevices.
> 
> But, when I finally tried it, I was not successful. 
> It seemed to me that I should have just needed to
> use
> "metadb -a <slices containing metadb replicates>"
> Any advice for what I need to do?  I know where all
> the metadb replicates are located. 
> 
> I would think this would be a fairly common task
> (recoving data from metadevices if the root
> filsystem
> failes) but I have not been able to find any
> answers.
> 
> Thanks,
> Doug


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Sun Jul 24 16:28:57 2005

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:50 EST