Sunday, May 25, 2008

solaris broken

Solaris is broken again. Maybe it is because I can't wait till the system successfully shut down. So some system files are lost and I was asked to /lib/svc/bin/restore_repository.

But I can have the root console. The FS is read-only. I need to use the command below to change it to be read/write:
/lib/svc/method/fs-root
/lib/svc/method/fs-usr

For more details, you can check the page:
http://www.sun.com/msg/SMF-8000-MY

Now the situation is that I can execute some commands and I have some import files in my home directory, and I don't have network at all. How can I get those files out? The day without network is horribly dark~!

The system recommended to use fsck. I tried, but it doesn't help. It did can find some inconsistency but the Solaris seems to lose some system file.

I try to attach a USB drive to the box and hope it can recognize it. I use the command iostat as below to figure out if the disk can be recognized.
#iostat -En
It shows that the disk is there but it cannot recognize it as it appears as sda1 but not as c1d0...

Fortunately, that box has an The next that is worth trying is to burn those files into a CD. Then I checked the page
http://sysunconfig.net/unixtips/cdr.html
and
http://blogs.sun.com/reed/entry/how_to_burn_cd_dvd
sounds good.

I first package those files in the directory Desktop into ISO file, using the command as below:
# mkisofs -l -L -r -o /desk.iso  /export/home/newbie/Desktop

Then I will burn it into the CD by the following configuration and the command:
1) first check the CD-RW device number
#  cdrecord -scanbus
1,0,0 is the device number

2)configure the CD-RW
create a file as /etc/default/cdrecord, inside are
   CDR_FIFOSIZE=8m
CDR_SPEED=8
CDR_DEVICE=USCSI:1,0,0

3)burn the iso image into CD
# cdrecord -v /desk.iso
But it has burn error. Failed again.

Last strike is Live CD. First, I tried Ubuntu Live CD but it cannot recognize the FS. It requires UFS package. Then I have to try Solaris Live CD. Solaris Live CD has 2008.05 Live and installation CD, Benelix, and Schillix. I used 2008.05 release. It doesn't show the disk directly.
Still use the command iostat, you can see the disk is c5d0. Then use the mount command to mount it
# mount -F ufs /desk.iso /mnt
Then go to the directory /mnt, you can file there are three solaris directory there. Go to each one, there is one that is newbie's home directory. So move the ISO file into the home directory, and then copy the ISO from the home directory onto the LiveCD desktop. Then burn it into CD. It works finally.

---------------------------------------------------------ADDON---------------------------------------------------------------------------------------
Then reinstall the Solaris, it turned out that the network is broken. It kept get a wrong address as DNS server. The same to Ubuntu.
In Solaris, it has two styles to configure the network.
One is NWAM facility(automata network Management), the other is GNOME network configuration. You can use svc to alternate those two services.
For more details, man nwam or http://opensolaris.org/os/project/nwam/.

To see the services that are running, use
#svcs

To enable the default GNOME network configuration
     % svcadm enable svc:/network/physical:default
To disable the Solaris Network auto-magic
     % svcadm enable svc:/network/physical:nwam
To start the Solaris DNS server serivce
     % /lib/svc/method/dns-server start|stop

No comments: