Linux ext File System

Source: Internet
Author: User
Tags syslog uuid

How to create a file system after partitioning a hard disk (how Windows is formatted for partitions, formatted with the FAT32 file system, or formatted with the NTFS file system). Linux mainly uses EXT2,EXT3 partition format for partition format. When a new hard disk is mounted on Linux, the Fdisk partition is first set up, then the partition is formatted (Linux is called Create file system), the file system is created on the partition, and the supported file system format is currently ext2,ext3. EXT2,EXT3 File System format differences: Early is based on the ext2, there is a disadvantage is not supporting the operation of records, the relevant operation will not have a log file generation, resulting in problems difficult to troubleshoot. EXT3 will generate log files, if the Linux system is based on ext3 to install, there will be log messages, [email protected]:/var/log#            lsalternatives.log faillog Syslog. 6. Gzalternatives.log. 1     fontconfig.log     syslog.7. GZ and based on ext2, there will be no log files. The distributions are now installed based on EXT3. Ubuntu is starting to perform ext4. 

The following is a ext3 way to create a file system for a partition:

Fdisk-L:command (M forHelp ): Pdisk Dev/sdb:2 GiB, 2147483648 bytes, 4194304sectorsunits:sectors of1 * 512 = 512bytessector size (logical/physical): bytes/512Bytesi/o Size (minimum/optimal): bytes/512Bytesdisklabel type:dosdisk Identifier:0x7251b8e3(now Dev/SDB has only one partition) Device Boot Start End sectors Size Id Typedev/SDB1 2048 4194303 4192256 2G 83Linux[email protected]:/# mke2fs/dev/sdb1 (Specify the file system for the partition) (/dev/SDB1 is the absolute path of the partition, the file system is created, the default is the Ext2 file system, [email protected]:/# MKFS.MKFS.BFS Mkfs.ext3 mkfs.fat mkfs.ntfs Mkfs.cramfs mkfs.ext4 Mkfs.minix mkfs.vfat Mkfs.ext2 Mkfs.ext4dev Mkfs.msdos is called by default MKFS.EXT2 command) MKE2FS1.42.13 (17-may-2015) Creating filesystem with524032 4k blocks and 131072Inodesfilesystem uuid:0b2cc385-1251-4219-b346-dc1ba2f086a7superblock backups stored on blocks:32768, 98304, 163840, 229376, 294912Allocating group Tables:done Writing inode Tables:done Writing Superblocks and filesystem accounting Information:done [email protected]:/# mke2fs-j/dev/sdb1 (plus-J, the file system created by the partition at this time is ext3) mke2fs1.42.13 (17-may-2015)/dev/SDB1 contains a ext2 file system (original EXT2 format) created on Tue Feb13 19:13:31 2018Proceed anyway?(y,n) ycreating filesystem with524032 4k blocks and 131072Inodesfilesystem uuid:b08780b9-9c1d-4b94-a804-4d0ac3ffcf82superblock backups stored on blocks:32768, 98304, 163840, 229376, 294912Allocating group Tables:done Writing inode Tables:done creatin G Journal (8192blocks): donewriting superblocks and filesystem accounting Information:done This file system is usually tested after it is created. Partitions are specified after the file system (after formatting) whether the partition has a corresponding error (sector error, hard disk logical partition Error). [Email protected]:/# e2fsck/dev/sdb1e2fsck1.42.13 (17-may-2015)/dev/sdb1:clean, 11/131072 files, 17205/524032blocks (This detection is very fast, because the current file system is not any file, is an empty partition, just detect sectors or hard disk blocks) (there will be a forced repair error) [email protected]:/# e2fsck-p/DEV/SDB1 (-P is a bug to be forcibly repaired)/dev/sdb1:clean, 11/131072 files, 17205/524032blocks (e2fsck is used to detect the repair of the file system, MKE2FS is used to create the file system) (after creating the partition can not be used immediately, to create a file type format, the last to mount the use) [email protected]:/# mount (Mount on the hard drive that is currently being used,. Other hard drives not seen) (SDA1 partitions mounted on/directory, the type is EXT4, the operating system through the directory to find hardware devices)/DEV/SDA1 On/type Ext4 (rw,relatime,errors=remount-ro,data=ordered)/DEV/SDA1 on/var/lib/docker/overlay2 type EXT4 (rw,relatime,errors=remount-ro,data=ordered)/DEV/SDA1 on/var/lib/docker/overlay2 type EXT4 (rw,relatime,errors=remount-ro,data=ordered) when using MKE2FS-j/dev/SDB1 After the file system is created, the file system is available, and each partition is mounted to a directory (the operating system looks up the hardware device through the directory) (after the file system has been mounted continuously for several times, or after the file system has been used for many days, This filesystem will be automatically detected using E2FSCK when the operating system restarts, and a program will also invoke the relevant command execution. [Email protected]:/# tune2fs-l dev/sdb1 (View the details of the partition) TUNE2FS1.42.13 (17-may-2015) Filesystem volume name:<none>: The name of the volume last mounted on:<not available>: Last Mount time filesystem uuid:b08780b9-9c1d-4b94-a804-4d0ac3ffcf82:uuid filesystem magic Number:0xef53Filesystem Revision #:1(dynamic) Filesystem features:has_journal ext_attr resize_inode dir_index filetype s[email protected]:/# tune2fs-c 100/dev/SDB1 (after the partition is mounted 100 times, the system restarts when detected, whether there are bad blocks, bad files) tune2fs1.42.13 (17-may-2015) Setting maximal mount Count to100[email protected]:/# Tune2fs-i 100d/dev/SDB1 (after the partition is mounted for 70 days, the system restarts and detects if there are bad blocks, bad files) tune2fs1.42.13 (17-may-2015) Setting interval between checks to8640000seconds when the hard disk is partitioned, both the Windows and Linux operating systems have a volume label, an identity,

[Email protected]:/# e2label/dev/sdb1 yw volume label name (assign volume label to partition) [email protected]:/# tune2fs-l dev/SDB1TUNE2FS1.42.13 (17-may-2015) Filesystem Volume name:yw Volume label Name: Volume label last mounted on:<not available>Filesystem uuid:b08780b9-9c1d-4b94-a804-4d0ac3ffcf82filesystem magic Number:0xef53[email protected]:/# Find Find Findfs findmnt [email protected]:/# Findfs label=yw volume label name (find partition information for volume label information)/dev/SDB1MKE2FS is to create the file system, E2fsck detect the current file system, TUNE2FS view the file system information, E2label specify the volume label name, Findfs find the volume label information. ------------------above is how to create a file system, that is, how to format the partition, Fdisk set up a good partition for the new hard disk, the first to create a file system, Windows basically as long as the partition after formatting (create NTFS file system) to allocate the corresponding drive letter can be used, Linux on the use of new hard disk, partition, Mount file system, Finally, you will mount the operation-------------------------------------------

Linux ext File System

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.