http://freshrpms.net/ — The FreshMeat yum repository. It's part of the OSTG, which also includes Slashdot and linux.com.

http://dag.wieers.com — The yum repository of Dag Wieers.

http://atrpms.net — ATrpms yum repository. It includes some highly unstable packages, so use it at your own risk!

http://apt.sw.be/dries/ — Dries's yum/apt repository.

http://www.fedorafaq.org/ — A useful, but unofficial, source of information. It gives locations of GPG keys for all the previously mentioned repositories.

CHAPTER 35

Managing the File System

A Linux file system is more than just a format for your hard drive or floppy disk and more than just the disk itself or the formatting process. The file system is the structure and organization of data on a data storage device. In other words, it is how your data is organized and stored in files, disk drives, and removable media.

In this chapter, you learn about the structure of the disks themselves, the file systems that can be placed on them, and how to work with those file systems. You also learn some background and history about the file systems that Linux can use. This chapter provides some basic information about the file system's default settings, as well as how you can adapt those settings to better match your system and its needs. At the end of the chapter, you learn how to build a test file system and use the loopback file system so that you can safely explore all the file system commands without risking any damage to your system.

Also covered are the use of the file system table, fstab, and instructions for formatting ext3, reiserfs, and DOS drives. The 'Reference' section is full of sources with extensive information on file system-related topics.

The Fedora File System Basics

The Fedora file system, like all Unix file systems, is used for storing not only data, but also metadata — information about the files, such as who the file owner is, what permissions are associated with the file, and other file attributes.

The Fedora file system is much more complex than most people care to know about. Its features are patterned after features found on commercial Unix systems, as well as those included in research or experimental file systems.

Fortunately, the native Linux file system is robust and works well with the default settings. Fedora has conveniently provided an easy-to-use setup tool for use during the installation, but here you also learn how to manage file system settings manually.

Providing a great deal of flexibility, the file system support enables Linux users to access files on file systems used by other operating systems, many of which are obscure. A sampling of the Fedora kernel modules for supported file systems is as follows:

cramfs — Compressed ROM file system.

ext3 — Linux Extended File System 3 (adds journaling to ext2). Note: work is now underway to develop ext4, which will build upon ext3.

fat — Microsoft File Allocation Table file system: FAT 12 and FAT 16.

hfs — Macintosh: Hierarchical file system.

jfs — IBM's journaled file system.

msdos — Microsoft File Allocation Table -16.

nfs — Network file system.

ntfs — Windows NT, Windows 2000, Windows XP.

reiserfs —Reiser file system.

smbfs — File system based on the use of the Shared Message Block protocol used by Microsoft and Samba.

udf — Universal Disk Format (DVD-ROM file system).

umsdos — MS-DOS file system with Linux permissions.

vfat — Microsoft File Allocation Table file system known as FAT32.

Support for ext3, ext2, NFS, and iso9660 file systems is compiled into the Linux kernel; all others are available as modules.

There is not an exact correlation between the file system source code and the modules compiled for the default kernel. The kernel documentation for the file systems can be found at /usr/src/linux- 2.6/Documentation/file systems/. The usage of some of these file system modules is mentioned in the man page for mount.

Physical Structure of the File System on the Disk

If you were to visualize the file system on the physical disk, it would resemble a series of boxes known as blocks. The first block on the disk is a special block that contains the boot sector; subsequent blocks contain the operating system, applications, and your data.

Each individual block is made up of smaller groups of data:

> A superblock (called by that name because it contains redundant information about the overall file system).

> Redundant file system descriptors — All the redundant information is useful for reliability and recovery from disasters and errors.

> A bitmap of the block.

> A bitmap of the inode table.

> Information from the inode table.

> The data blocks themselves.

Inodes and File Attributes

The information that constitutes a file in the ext2/ext3 file system begins with the inode. The inode contains the following description of the file: the file type, its access rights, its owners, several different time stamps, the file size, and pointers to data blocks that hold the file information. When you want to access a file, the kernel uses those pointers to calculate where the data resides physically on the disk.

File attributes are also stored in the inode. The chattr command enables the root operator to manipulate some special attributes of files on an ext2/3 file system. One of the most interesting uses of the chattr command is to make a file immutable, meaning that it cannot be deleted, renamed, written to, or modified by anyone, even root (at least until the immutable attribute is unset). To make a file immutable (the word means unalterable; not capable of change):

# chattr +i filename

and to change it back:

# chattr -i filename

Another interesting flag is the s flag, which tells the system to zero out all the blocks

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату