Linux file Systems (3)

Source: Internet
Author: User
Tags uuid

The previous blog post has explained how to partition a disk. Next we create the file system on the partition.

Using MKFS to create file systems under Linux

Usage:

mkfs-t File system type device name

Creating a Ext3 File system

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/86/wKioL1V-6v2ApoWqAALK05jGIhU768.jpg "title=" 4.PNG " alt= "Wkiol1v-6v2apowqaalk05jgihu768.jpg"/>

Create the FAT32 file system (Linux identifies FAT32 as Vfat )

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/86/wKioL1V-6y3getGkAACeedeijP0427.jpg "title=" 5.PNG " alt= "Wkiol1v-6y3getgkaaceedeijp0427.jpg"/>


The following focuses on the MKE2FS that specialize in managing Ext series files.

If you man mke2fs, Mkfs.ext2, Mkfs.ext3 and Mkfs.ext4 , you will find that seeing is

The same help document, which shows that the 4 commands are the same .

You can also cd/sbin again Ls-il | GREP mk can find that the inode of these commands is the same.

We take MKE2FS as an example to introduce. (For details, please own man MKE2FS)

The common options for the MKE2FS command are as follows:

- t: Used to specify the type of file system, either ext2, Ext3, or EXT4.

(mke2fs-t ext4 equivalent to MKFS.EXT4

Mke2fs-j equivalent to MKFS.EXT3)

- B Block Size: Specify block sizes, default to 1024, available with values of 1024, 2048, or 4096

-j: Creating the Ext3 File System (j:journal)

-L Label: Specifies the label of the partition

-M: Specifies the percentage of blocks reserved for super users

-I: Specify how many bytes of space to create an inode

-N: Specify Inode Count

-F: Force file system creation (typically for mounted)

-E: User specified additional file system attributes


Here are some common things to do: (Experimental environment Centos 6.5)

Create the Ext2 file system on the partition.

It can be found that the default is ext2 if you do not specify the file system type with-t

And the BLOCK SIZE is 1024.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/8D/wKioL1V_y1qC5iVuAALX5B5QIbY971.jpg "title=" 1.PNG " alt= "Wkiol1v_y1qc5ivuaalx5b5qiby971.jpg"/>


Create the Ext3 file system and specify a block size of 2048

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/8D/wKioL1V_zRjhRhk1AAMs4sEVjC0092.jpg "title=" 2.PNG " alt= "Wkiol1v_zrjhrhk1aams4sevjc0092.jpg"/>

Create a Ext4 file system and specify a block size of 4096 with a label of MyData

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/8D/wKioL1V_ze6h5N3mAAL4_uQAQt8240.jpg "title=" 3.PNG " alt= "Wkiol1v_ze6h5n3maal4_uqaqt8240.jpg"/>

Create a ext3 file system with a block size of 4096 and a percentage of blocks reserved for super users to 3


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/91/wKiom1V_zcrjvYz0AALrBP7tQLU651.jpg "title=" 5.PNG " alt= "Wkiom1v_zcrjvyz0aalrbp7tqlu651.jpg"/>



Now let's talk about the Blkid command. This command allows you to view the device's related properties.

Usage: blkid device Name

His results include:
UUID: Unique identifier (UUID full name is universally unique Identifier)

Each partition has a unique UUID, which we typically use like/dev/sda2.

Name identifies a partition, in general, the name does not change, but if you have multiple drives,

When the order of the hard disk changes in the computer, the same name may represent a different hard disk partition,

If you are booting from a USB device, the insertion order with other USB devices will also cause difficulty in zoning recognition.

The above problems can be solved with the UUID. The most typical examples are those that are mobile devices,

such as a USB stick, when the system is connected to the USB stick, it may be/dev/sda1 this device name assigned to it,

But if the USB stick is plugged into another system, the device name it is assigned to is not/dev/sda1, and may become/dev/sdb1.

(So it is recommended to use UUID when mounting partitions)

Type: File system types

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/8E/wKioL1V_1BagyM9FAAB9fWaBnFw932.jpg "title=" 6.PNG " alt= "Wkiol1v_1bagym9faab9fwabnfw932.jpg"/>



E2label: Used to view or define volume labels

Usage: E2label device file name volume label

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/8E/wKioL1V_2Iaxai4FAAEJ3CRzg7Y720.jpg "title=" 7.PNG " alt= "Wkiol1v_2iaxai4faaej3crzg7y720.jpg"/>


TUNE2FS: Adjusting the file system's related properties

-j: Do not damage the original data, upgrade the ext2 to ext3 (note that ext3 can not be reduced to ext2)

- L LABEL: Set or modify volume label

-M: Adjust reserve percentage

-R: Adjust the number of reserved blocks

-O: Set default mount Options

-C: Specify the number of times the mount has reached after self-test, 0 or 1 means to turn off this feature

-I: Self-test after each mount using the number of days, 0 or 1 means turn off this feature

-L: Displays information in the Super block

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/8E/wKioL1V_2lXBlExQAAGILuRt5Ww984.jpg "title=" 8.PNG " alt= "Wkiol1v_2lxblexqaagilurt5ww984.jpg"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/8E/wKioL1V_2t2RYwbnAAHdUcZ76YQ767.jpg "title=" 9.PNG " alt= "Wkiol1v_2t2rywbnaahducz76yq767.jpg"/>



650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/8E/wKioL1V_2_vQ4LrDAAGetLWTFc0240.jpg "title=" 10.PNG "alt=" Wkiol1v_2_vq4lrdaagetlwtfc0240.jpg "/>


DUMPE2FS: Show Super Block info

Usage: DUMPE2FS device name

-H: Show only Super block information

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/8F/wKioL1V_4_TRT44CAAJplrNue4k949.jpg "title=" 11.PNG "alt=" Wkiol1v_4_trt44caajplrnue4k949.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/8F/wKioL1V_5B-SKaRuAAHOI31ohYU164.jpg "title=" 12.PNG "alt=" Wkiol1v_5b-skaruaahoi31ohyu164.jpg "/>



Fsck: Checking and repairing Linux file system types


-t:filesystem

-A: Automatic repair (do not ask for auto-complete repair)


E2FSCK: Special Repair ext2 ext3 EXT4 commands

-F: Forced repair

-P: Automatic repair


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/8F/wKioL1V_6SbgDjABAADUpqjzc04375.jpg "title=" 13.PNG "alt=" Wkiol1v_6sbgdjabaadupqjzc04375.jpg "/>




Linux file Systems (3)

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.