The Solaris group is a forum where peers share technical expertise, solve problems, and discuss issues related to the Solaris operating system, including OS-related malfunctions, security issues, and network performance.

file system is read-only - missing vfstab file

I'm new to Solaris (and unix in general) and have run into a snag. My system boots into Read-only maintenance mode and won't let me mount anything. It indicates that it can't find vfstab. I have seen copies of it (.orig and .old) but I can't rename it because the fs is read-only. I don't have the original OS disks and the tape backup won't install either (read-only). Is there a way to recreate the file? Perhaps through Open-boot?

Ciao!
Regards
Mike Cunningham
---------------------
The Concorde was great. It travels at twice the speed of sound. Which is
fun except you can't hear the movie until two hours after you land.
Living on Earth is expensive, but it does include a free trip around the
sun every year.
Wicked! I'm off t'chill wi't me Joolie

The Os has got corrupted. We can recover it.
Step 1
Run the fsck for two or more times. shutdown and reboot the server. I will resolve your
problem.
if the # fsck is not running and give some error, run the following
# fsck -F ufs /dev/dsk/c#t#d#s# only for root slice for two times.

Step 2
If you have Boot CD solaris whether it is orginal/copied and any version (6/7/8). Boot the
server with the cd no 1.
It will boot the server and stop at # prompt.
Create a dir in the current folder ( It will allow)
Then mount the harddisk root partition to that directory.
Edit /Rename the Vfstab file.

Step 3

If you have any other server unix
do ftp to the server copy the vfstab rename and put it back.

Archive Page - http://unix.ittoolbox.com/groups/groups.asp?v=sola ris-lI'm new to Solaris (and unix in general) and have run into a snag. My system boots into
Read-only maintenance mode and won't let me mount anything. It indicates that it can't
find vfstab. I have seen copies of it (.orig and .old) but I can't rename it because the
fs is read-only. I don't have the original OS disks and the tape backup won't install
either (read-only). Is there a way to recreate the file? Perhaps through Open-boot?

***The information contained in this message is legally privileged and confidential
information intended only for the use of the addressed individual or entity indicated in
this message (or responsible for delivery of the message to such person). It must not be
read, copied, disclosed, distributed or used by any person other than the addressee.
Unauthorised use, disclosure or copying is strictly prohibited and may be unlawful.
Opinions, conclusions and other information on this message that do not relate to the
official business of any of the constituent companies of the TATA CONSULTANCY SERVICES
shall be understood as neither given nor endorsed by the Group. If you have received this
message in error, you should destroy this message and kindly notify the sender by e-mail.
Thank you.***

When Solaris boots to read-only single user mode and you want to edit the
root file system there are two options

1. press ctrl + d This will force Solaris to continue to load and it should
only boot to standard single user mode with read/write permission to the
root file system.
I once had an error with the /usr file system and the root was mounted as
read only. The error was with the /etc/vfstab in the options section. After
pressing ctrl + d the box booted to standard single user mode and I could
edit files on the root file system. If you are in single user mode
(read/write) pressing ctrl + d again will take you to multiuser mode.

2. This is the most likely to work and maybe safest method.
Boot of the CDROM as previously mentioned. When at the prompt
# mount /dev/dsk/c0t0d0s0 /a
# cd /a/etc
If using a monitor
# TERM=sun;export TERM
If using a terminal
# TERM=vt100;export TERM
# ls -l vfstab* - Check the dates and use the
more recent ?
# cp -p vfstab.old vfstab
# vi vfstab
Modify the vfstab to make sense.

3. I have never tried the remount option but I would assume that is what the
OS uses to remount the partitions as read/write during the boot. ie during
boot partitions (/ , /usr, /var) are mounted read only then remounted as
read write) maybe checking the /etc/rc? scripts may sheed some light on
this.
BTW I believe that the mount command resides on the /var partition (?) and
if the OS is not aware of the var partition then the remount option may not
work ?

> I'm new to Solaris (and unix in general) and have run into a snag. My
> system boots into Read-only maintenance mode and won't let me mount
> anything. It indicates that it can't find vfstab. I have seen copies of
> it (.orig and .old) but I can't rename it because the fs is read-only.
> I don't have the original OS disks and the
> tape backup won't install either (read-only). Is there a way to recreate
> the file? Perhaps through Open-boot?

the solution to this is quite simple.

# mount -o remount,rw /dev/dsk/c0t0d0s0 /

then, fix /etc/vfstab, sync, and reboot.

email@removed

p.s. if you look in /etc/rcS.d/S40standardmounts.sh you will
see that Solaris simply remounts the root filesystem
read-write during the normal boot process (assuming a
sane boot environment, with /etc/vfstab present).

First, Thank you all for your attempts...
1.. I don't have any boot media - No OS - CD or otherwise.
2.. If I type vi the reponse is: "var/tmp/Ex0000000120" Read-only file system
3.. If I attempt mount <anything> the response is: mount: cannot open /etc/vfstab
4.. If I type fsck the response is: fsck: cannot open /etc/vfstab
5.. If I try fsck -F ufs /dev/dsk/c0t0d0s0 the response is: Can't stat /dev/dsk/c0t0d0s0

6.. I was attempting to define an IP address but it won't accept it for some reason. Ibelieve there are other scipts that run and change it to something else. In any case, I don't have a bootp or ftp server available.
7.. I tried the Ctrl-d and input S for single user mode and once again a script changes the system to run level 3.
The end result is that I must be SOL. I've attempted to download a trial version of Solaris 9, but Windows won't let me write it to a CD to create a boot disk. I get multiple errors.

If vi will not start because it cant write to a temporary location try
changing the environment varilable that sets this path to another location
where you can write (if any).
You may be able to invoke vi without a tmp file?
Try this (is there a better way to do this? ie DIR=/;export DIR at the
command line)
As root
# view
When in view
: set directory=/ (or another location)

If invoked with a partial argument list (with
only one of special or mount_point, or with both special or
mount_point specified but not FSType), mount will search
/etc/vfstab for an entry that will supply the missing argu-
ments.

since you don't have an /etc/vfstab to begin with,
you'll need to specify the FSType:

>
> The response is;
> mount: /dev/dsk/c0t0d0s0 or /, no such file or directory
>
> any other ideas?

yes. i assumed that your root filesystem is on c0t0d0s0,
but that would appear to be incorrect (and somewhat
unusual). i don't recall what type of hardware you're
working on, but some of the older SPARCs used SCSI target 3
for the boot device and c0t3d0s0 for the root partition.
the first thing to do is to look in your old /etc/vfstab
and attempt to determine which disk partition contains your
root filesystem.

# cat /etc/vfstab

you'll have an entry that looks something like this:

/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1
no -

this is the line which pertains to the root filesystem
(note the / in the 3rd column). in your mount command,
use the device file name which is in the 1st column.
in the above example it would be:

# mount -F ufs -o rw,remount /dev/dsk/c0t1d0s0 /

if you do not have a valid old vfstab on the system,
try taking a look at the installed disks:

If you have a boot CD the best option is to boot off it and modify the file
system
When you tried the printf etc did you press ctrl + d to see if it would
mount the root file system in read/write mode and then try printf?
If not try pressing ctrl + d and then try
# touch /etc/vfstab
If this is successful use the printf command as previously mentioned.
If the ctrl +d fails to allow you to write to the root file system and the
remount option doesn't work I think the only solution is to boot off a CD.
As previously mentioned check the controller target disc slice for the root
file system using the format command and build up a vfstab that is sane.