Send in your Unix questions today! |
See additional Unix tips and tricks
During the booting of Solaris, both the / and /usr file systems are mounted read-only and then later, before the boot process is fully complete, remounted read-write. This is all part of the normal boot process and no reason for concern. Disruptions to the normal boot sequence, however, can leave you with a file system that is mounted read-only and requiring repair with no obvious way to fix the problem. Do situations such as this require you to boot from CD, DVD or from a boot server before you can edit the files or scripts that are sabotaging your boot process? No, you can make use of the mount command's handy remount option and save yourself a lot of time and trouble.
Let's say that you are booting a system and you run into these errors:
ok boot
...
ERROR: svc:/system/filesystem/usr:default failed to mount / (see 'svcs -x'
for details)
Apr 29 17:44:58 svc.startd[7]: cvs:/system/filesystem/usr:default: Method
"/lib/svc/method/fs-usr" failed with exit status 95.
...
Root password for system maintenance (control-d to bypass):
|
When you type the root password and start to look around for the (pardon the pun) "root cause" of the problem, you immediately notice some issues. There's obviously some problem with mounting file systems. If you go to the /etc directory and look at vfstab, you might spot the typo that caused the particular error shown above -- the file type field for the root file system has somehow lost the "u" in "ufs" and the system is unable to mount the unrecognized "fs" file system.
If you try to edit the vstab file to fix the problem, however, you run into the problem that the file system is mounted read-only. You may not notice this immediately, though.
If you try using vi to fix the vfstab file, it will tell you that /var/tmp (used by vi for temporary file space) isn't available. If you try using ed instead, you will encounter a similar error (e.g., "tempnam failed"). If you then mount /var/tmp and try the edit again, you will then see a message telling you that the file is read-only. It's actually the file system that is read only, of course, but the problem will at this point be fairly obvious.
To get around the read-only problem, you might try remounting the root file system with a command such as this. Make sure you mount the proper device.
# mount -o remount /dev/dsk/c0t0d0s0 /
|
Of course, if your vfstab problem is like the one in this example with a typo in the file system type, this command will only toss another error at you. This time, the error will look something like this:
# mount -o remount /dev/dsk/c0t0d0s0 /
mount: Operation not applicable to FSType fs
|
To overcome the file system type problem, you could use the -F option to specify the intended file system type, thereby overriding the botched column in the vfstab file.
# mount -F ufs -o remount /dev/dsk/c0t0d0s0 /
|
At this point, you should have your file system mounted read-write, allowing you to make the needed changes and reboot normally.