Linux file system and Disk Management __linux

Source: Internet
Author: User
Tags reserved uuid

A new disk disc needs to be partitioned, formatted (creating a file system) and mounted before it can be used properly. There are two formats for partition tables on disks: MBR (Master Boot record) and GPT (GUID Partition table)

Mbr:

Also known as the main boot sector, is the computer after the boot access to the hard disk must read the first sector, that is, 0 cylinder 0 Head 1 sectors, MBR by Bootload (446 bytes), partition table (64 bytes), MBR end flag (2 bytes) A total of 512 bytes. The maximum 2TB partition is supported. The MBR-formatted partition table supports 3 primary partitions and one extended partition.


Gpt:

In order to support partitions with a capacity greater than 2TB, a GPT partitioning table is introduced, with maximum support for 18EB


FDISK: Disk Partitioning tool

Fdisk <disk>

D: Delete a partition

L: List the types of partitions supported by the system

M: Printing Help

N: Add a new partition

P: Print partition Table

Q: Do not save exit

W: Save exit

T: Change the partition ID


2. Partprobe (CentOS 5), Kpartx,partx (CentOS 6):

Partprobe <disk>: Notifies OS system of disk partition table changes

Partx-a <disk>: Increase disk partitions or read all disk partitions

Partx-l <disk>: List all partitions of the disk

KPARTX-AF <disk>: Force additional disk partition mappings

Kpartx-l <disk>: Listing increased disk partition mappings


3. MKE2FS, MKFS: Format disk (create file system EXT2,EXT3,EXT4)

MKE2FS the configuration file/etc/mke2fs.conf, use the default parameters loaded with this command.

MKE2FS = mkfs-t ext2 = mkfs.ext2

MKE2FS:

-T: File system type (ext2 |  ext3 | EXT4)

-j: Equivalent to-t ext3

-L Label: Set volume label

-B (1024 | 2048 | 4096): Specify block size

-I num:num bytes Reserve an Inode

-N num: Directly specify how many Inode to reserve

-N: Do not create file system, but show actions performed during creation

-I. Num:inode size

-M num: The percentage of space reserved for administrators, defaults to 5

-U uuid: Using a custom UUID

-C: Check for bad block on disk before creating file system

-F: Force file system creation

-G: Customize how many blocks each block-group has

-G: Number of custom Block-group

-O [^]feature: Specify partition attributes

Feature: (Default sparse_super,filetype,resize_inode,dir_index,ext_attr)

Dir_index: Use b-trees hash to speed up large directory queries.

Extend: Speed up large file system access (large files)

filetype: Storing file type information

FLEX_BG: Allow Block-group information to be placed anywhere in the block

Has_journal: Create ext3 log (same-j)

Journal_dev: Create an external ext3 log to replace the Ext2 file system

Large_file: File system supports files larger than 2G

Resize_inode: Provides space for block-group growth

Sparse_super: Create a file system containing Super-block backups

UNINIT_BG: Accelerated file system Creation (supported only under EXT4)

-Q: Used to silently perform formatting in scripts


# MKE2FS/DEV/SDB1

MKE2FS 1.41.12 (17-may-2010)

warning:252 blocks unused.


FileSystem label=

OS Type:linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, stripe width=0 blocks

328320 inodes, 1310720 blocks

65548 blocks (5.00%) reserved for the Super user

The Data block=0

Maximum filesystem blocks=1342177280

Block groups

32768 blocks per group, 32768 fragments per group

8208 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736


Writing Inode Tables:done

Writing superblocks and filesystem accounting Information:done


This filesystem would be automatically checked every mounts or

180 days, whichever comes. Use Tune2fs-c or-i to override.

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.