linux-Disk File System Management

Source: Internet
Author: User

Device file name for the hard disk device:

IDE,STS:HD Opening

SATA:SD Opening

SCSI:SD start

USB:SD Opening

A,b,c,... to differentiate different devices under the same type

IDE:/dev/had/hdb

first one IDE Port: Master, from Hda,hdb

a second IDE Port: Master, from HDC HDD

SDA,SDB,SDC.

Hda

HDA1: First primary partition

HDA2:

Hda3:

HDA4:

HDA5: First logical partition

Fdisk-l See how many partitions the current system has [/dev/to/some_device_file]

[Email protected] ~]# fdisk-l/DEV/SDA

Managing Disk Partitions

Advanced formatting: Specify partition type

Mkfs–t ext3 The specified partition type is ext3

To create a partition:

[Email protected] ~]# Fdisk/dev/sdb

A toggle a bootable flag

b Edit BSD Disklabel

C Toggle the DOS Compatibilityflag

D Delete a partition delete a partition

L list known partition types shows all supported types. l is uppercase L when used in conjunction with t

M Print this menu

n Add a new partition create a fresh partition

o Create a new empty dospartition table

P Print the partition table shows the partitions on the current hard disk

Q Quit without saving changes do not save exit

s create a new empty Sundisklabel

t change a partition ' s system ID modifies the partition type .

U Change display/entry units

V Verify the partition table

W Write table to disk and exit Save and exit

X extra Functionality (EXPERTSONLY)

[[email protected] ~]# cat/proc/partitions See which partitions the kernel recognizes

[[email protected] ~]# partprobe notify hard disk reread partition table, general partition after re-reading, in order to format

File System Management:

Re-creating the file system will damage the original file

Mksf:make File System

-T Fstype performing file system types

[[email protected] ~]# mkfs-t EXT2/DEV/SDB5 format SDB5 partition as ext2 type

Mkfs-t ext2 =mkfs.ext2

Mkfs-t ext3 =MKFS.EXT3

specialized in managing ext Series files:

Mke2fs

-j: creating a ext3 type file system

-B block_size: Specifies the block size, the default is 4096, can be value 1024,2048,4096;

-L Label executes the volume label;

-M #: percentage of blocks specified to be reserved for super users

-I #: to specify how many bytes of space to create an inode, the default is 8192; The value given here should be 2^n times the block size ;

-N: specify inode number

-F: Force file system Creation

-E: user Specifies additional file system Properties

[[email protected] ~]# blkid Viewing the file system type, you can also view the volume label

/dev/sda1:uuid= "376611e6-90be-4b7e-ac1c-b57a5961fac6" type= "Ext4"

/dev/sda2:uuid= "094ec731-7d77-417a-af18-680d0d744f0e" type= "swap"

/dev/sda3:uuid= "16ba63e9-5762-4afb-b8e2-0ad5ed7c34b5" type= "Ext4"

/dev/sda5:uuid= "3da9db3d-f8a3-4c7d-b25c-f1f2af27171b" type= "Ext4"

/dev/sdb2:uuid= "8cbf19de-84b1-4d26-8d3b-77c1206e7342" type= "ext2"

/dev/sdb5:uuid= "0f599bd3-c824-4f55-b3a6-1f6b925375a4" type= "ext2"

/dev/sdb6:uuid= "42315B22-5B4A-4886-95EC-70EA63875FCC" type= "ext2"

[Email protected] ~]# BLKID/DEV/SDB2

/dev/sdb2:uuid= "8cbf19de-84b1-4d26-8d3b-77c1206e7342" type= "ext2"

E2label/dev/sda2 commands that specialize in viewing volume labels

[[email protected] ~]# E2LABEL/DEV/SDB5 Hello can also set volume label

[Email protected] ~]# E2LABEL/DEV/SDB5

Hello

[Email protected] ~]# mke2fs-j/DEV/SDB2

Check if there is Creatingjournal (32768 blocks): log,ext3 only supports the function of logging

File system type:

Ext2

Ext3

[[email protected] ~]# Cat/proc/filesystems See which file systems are currently supported by the system

TUNE2FS: Adjust file system related properties without damaging the original data

-j: adjust to ext3

Tune2fs–j/dev/sda5

-L Set or modify the volume label

[[email protected] ~]# tune2fs-l MMMMM/DEV/SDB5 Modify the volume label

-m# Modifying reserve percentages

-R # Specify number of reserved blocks

-O Set default mount options

Cc.

-c#: Specifies that the mount count reaches # several times after the self test,0 or 1 means to turn off this feature:

-i#: The number of days to use per mount for self-test:0 or 1 means to turn off this feature:

-L: Displays information in the Super block

[Email protected] ~]# tune2fs-l/DEV/SDB5

DUMPE2FS displaying file property information

-H displays only the Super block information

Fsck checks and repairs the file system

-T Fstype: Specifying File Types

-A automatic repair

E2fsck dedicated to repairing ext2,ext3 file Systems

-A automatic repair

-F Mandatory check




This article from "Linux operation and Maintenance" blog, declined reprint!

linux-Disk File System Management

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.