Mounting a Mirrored root disk when booted from CDROM.

I previously mentioned about modifying an underlying mirror. So if you have booted from CDROM (yes I know they are all DVDs now but at least I've stopped saying “tape”) or the network then here is how on Solaris 91 and above.


First get a copy of the /kernel/drv/md.conf file. Since mounting a file system in this case will result in rolling the log, even for a read-only mount, this actually breaks my rule. Which is why it is wise to keep a copy of the md.conf file somewhere safe or failing that on that USB pen drive that you have dropped behind the sofa. It will be in the back up of the root file system you have.

# ufsrestore xf cg13442@1.2.3.4:/backup/root.dump kernel/drv/md.conf
Warning: ./kernel: File exists
Warning: ./kernel/drv: File exists
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
set owner/mode for '.'? [yn] n   
Directories already exist, set modes anyway? [yn] n
# 

If you have, like I have at home, backed up your root file system into your ZFS pool you can have a quick demonstration as ZFS gets this right when you get the md.conf, you just import the pool. You have to use an alternative root as the root is read-only so it can't create /tank:

# zpool import -R /tmp tank
# ufsrestore xf /tmp/tank/backup/root kernel/drv/md.conf   
Warning: ./kernel: File exists
Warning: ./kernel/drv: File exists
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
set owner/mode for '.'? [yn] n
Directories already exist, set modes anyway? [yn] n
#

Now run update_drv(1M) to load the new md.conf and you are away.

# update_drv md
devfsadm: mkdir failed for /dev 0x1ed: Read-only file system

That is it. You can now access your meta devices:

# metastat
d10: Mirror
    Submirror 0: d11
      State: Needs maintenance 
    Submirror 1: d12
      State: Needs maintenance 
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 70078473 blocks (33 GB)

d11: Submirror of d10
    State: Needs maintenance 
    Invoke: metasync d10
    Size: 70078473 blocks (33 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s0          0     No            Okay   Yes 


d12: Submirror of d10
    State: Needs maintenance 
    Invoke: metasync d10
    Size: 70078473 blocks (33 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s0          0     No            Okay   Yes 


d20: Mirror
    Submirror 0: d21
      State: Needs maintenance 
    Submirror 1: d22
      State: Needs maintenance 
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 1022706 blocks (499 MB)

d21: Submirror of d20
    State: Needs maintenance 
    Invoke: metasync d20
    Size: 1022706 blocks (499 MB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s1      26001     Yes           Okay   Yes 


d22: Submirror of d20
    State: Needs maintenance 
    Invoke: metasync d20
    Size: 1022706 blocks (499 MB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s1      26001     Yes           Okay   Yes 


Device Relocation Information:
Device   Reloc  Device ID
c1t1d0   Yes    id1,sd@SFUJITSU_MAP3367N_SUN36G_00N024DA____
c1t0d0   Yes    id1,sd@SFUJITSU_MAP3367N_SUN36G_00N022FA____
#

There is a document in the service database formally know as SunSolve #202794 (Previously Published As 75210) which claims you need to unload the md driver for Solaris 10 you don't. I am updating that document.

1At the time of publishing I have not verified this on Solaris 9 but I think it should work. I have clearly verified it on 10! When I have verified it I will update this post. Update: I can verify this works on Solaris 9

Comments:

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« May 2015
MonTueWedThuFriSatSun
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today