Best of Technical Support

Our experts answer your technical questions.
Something Odd

When I installed my Mandrake 7.1 system, I partitioned it so that /dev/hdb4 would be mounted to /usr and /dev/hdb2/ on / and /dev/hda1 on /boot. My problem is when I restart or halt Linux at the stage when it unmounts the file systems, I get this error: /usr: device is busy. And then it freezes there. When I start the system again, it takes a long time to check it dev/hdb4. I would like to know how to fix this. —Charles Diaz-Alejandro, oguara@bellsouth.net

It sounds like there must be a process that is still running when the system drops runlevels. If that process has any files open or accesses to that partition, it is possible that mount will not be successful. What you might try booting into single-user mode and then looking at how many processes you have and which ones they are specifically. Runlevel 1 should have very few processes because they get killed when you switch runlevels—it is possible that one of the processes is not responding or cannot be terminated properly. What you could try doing while in single-user mode is to remount the /usr partition read-only with mount -o remount,ro /usr. If this fails due to “busy” errors, then try killing off some of the higher-numbered processes. You probably don't want to kill the very low-numbered ones, though. After each kill, try to remount the /usr read-only until it succeeds. Then you will know which process is causing the hangup. It may also be due to the amd process. I have seen amd and nfs cause mishaps like this. Once you know which process it is, you can disable the service or at least work towards getting it fixed properly. —Andy Bradford, andyb@calderasystems.com

The system prefers not to unmount a file system if a file within it is opened or if a process has its current working directory within the file system. Most distributions try to remount the file system read-only if umount fails, in order to avoid the file system check pass on next boot. Mounting read-only fails only if a file in the partition is opened for writing. If your mount command is not to ancient, change the umount to umount -r (manual says: “In case unmounting fails, try to remount read-only.”) I can't tell why your umount fails, but you can try to find the guilty process by calling “fuser” in the shutdown script before the umount command:

fuser -m /usr; ps afx; sleep 10

(The “ps” helps in understanding what the process IDs are). Refer to man fuser for any details. —Alessandro Rubini, rubini@linux.it

It's probably due to a minor bug in Mandrake. One way to find out is do add this just before the end of /etc/rc.d/init.d/halt:

(fuser -vm /usr; ps auxww )| more
read a

(before the “# Now halt or reboot” section). This would usually require you to copy /usr/sbin/fuser to /sbin/fuser to that it's accessible, but since /usr is not being unmounted, it should still be accessible in /usr. Fuser should show you a list of processes that still use the /usr mountpoint and you can look up their number. Then, depending on the output, you can modify the halt script to kill those processes (although the halt script should already kill everything) or ask MandrakeSoft why those processes don't get killed and your partition doesn't get unmounted. —Marc Merlin, marc_bts@valinux.com

“Sleep” Mode

Does Linux have a “standby” mode similar to Windows 98? This would enable my computer to sort of power down and sleep when no activity is detected. —Ronnie Bell, ronbell@cais.com

If your kernel has APM compiled in (and I believe the default Red Hat 6.2 kernel does), you can use the standby button on your PC case if you have one and configure it to put the machine on standby if you do a short press. From the command line, you can also use apm -s or apm -S for suspend and standby. —Marc Merlin, marc_bts@valinux.com

The kernel automatically halts the CPU when there is no work to be done, enabling the CPU to enter a low-power mode (the CPU is reactivated when there's more work to do; this is all transparent to you). You can also configure APM (Advanced Power Management) support in your kernel, assuming you have a laptop with an APM-compatible BIOS. For even more power savings, you can tell the X server to use DPMS (the Display Power Management System) to turn off your monitor after a long enough period of keyboard/mouse inactivity. I do that with:

xset +dpms
xset dpms 600 1800 3600

This puts the monitor in standby mode after 10 minutes (600 seconds), goes to suspend mode after 30 minutes (1,800 seconds) and turns it completely off after 60 minutes (3,600 seconds). Each of these levels increases the power savings. Adjust the numbers to suit your working style, but be aware that your video card and monitor must support DPMS in order for this to work—otherwise, nothing special will happen. As an alternative to the xset command, you can enable DPMS support in your XF86Config file; search for “power_saver” in the XF86Config man page for more information. Finally, you can use the hdparm command to spin down your hard disk. I don't personally recommend this, if only because spinning the drive down and back up reportedly causes as much wear and tear as six hours of use, but you can do it if you want to (read man hdparm for details). I'm willing to make some sacrifices for the good of the planet, but sacrificing my Linux disk is simply too much to ask. :-)—Scott Maxwell, maxwell@ScottMaxwell.orgi

You should use the apmd package, which is available from Red Hat's distribution. Of course, the “apmd” d<\#230>mon should be started at boot time (try “setup” or “linuxconf” to add it to the system services). —Pierre Ficheux, pficheux@com1.fr

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState