21.02.2013 Views

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In many cases, restoration of the backup of the superblock to the primary<br />

superblock will recover the file system. If this does not resolve the problem,<br />

recreate the file system and restore the data from a backup.<br />

7.4.4 Sparse file allocation<br />

Some applications, particularly databases, maintain data in sparse files. Files<br />

that do not have disk blocks allocated for each logical block are called sparse<br />

files. If the file offsets are greater than 4 MB, then a large disk block of 128 KB is<br />

allocated. Applications using sparse files larger than 4 MB may require more disk<br />

blocks in a file system enabled for large files than in a regular file system.<br />

In the case of sparse files, the output of the ls command is not showing the<br />

actual file size, but is reporting the number of bytes between the first and last<br />

blocks allocated to the file, as shown in the following example:<br />

# ls -l /tmp/sparsefile<br />

-rw-r--r-- 1 root system 100000000 Jul 16 20:57 /tmp/sparsefile<br />

The du command can be used to see the actual allocation, since it reports the<br />

blocks actually allocated and in use by the file. Use du -rs to report the number<br />

of allocated blocks on disk.<br />

# du -rs /tmp/sparsefile<br />

256 /tmp/sparsefile<br />

Note: The tar command does not preserve the sparse nature of any file that<br />

is sparsely allocated. Any file that was originally sparse before the restoration<br />

will have all space allocated within the file system for the size of the file. New<br />

<strong>AIX</strong> <strong>5L</strong> options for the backup and restore command are useful for sparse<br />

files.<br />

Using the dd command in combination with your own backup script will solve this<br />

problem.<br />

7.4.5 Unmount problems<br />

A file system cannot be unmounted if any references are still active within that file<br />

system. The following error message will be displayed:<br />

Device busy<br />

or<br />

A device is already mounted or cannot be unmounted<br />

154 <strong>IBM</strong> ^ Certification Study Guide - <strong>AIX</strong> <strong>5L</strong> <strong>Problem</strong> <strong>Determination</strong> Tools and Techniques

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!