Linux disk management-fstab file modification

Source: Internet
Author: User
Article Title: Linux disk management-fstab file modification. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

/Etc/fstab is a text file in which each file system (including partitions or devices) is described in one row. In each row, fields are separated by spaces or tabs. Lines starting with "*" in the file are comments. Sorting records in fstab files is very important. This is because programs such as fsck, mount, and umount perform their work in this order.

Example (sdb1 is the new hard disk ):

#/Etc/fstab: static file system information.
#
#
Proc/proc defaults 0 0
/Dev/sda1/ext3 errors = remount-ro 0 1
/Dev/sda6/home ext3 defaults 0 2
/Dev/sda5 none swap sw 0 0
/Dev/hdc/media/cdrom0 udf, iso9660 user, noauto 0 0 0
/Dev/fd0/media/floppy0 auto rw, user, noauto 0 0
/Dev/sdb1/release El ext3 defaults 0 2

Column 1 and Column 2: devices and default mount points

The content in the first and second columns is the simplest and most direct. They are used to tell the mount command What partitions or devices I want to mount and where I want the mount point. The mount point specified for a device in fstab is its default mount point, that is, if you do not manually specify other directories when mounting the directory, the system mounts the device to this directory. Most Linux distributions create dedicated directories for mount points, most of which are under/mnt.

Column 3: File System Type

The third column in fstab indicates the file system type of the device or partition. It supports many types of file systems. Here we will only introduce the most commonly used file systems. If you want to know which file systems your kernel currently supports, you can view the/proc/filesystems content. If this field is defined as swap, this record is associated with a file or partition for the purpose of exchange. If this field is defined as ignored, this row will be ignored. This is very useful for displaying partitions that are not currently in use.

Ext2 and ext3: The Ext2 File System in Linux is a standard file system in GNU/Linux systems. It features excellent file access performance, small and Medium files show more advantages, mainly because of the excellent design of the cluster cache layer. As for the Ext3 file system, it belongs to a log file system and is an extension of the ext2 system. The advantage of a log-type file system is that it records the write operations of the entire disk in a certain area of the disk so that it can be traced back when necessary. Because every detail is recorded in detail, when a process is interrupted, the system can review and refresh the interrupted part based on these records, it does not have to take time to check other parts. Therefore, when the file system detects inconsistencies, the reorganization process is fast and almost no time is required.

Reiserfs: ReiserFS is a very good file system. It is also one of the earliest log file systems used in Linux. Its Mechanism is much more advanced than Ext3, which has been used by Xiao Lei. Many distributions now use it as the default file system. Unfortunately, the author had an accident some time ago ...... I don't know the specific situation, and I don't know whether the next generation of reiserfs4 can come out, because ext4 has all of them.

Swap: Swap, that is, swap zone. Just think of it as virtual memory.

Vfat and ntfs: The partition format is Windows. 98, me and other systems all use vfat, that is, the most popular fat32 format, while the NT series mostly use NTFS, which is not fixed, of course, therefore, we need to analyze the specific situation of the XP system in 2000. At the beginning, Linux had poor support for NTFS writing. Therefore, we recommend that you use the vfat format for most data, but now the support is quite good, even if you do not re-compile the kernel, you can also write support through the ntfs-3g (refer to this article for specific methods), so don't care too much about this.

Auto: of course, this is not a file system type. Auto indicates that the file system type is automatically detected. In the above example, you will find that the file system types of the soft drive and the optical drive are both auto. Why? Because their file system types may change at any time, such as a soft drive or USB flash drive, it may be in the vfat format today, and you will format it into ntfs tomorrow. Therefore, the most sensible way is to tell the system that I cannot determine the current type of this thing. You should check it yourself.

Udf: due to the increasing popularity of optical drive burning, in many fstab releases, the file Format type of the optical drive is UDF, And the UDF is short for the Universal Disc Format, which is compatible with the ISO 9660 Format. It uses standard encapsulation write technology (PW, Packet Writing) to use CD-R/CD-RW as a hard disk, users can modify and delete files on the disc. When the UDF format is used for burning, the recording software packs the data, creates a special file directory table in the memory, and takes over the system's access to the CD.

Iso9660: This option is also used by many optical drives. ISO9660 is an international standard used to describe the structure of computer files suitable for CD disks. Disks using this standard can be used on different operating systems, such as MAC and Windows.

[1] [2] Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.