CrazyDon
asked on
solaris 8 software mirroring and flash image restore
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
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
Have you tried detaching the mirrors, then create the flar, then after the restore reattach the mirrors.
ASKER
no, like I said I'm very new to solaris. Have any links or advice to do this?
What volume software are you using? Solaris disksuite?
ASKER
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.
Run the metastat command and post its output
ASKER
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
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
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!
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!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
ASKER
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!
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!
ASKER
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!
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!
Rename your /etc/lvm dir ( it holds some MD info and config info).
mv /etc/lvm /etc/lvm.bak
mv /etc/lvm /etc/lvm.bak
ASKER
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.
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.
ASKER
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.
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.
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.
 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.
ASKER
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,b lk
* 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:1 050"
* 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.
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,b
* End MDD root info (do not edit)
* Begin MDD database info (do not edit)
* set md:mddb_bootlist1="sd:3:16
* set md:mddb_bootlist2="sd:15:1
* 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.
ASKER
I also, forgot to say that I renamed /etc/lvm to /etc/lvm.old
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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/da d@0,0
1. c2t1d0 <MAXTOR 6L020J1 cyl 39811 alt 2 hd 16 sec 63>
/pci@1f,0/pci@1,1/ide@3/da d@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
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/da
1. c2t1d0 <MAXTOR 6L020J1 cyl 39811 alt 2 hd 16 sec 63>
/pci@1f,0/pci@1,1/ide@3/da
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