Linux basics: File System

Source: Internet
Author: User

Linux basics: File System Linux File System Structure/bin stores binary files (executable commands such as rm, cd, and cp). All Users have the permission/dev (device abbreviation) storage Device Files in Linux, all hardware devices are abstracted into a file/boot storage kernel and startup program files the most important is the file vmlinuz-3.2.0-23-generic-pae, it is the kernel of the operating system and all the things related to boot and system startup/etc almost all the configuration files related to the operating system. Most of them are. conf. the/home user's home directory ending with cnf/lib stores system library files/media Mount USB disks and CDs. Here, some systems do not have/mnt, and all systems must have them, previously, it was mounted here./opt is usually used to install some big software. However, it is not mandatory. /Proc does not exist on the hard disk and only exists in the memory file system. It is a virtual file system. Save the real-time information of the operating system ll and view related files. For example, if cpuinfo is displayed, meminfo can view related information. the folder for numbers is process information/sbin stores privileged binary files (privileged-level executable commands, and/bin is owned by everyone) /sys is the temporary/tmp directory at the underlying level of the system. It will automatically delete/usr and generally store the default Installer (large software is in/opt ), /var stores frequently-changing data, such as service data and log files./root privileged users (root) manage files and data through the file system in the file system, a disk or partition can be used by the operating system only after a file system is created. The process of creating a file system is also called formatting. A device without a file system is also called a raw device. Common file systems include fat32, NTFS, ext2, ext3, ext4, xfs, HFS, and other file systems: logs, supported partition size, support for a single file size, performance, and other mainstream windows file systems: NTFSLinux mainstream file systems are: ext3, different file systems of ext4 have different performance. Some file systems supported by Linux: ext2ext3ext4fat (msdos) vfatnfsiso9660procgfsjfs command mke2fs is used to create a file system $ mke2fs-t ext4/dev/sda3 common parameters: -B blocksize: specify the size of the file system block-c: Check the damaged block when creating a file system-L label: Specify the volume label-j: create a file system log (ext3, ext4 contains logs by default, the command mkfs can also be used to create a file system. Compared with mke2fs, mkfs is simple, but does not support many parameters and cannot be precisely controlled. ext3/dev/sda3 $ mkfs. ext4/dev/sda4 $ mkfs. the vfat/dev/sda3 command dumpe2fs can be used to view the file system information of a partition $ dumpe2fs/dev/sda2 journal log file system with logs (ext3, ext4) has strong stability, when an error occurs, you can restore the file system with logs. The file system uses a "two-phase commit" method to perform disk operations, the file system performs the following operations: 1. the file system writes the specific content of the transaction to log 2. file System Operations 3. after the operation is successful, delete the specific content of the transaction from the log. The advantage is that when the transaction is executed, if an accident occurs (such as power failure or disk failure ), you can query logs to restore data. the disadvantage is that it will lose some performance (additional log read/write operations) run the e2label command to view and set the file system label $ e2label/dev/sda2 to display the sda2 system label $ e2label/dev/sda2 SHUANGDE to set the sda2 label to SHUANGDE, labels generally contain uppercase letters. The command fsck is used to check and repair damaged file systems $ fsck/dev/sda2 to check sda2 .. to check a file system, you must first uninstall the file system and use the-y parameter without prompting to directly repair the default fsck to automatically determine the file system type. If the file system is seriously damaged, it is best to use the-t parameter to specify the file system type. For corrupted data identified as files (the file system has no records), fsck will put the file into the lost + found directory. each formatted disk will have the lost + found directory. Generally, this directory is empty and fsck will be performed on the disk when the system starts.

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.