linux-(Linux) file systems <2>

Source: Internet
Author: User

When the operating system manages files and data through the file system, the disk or partition needs to be created before it can be used by the operating system, and the process of creating a file system is what we often call formatting. Devices that do not have a file system are also known as bare (raw) devices.
Common file systems include FAT32, NTFS, Ext2, Ext3, Ext4, XFS, HFS, and so on. where FAT32, NTFS is a common file system under Windows, now Windows is basically NTFS. And Linux under the mainstream file system has: Ext3, Ext4 and so on. Ext3 and EXT4 are both file systems with logs, and ext2 are not.
In addition to Ext3, EXT4 and other commonly used file systems, Linux supports the file system mainly have these: ext2, ext3, Ext4, Fat (msdos), VFAT, NFS, iso9660, Proc, GFS, JFS and so on.
Creating a file system
Create a file system using the MKE2FS command, for example: Mke2fs-t Ext4/dev/sda3
Common parameters:
-B blocksize Specify file system block size
-C Check bad block when setting up file system
-L label Specifies the volume label
-j creating a file system log
There is also a streamlined command mkfs to create a file system that supports fewer parameters and does not allow granular control of the file system
MKFS Ext3/dev/sda3
View file system information for a partition
Dumpe2fs/dev/sda2
Add tags to the file system
E2label/dev/sda2 xxx (Set the SDA2 system label to XXX, the label is usually uppercase)
E2label/dev/sda2 (displays Sda2 's System tab)

File system with Log
Here is the file system with the log, with the log file system (EXT3, EXT4), this log is called Journal log, such a file system has strong stability, in the event of an error can be restored.
Using a file system with a log, the file system uses a "two-phase commit" approach to disk operations, and the file system takes the following steps when disk operations are performed:
(1) The file system writes the specific contents of the prepared transaction to the log
(2) File system for file operation
(3) After the operation succeeds, the transaction specific content is removed from the log
The advantage of this is that when the transaction executes, if there is an unexpected (such as a power outage or disk failure), you can recover by querying the log, with the disadvantage of losing a small fraction of performance.
The command fsck is used to check and repair the corrupted file system.
Fsck/dev/sda2
If you add the-y parameter, you are not prompted to fix it directly.
By default, Fsck automatically determines the type of file system, and if the file system becomes more corrupt, use the-t parameter to specify the type of file system. For corrupted data that is recognized as a file (the file system has no records), fsck places the file into the Lost+found directory

The disk is automatically fsck when the system starts


Reprint please indicate the source

Http://blog.csdn.net/redstarofsleep

linux-(Linux) file systems <2>

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.