open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: Remounting root

ITworld.com 4/24/2007

Sandra Henry-Stocker, ITworld.com

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.

On this topic

 

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
TRY NEW SUN SERVERS FREE for 60 Days!
Test The Latest Sun Servers In Your Environment BEFORE YOU BUY. Pay Nothing, Not Even Shipping.
Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.
Sign up for a FREE NETWORK RISK ASSESSMENT!
MORE THAN 70% OF NETWORKS ARE INFECTED by hidden Malware. Find out if your network is infected now!
Enterprise IP Goes Mobile
To maximize full productivity, companies must integrate their mobile applications with the IP network.
» Buy a link now

Advertisements
Sponsored links
Top 5 Reasons to Combine App Performance and Security
Locate Hidden Software on business PCs with this free tool
KODAK i1400 Series Scanners stand up to the challenge
Bring harmony to your mix of UNIX-Linux-Windows computing environments
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.