Solved

solaris 8 software mirroring and flash image restore

Posted on 2006-07-04
19
1,391 Views
Last Modified: 2013-12-21
Hello,

  I pretty new to solaris and have an issue with a flash image I created of a system that is using software mirroring. I have been making flash images of my servers and have successfully restored them without any problems until this one server that is using software mirroring. When I attempt to restore the flash image, I get a kernel panic that states that root could not be mounted. Here is the procedure I have been using on my other servers that works perfectly.

On a server I want to create an image of I do the following. I actually found this solution on this board and I take no credit for this.

flarcreate -c -n imagename -x excludedir /dir/filename.flar

To restore the server, I do the following:

Boot from the solaris 8 install cd and do the webstart install, but specify that I have an image on the server when it asks from where to get the solaris install images.

This has worked great on all of my servers as I could create an image and do a restore. Now, I have one server that is using software mirroring and the above procedure does not work. When I complete the restore and do a reboot, the systems dies with a kernel panic stating that the root filesystem could not be mounted. I assume that there is some other prep work that needs to be done with the disk partitioning since it's a mirrored disk.

How can I restore a systems that is using software mirroring from a flash image. What step am I missing since its software raid 1.

Thanks!

-Don
0
Comment
Question by:CrazyDon
  • 11
  • 7
19 Comments
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
Have you tried detaching the mirrors, then create the flar, then after the restore reattach the mirrors.
0
 

Author Comment

by:CrazyDon
Comment Utility
no, like I said I'm very new to solaris. Have any links or advice to do this?
0
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
What volume software are you using? Solaris disksuite?
0
 

Author Comment

by:CrazyDon
Comment Utility
This is a server I inherited and there is no documentation on how it was setup. I would assume that disksuite was used to setup the mirroring, but I'm not sure. What would be a quick way to find out.
0
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
Run the metastat command and post its output
0
 

Author Comment

by:CrazyDon
Comment Utility
Sure, here it is:

bash-2.03# metastat
d0: Mirror
    Submirror 0: d100
      State: Okay
    Submirror 1: d110
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 3397352 blocks

d100: Submirror of d0
    State: Okay
    Size: 3397352 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c0t0d0s0                   0     No    Okay


d110: Submirror of d0
    State: Okay
    Size: 3397352 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c0t1d0s0                   0     No    Okay


d6: Mirror
    Submirror 0: d106
      State: Okay
    Submirror 1: d116
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 29859944 blocks

d106: Submirror of d6
    State: Okay
    Size: 29859944 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c0t0d0s6                   0     No    Okay


d116: Submirror of d6
    State: Okay
    Size: 29859944 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c0t1d0s6                   0     No    Okay
0
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
To detach the mirror use

metadetach d0 d110
metadetach d6 d116

Create the flar....
Try the restore..

Re-attach the mirror

metattach d0 d110
metattach d6 d116

The mirrors will now show resyncing in the metastat command.

I dont think this process is necessary in Sol9 but Sol8 had some problems as I recall.

Hope it works!

0
 
LVL 2

Assisted Solution

