Linux Getting Started Basics (iv) file system

Source: Internet
Author: User
Tags file size file system system log linux

Linux File System architecture

/bin store binaries (executable command RM,CD,CP, etc.), all users have permissions

/dev (abbreviation for device device) storage device file

In Linux, all hardware devices are abstracted into a single file

/boot Storage kernel and startup program related files

The main thing is file Vmlinuz-3.2.0-23-generic-pae, the kernel of the operating system and all the things related to boot and system startup.

/ETC almost all operating system-related configuration files. Most of it ends with. conf. cnf.

/home User Home Directory

/lib Storage System Library files

/media mount U disk, CD-ROM, such as automatic mount, here, some systems do not

/mnt is also mounted, all systems must have been mounted here before

/OPT is usually used to install some large software. But where it is not mandatory, it is customary here.

/proc does not exist on the hard drive, only exists in the memory of the file system, is a virtual file system. Save live information for the operating system

ll view the relevant files.    For example, display Cpuinfo, meminfo can view related information. The folder of numbers is process information

/sbin Store Privileged binaries (privilege level executable commands, and/bin are all people have permissions)

/sys is the bottom of the system.

/tmp temporary directory, automatically deleted

/usr typically holds the default installer (large software is in/opt),

/var typically store frequently changing data, such as service data, log files, etc.

/root Privileged User (root) home directory

File system operating system to manage files and data through the file system, disk or partition needs to create a file system before it can be used for the operating system, the process of creating a file system is also called the format.

A device that does not have a file system is also called a bare (raw) device

Common file systems by FAT32, NTFS, Ext2, Ext3, Ext4, XFS, HFS, etc.

Differences between file systems: Log, supported partition size, supported single file size, performance, etc.

The mainstream file system under Windows is: The mainstream file system for NTFS Linux is: ext3, EXT4

There is a difference between the performance of different file systems

Some file systems supported by Linux:

Ext2 ext3 ext4 Fat (msdos) vfat NFS iso9660 proc GFS JFS

Command MKE2FS used to create the file system

$ mke2fs-t Ext4/dev/sda3

Common parameters:-B blocksize Specify the size of the file system block-C to check the bad blocks when establishing the file system-L-label specifies that the volume label-j establish the file system log (Ext3,ext4 by default is logged and does not need to be taken with this parameter )

Command MKFS can also be used to create file systems that are simpler than MKE2FS but have fewer supported parameters and cannot be accurately controlled

$ mkfs.ext3/dev/sda3

$ mkfs.ext4/dev/sda4

$ mkfs.vfat/dev/sda3

Command DUMPE2FS can be used to view the partition's file system Information $ dumpe2fs/dev/sda2

Journal log file System (EXT3, EXT4) has a strong stability, in the case of errors can be restored using a log file system, the file system will use a "two-phase commit" way to disk operations, when the disk operation, the file system to do the following:

1. The file system writes the specific contents of the transaction to be executed to the log

2. File system to operate

3. After the successful operation, the specific contents of the transaction are removed from the log

The advantage of doing this is that you can recover from a query log if there is an accident, such as a power outage or a disk failure, when the transaction is executed. The disadvantage is that you lose a certain amount of performance (additional log read and write operations)

Command E2label view and set the file system label

$ e2label/dev/sda2 Display SDA2 system label

$ e2label/dev/sda2 Shuangde The sda2 tag is set to Shuangde, and the label is usually made up of uppercase letters.

Command fsck is used to check and repair corrupted file system $ fsck/dev/sda2 check sda2. . To check a file system, you must first uninstall that file system

Fix directly using the-y parameter without prompting

The default fsck automatically determines the file system type, and if the file system is corrupted, it is best to specify the file system type with the-t parameter

For corrupted data that is recognized as a file (the file system has no records), Fsck puts the file into the Lost + found directory. Each formatted disk will have a lost + found directory, which is usually empty, and the disk will be fsck when the system starts

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.