Presumably there is a volume on slice 2 then?
It's not a good situation but nor is it game over yet, you've got two options, neither one is going to recover 100% of your data though sorry
Read the whole thing before you decide what to do - you have a few tough calls to make
Option 1: Forget the OS etc and try to save what was written to the volume on slice 2
Option 2: Forget what was written to the volume and slice 2 and try and save everything else.
If you need the data on slice 2, that makes option 1 preferable, if you need the data on one or more of the other slices, option 2 looks better.
If you have been using the volume on slice 2 heavily, you have a better chance of success with option 1
If you haven't filled the volume on slice 2 with much and havn't done lots of I/O on it, option 2 is likely to save more data.
It would probably be a good idea to get a second opinion on my suggested fix as it's going to do more damage to some of your data in an attempt to save other data. In other words, once you do this, there's no going back.
If you elect to go with option 2, try this:
- Start by booting off a cd or the network to get something we can work with
- Once you have a command prompt, try and mount /dev/dsk/c0t0d0s0 (or whever your root filesystem is) onto /a (this is available when booted off a cd for this purpose)
- If this fails reporting errors on the disk, run fsck over it - you'll lose a bit of data but hopefully not too much. Then try mounting again
- Go into /a/etc and edit the vfstab, comment out any volumes that are on slice 2 (look for 's2' in the device name)
- umount /a
- Run 'format' and select the disk that is damaged
- Display the partition table (I think it's 'p' 'p' from memory)
- Check that slice 2 starts at cylinder 0 and ends at the largest cylinder number possible - this step isn't vital but we might as well get things as normal as possible)
- If you have to make a change to do this, save the changes
- Exit out of format and back to the command prompt
- fsck /opt, /usr and /var - whichever of these are on seperate slices
- Attempt to boot from the disk
Any data written to the filesystem you created on slice 2 will be destroyed by doing this.
This won't be a silver bullet, most of the damage will not be reversable unfortunatly and the system may never boot again.
However, it
might get the system bootable which will make restoring from backup much easier.
Whatever happens you should be looking at a total rebuild as soon as possible after this.
If you need that data on slice 2, option 1 is for you, try this:
- As in option 2, boot from a cd
- Attempt to mount slice 2 on /a
- If it fails, run fsck over that device and try again
- Run format and select this disk
- Edit the partition table and set the starting cylinder and size of all partitions _except slice 2_ to 0 (effectively deleting them)
- Save your changes and exit format
- Whatever you do, DO NOT attempt to boot from any part of this disk
This will destroy any surviving data on all slices other than 2.
Once you've got slice 2 salvaged, you can put the disk in another machine or install an OS on another disk in this machine.
It ain't gonna be fun, but never say die! Let us know how you get on and if you hit any issues, I'm sure we'll all offer all the help we can. In the end, it'll make a good story you can tell junior admins about the pitfalls of Solaris
Good luck!
[Edit] Are you comfortable with fsck and the basics of what it does? - If not, find out a bit about it first as it will make your decision easier.