by:advega
advega earned 100 total points
Comment Utility
I think that maybe the /etc/system doesn't get correctly the setting of booting from a mirrored FS, why don't you :
1. do your flash restore.
2. reboot again with the CD but! :    ok> boot cdrom -s
3. mount your / (root) partition (cXtXdXs0) onto /a :    # mount -F ufs -o rw /dev/dsk/c1t0d0s0 /a
4. check your /a/etc/system and comment all the metaroot stuff (compare this /etc/system with one of a non mirrored system)
5. check your /a/etc/vfstab and change the device paths to use the simple partition formatting ( /dev/dsk and /dev/rdsk) instead of metadevice paths ( /dev/md )
6. install bootblok ( # /usr/platform/`uname -i`/sbin/installboot     /usr/platform/`uname -i`/lib/ufs/bootblock
7. boot from hard disk.

hope this helps..
aaron.
0
 

Author Comment

by:CrazyDon
Comment Utility
advega,

I'm having a problem with step 6 as the system is returning a "Permission denied" error when I do the following:

/usr/platform/`uname -i`

that is using csh

If I use the sh shell and do a /usr/platform/'uname -i` ,the error "cannot execute" is returned

How can I get past that error.

too bad the bash shell is not included also as that is a lot easier to work in for me.

-Don
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:CrazyDon
Comment Utility
OK,

I changed step 6 from above to this which allows the boot block to be installed:

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

now it complains about not being able to find /dev/dsk/c0t0d0s0 after a reboot.

I'm finding out that most of the sun machines here are setup in a software raid 1 configuration. How can you determine if the boot block is installed on the mirrored drive...

At least I'm getting closer!
0
 

Author Comment

by:CrazyDon
Comment Utility
ok, last comment and I'll stop spamming for a while. When I reboot the system I get the following error:

mount: /dev/dsk/c0t0d0s0 no such device

of course, I need to go into single user mode, which I do. The filesystem is mounted read only and I do see all of my files there, so why would the system complain about  /dev/dsk/c0t0d0s0 not being found. Also, after I removed the metadevices from /etc/system, this warning is also displayed:

metainit: ns1: there are no existing databases

Could this be realted to /dev/dsk/c0t0d0s0 not being found

Thanks!
0
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
Rename your /etc/lvm dir ( it holds some MD info and config info).
mv /etc/lvm  /etc/lvm.bak










0
 

Author Comment

by:CrazyDon
Comment Utility
Thanks,

I renamed /etc to /etc/lvm.bak and rebooted. metainit is still complaining:


SunOS Release 5.8 Version Generic_108528-23 64-bit
Copyright 1983-2003 Sun Microsystems, Inc.  All rights reserved.
configuring IPv4 interfaces: hme0.
Hostname: ns1
metainit: ns1: there are no existing databases

/dev/dsk/c0t0d0s1: No such device or address
/dev/dsk/c0t1d0s1: No such device or address
The / file system (/dev/rdsk/c0t0d0s0) is being checked.
Can't open /dev/rdsk/c0t0d0s0
/dev/rdsk/c0t0d0s0: CAN'T CHECK FILE SYSTEM.
/dev/rdsk/c0t0d0s0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

WARNING - Unable to repair the / filesystem. Run fsck
manually (fsck -F ufs /dev/rdsk/c0t0d0s0). Exit the shell when
done to continue the boot process.


now, silly question time. When a flash image is restored, do I need to setup the partitions like the origional machine or does restoring the flash image do that also.
0
 

Author Comment

by:CrazyDon
Comment Utility
man. I am so close I can taste it.

to expand on my input above, I can boot into my restored image. However, the system doesn't come up clean so I am forced to boot into single user mode.
It seems that the system thinks that no hard drives are configured on the system as "format" returns the following:

ns1>format
Searching for disks...done
No disks found!

If I boot from install cd 1 and mount the disk, I do see all of my files. Where are the devices defined and how can I go about telling the system that a drive is really present
and it should be used.
0
 
LVL 11

Expert Comment

by:jekl2000
Comment Utility
Hear is some Flar info:

 The following files are set back to default: /etc/resolv.conf, /etc/nsswitch.conf , /etc/hosts, /etc/vfstab and /etc/shadow.
 Solution:  Backup these files to a separate location on the disk before the Archive is created, i.e.,  cp /etc/vfstab /etc/vfstab.sav
   
 Flash Archive does not work well with encapsulated disks in Solaris 8.  Sun Bigadmin’s advice is to un-encapsulate the disk before the flar is created, but if this is impossible, it is possible to recover the system with an archive that was made from an encapsulated disk.    
 Restore the system with the flar image as usual
 The system will not boot properly but will boot up in maintenance mode
 Mount the root vol to /a, i.e: mount /dev/dsk/c0t0d0s0 /a
 Change root to /a: chroot /a /bin/ksh
 #mv /etc/lvm /etc/lvm.old
 vi /etc/system and comment out the md lines
 Reboot and the system will boot normally
 Re-encapsulate the root vol.


 Flash Archive is not able to automatically recreate your disk partitions unless the swap space starts in cylinder 0.   However, it does allow you to manually size and name partitions, so, it can also be used to resize partitions.  
0
 

Author Comment

by:CrazyDon
Comment Utility
Thanks. I must be one of the slow people as it still doesn't work.

Here is the steps I have taken up to this point and the final error I am receiving:

1) break the mirror on the server to image

metadetach d0 d110
metadetach d6 d116

create the flash image

2) restore the mirror

metattach d0 d110
metattach d6 d116

The disks resync - good!

Restore the system to a test machine with the flash I just created

Once the restore is complete, I boot with install cd1 and mount root vol and issue chroot command

mount /dev/dskc0t0d0s0 /a
chroot /a /bin/csh

Now, I edit vfstab to change my mount devices and edit /etc/system to remove all md references.

setenv TERM vt100
cd /etc
vi vfstab and change it to the following

#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr          ufs     1       yes     -
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
#
/dev/dsk/c0t0d0s1       -       -       swap    -       no      -
#
/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no
-
#/dev/md/dsk/d0 /dev/md/rdsk/d0 /       ufs     1       no      -
#
#/dev/dsk/c0t0d0s6      /dev/rdsk/c0t0d0s6      /export/home    ufs     2
yes     -
#/dev/md/dsk/d6 /dev/md/rdsk/d6 /export/home    ufs     2       yes     -
#
/dev/dsk/c0t1d0s1       -       -       swap    -       no      -
#
swap    -       /tmp    tmpfs   -       yes     -


edit system and remove all references to md. The following was commented out:

* Begin MDD root info (do not edit)
* forceload: misc/md_trans
* forceload: misc/md_raid
* forceload: misc/md_hotspares
* forceload: misc/md_stripe
* forceload: misc/md_mirror
* forceload: drv/pcipsy
* forceload: drv/simba
* forceload: drv/glm
* forceload: drv/sd
* rootdev:/pseudo/md@0:0,0,blk
* End MDD root info (do not edit)
* Begin MDD database info (do not edit)
* set md:mddb_bootlist1="sd:3:16 sd:11:16 sd:7:16 sd:7:1050 sd:15:16"
* set md:mddb_bootlist2="sd:15:1050"
* End MDD database info (do not edit)

Now, I do a reboot and and the following error appears and dropped into single user mode:


Rebooting with command: boot
Boot device: disk:a  File and args:
SunOS Release 5.8 Version Generic_108528-23 64-bit
Copyright 1983-2003 Sun Microsystems, Inc.  All rights reserved.
configuring IPv4 interfaces: hme0.
Hostname: ns1
metainit: ns1: there are no existing databases

/dev/dsk/c0t0d0s1: No such device or address
/dev/dsk/c0t1d0s1: No such device or address
The / file system (/dev/rdsk/c0t0d0s0) is being checked.
Can't open /dev/rdsk/c0t0d0s0
/dev/rdsk/c0t0d0s0: CAN'T CHECK FILE SYSTEM.
/dev/rdsk/c0t0d0s0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

WARNING - Unable to repair the / filesystem. Run fsck
manually (fsck -F ufs /dev/rdsk/c0t0d0s0). Exit the shell when
done to continue the boot process.


Type control-d to proceed with normal startup,
(or give root password for system maintenance):

I then try to fsck:

fsck -F ufs /dev/rdsk/c0t0d0s0

and the final error is: Can't open /dev/rdsk/c0t0d0s0

It seems to be very near to working.

0
 

Author Comment

by:CrazyDon
Comment Utility
I also, forgot to say that I renamed /etc/lvm to /etc/lvm.old
0
 
LVL 11

Accepted Solution

by:
jekl2000 earned 400 total points
Comment Utility
You mentioned earlier that format showed no disk.

I would try a reconfig reboot. From OK prompt
ok>boot -r or reboot -- -r from shell promt

Then check format and see it they are there.

Also, are you sure the vfstab is correct. How many disk does it have?

0
 

Author Comment

by:CrazyDon
Comment Utility
I tried that, but no go.

I did the following:

>mount /dev/dskc0t0d0s0 /a
>chroot /a /bin/csh
>devfsadm

now format returns

AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <ST320414A cyl 39533 alt 2 hd 16 sec 63>
          /pci@1f,0/pci@1,1/ide@3/dad@0,0
       1. c2t1d0 <MAXTOR 6L020J1 cyl 39811 alt 2 hd 16 sec 63>
          /pci@1f,0/pci@1,1/ide@3/dad@1,0
Specify disk (enter its number):


I would like to have it back at c0t0d0 instead of c2t0d0. Once I edit vfstab to reflect the disk changes I can boot into the os.

At bootup I am still receiving the following error:

metainit: ns1: there are no existing databases


Anyway to get rid of that error and get the disk scheme back to c0t0d0 instead of c2t0d0
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now