Checking Your File System


Normally you should be able to trust that your OS's file system will keep your data safe, but what about circumstances beyond your control? Maybe your power went out and you couldn't shut down the machine properly, for example.

You're going to need to be able to check your file systems for errors. Windows and Mac OS X both have operating-system-specific tools for checking the file system (although Mac OS X's is called fsck behind the scenes). Please refer to your operating system documentation for more information.

To check your file system with fsck

1.

Switch to single-user mode (see "To switch to single-user mode," earlier in the chapter).

This will let fsck do its job without your having to worry about other users poking around while it's working.

2.

mount

Using the mount command without any arguments prints a list of the mounted file systems and the devices they reside on (Figure 3.24).

Figure 3.24. The mount command lists your devices and where they're mounted in the file system.


3.

fsck filesystem

Use the fsck command to check the specified file system. You can specify a file system by giving its device (the cryptic /dev path) or by giving its mount point (such as /tmp).



    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net