Best of Technical Support

Our experts answer your technical questions.
fsck without Reboot

I'm building a series of servers for a friend of mine, and they must stay on 24 hours a day, 7 days a week, 52 weeks a year (well, if they don't burn, obviously).

Is there a way to automatically recheck a mounted filesystem? —Franco Favento dei Favento da Trieste, f.favento@ieee.org

Switch to reiserfs, a journaling filesystem for Linux. Even without it, I have had Linux servers running for years without filesystem glitches, but reiserfs is more reliable. But if you really want to do a filesystem check, boot using a very minimal (better still, ramdisk) root filesystem, and store on it only those executables needed to run a minimal system. That will allow you to unmount the filesystems you actually need to check. —Chad Robinson, crobinson@rfgonline.com

Only a read-only check can be done on a mounted filesystem. It cannot be repaired:

fsck.ext2 -fn some-device

If it detects errors, you can plan downtime to repair the filesystem. —Keith Trollope, keith@wishing-well.demon.co.uk

Files Larger than 2GB

I am happy to report that my employers are moving to Linux in a big way for seismic data crunching, and they've given me a nice symmetric multipenguin. However, I routinely use files greater than 2GB. I've got reiserfs and a 2.4.2 kernel on the RH 7.0 installation now, but still can't deal with files greater than 2 —Adam Cherrett, adam.cherrett@elfgrc.co.uk

You should look at http://www.suse.de/~aj/linux_lfs.html. In addition to kernel and glibc support, you need to do one of the following in your programs: 1) Compile your programs with gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE. This forces all file access calls to use the 64-bit variants. Several types change also, e.g., off_t becomes off64_t. It's therefore important to always use the correct types and to not use, for example, int instead of off_t. 2) Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE. With these defines you can use the LFS functions like open64 directly. 3) Use the O_LARGEFILE flag with open to operate on large files. —Marc Merlin, marc_bts@valinux.com

Finding Memory Hogs

I have recently installed Linux on my PC with 256MB RAM. I wanted to use it as my experimental system with an Oracle server and for some Java development.

To my surprise, the system was striving for resources, especially memory. So I booted it fresh, and without an X session I checked for memory usage with free. It was showing that about 110MB was used. How do I decide what processes are using how much memory? —Dhimant Patel, a24z57k@runbot.com

Be sure to note the “-/+ buffers” line when running the free command. Linux will automatically use available RAM to buffer I/O requests, and this memory will be freed for program use as necessary. Your primary concern should be the “used” indicator for your Swap space. It should be small—less than a few megabytes. You can use the ps aux | less command to examine the memory usage of each running process. Only the resident set size (RSS) value should be important here, but be aware that the memory indicated is not necessarily used as-is by each process. That discrepancy has to do with the fact that ps will show all memory used, even by shared libraries, although they are loaded only once for all processes that need them. —Chad Robinson, crobinson@rfgonline.com

make zdisk Makes SuSE Box zdead

I compiled kernel 2.2.16 from SuSE using make zdisk. When I boot my system, the progression dot goes to the end of the screen and bombs out with the error mesage “out of memory”. —Eskinder Mesfin, amesfin@uhc.com

You need to compile with make bzdisk to solve that problem; it shuffles memory around in different ways to make bigger kernels work. —Marc Merlin, marc_bts@valinux.com

Matthew 9:17

I made some backup tapes using ftape (HP/Colorado Travan 1). I could read them fine on Red Hat 5.2, but on later releases (e.g., 6.2, 7.0) it acts as if nothing is on the tape. —Jim Haynes, jhaynes@alumni.uark.edu

In the newer versions of ftape, a fixed block size on the tape is used rather than the variable size previously used. To change the block size to a variable size, type:

mt -d /dev/qft0 setblk 0

Information on the old and new versions can be found on the >tape home page, http://www.instmath.rwth-aachen.de/~heine/ftape/. —Keith Trollope, keith@wishing-well.demon.co.uk

______________________

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix