Linux Disk partitioning instructions

Source: Internet
Author: User

1. fdisk [-l] appliance Name: View disk partition, or disk partition, parameters:

-L: Outputs all the partition contents of the device after the output . If only fdisk–l is available, the system will list the partition of the devices that can be searched throughout the system .

Once the instruction is executed, You can see the meaning of each parameter simply by entering m after the for help:

2. mkfs [-t File system format ] appliance file Name: Format file system, Parameters:

1)-T: Can receive file format, such as ext3,ext2,vfat, etc.

3. Mke2fs [-B block size ][-i block size ] [-L header ] [-CJ] Appliance: Create a file system instruction parameter,

1)-B: You can set the size of each block, currently supports the 1024,2048,4096bytes three kinds;

2)-I: how much capacity to give an inode

3)-c Check disk errors, only one time -C, will be a quick read test, if released two times -c–c, will test read and write, a bit slow

4)-L: The name of theheader can be followed.

5)-j: Originally mke2fs is EXT2, plus -j , will actively join journal and become EXT3

4. fsck [-t file system ][-acay] appliance name: Check and fix file system, only root permission can use the directive, parameters:

1)-T: File system type,ext3, etc., now Linux will automatically analyze the file system through Superblock, so this option is generally not required

2)-A: According to the content of the/etc/fstab, the required device is scanned once, the command will be executed by the boot process

3)-A: automatic repair of problematic sectors checked,

4)-y: Similar to-a, but some filesystem only support the-y parameter

5)-C: This histogram can be used to show the current progress during the inspection process .

Also for ext2,ext3 file systems are :

6)-F: Strong inspection, generally if not found any dirty labels, will not take the initiative to enter the details of the inspection, if you want to force into the detail check, plus this parameter can be

7)-D: Optimized for directories under File system.

This command must be uninstalled before it can be executed, and if the instruction is executed on the mounted device, the system hangs

5. badblocks [-SVW] device name: Check the hard disk or floppy disk sector there is no bad track instructions, parameters:

1)-S: List progress on the screen

2)-v: You can see the progress on the screen

3)-W: Test with Write, it is recommended not to use this parameter, especially when the device to be inspected has a file.

6. Mount [-al] [-t file system ][-l label name ] [-o extra option ] [-n] appliance file name mount point: Mount the device to the specified directory , Parameters:

1)-A: mount all the disks that are not mounted according to the data from the configuration file /etc/fstab

2 ) - L : Simple Input Mount Displays the information currently mounted, plus - L can be added after Label name

3)-T: Plus file system type specifies the type of mount to be mounted

4)-N: By default, the system will try to write the actual mount to the/etc/mtab , in order to facilitate the operation of other programs, but in some cases (such as stand-alone mode) in order to avoid problems, you can not write, this time you have to use this -n option.

5)-L: The system can be mountedusing the file system's header name(label)in addition to the device file name (/dev/hd6). It's a good idea to have a unique name for your file system.

6)-O: You can attach some additional parameters after mounting! For example, account number, password, read and write permissions, etc.:

Ro,rw: Mount file system is called read-only or erasable

Async,sync This file system uses a synchronous write or asynchronous write memory mechanism, which defaults to asynchronous

Auto,noauto: Allows this partition to mount automatically with Mount–a

Dev,nodev: Allows you to create a profile on this partition

Suid,nosuid: Allow this partition to contain suid/sgid file formats

exec,noexec: Whether to allow executable binary files on this partition

User,nouser: Allows this partition to allow any user to execute Mount, typically mount can only run as root, but release user parameter, the partition can be used to mount the

Defaults: The default value is:rw,suid,Dev,exec,Auto,nouser,async

Remount: Re-mount,

Typically, these parameters do not need to be specified, and the system automatically acquires the superblock based on the

Mount–-bind Source directory destination directory: mount a directory to a different directory, with the same inode node for its two directories .

7. umount [-FN] device file name or mount point: Unloading device, directory, parameters:

1)-F: Forced dismount, can be used in cases like network file system cannot read

2)-n: Remove without updating /etc/mtab/

8. mknod Device file name [Bcp][major][minor]: Option parameter:

1) b: Set device as a peripheral storage device file, such as hard disk

2) C: Set the device name to become a peripheral input device file, such as mouse / keyboard, etc.

3) Set the device name to be a FIFO file.

9. e2label Appliance name new label Name: Change file system header name

10. tune2fs [-JLL] Device code: Convert file system type, Parameters:

1)-l: similar to dumpe2fs–h function, read the data in the superblock

2)-j: convert ext2 file system to ext3 file System

3)-l: similar to E2label function, can modify the file system label name

11. hdparm [-icdmxtt] Appliance Name: Adjust the hard disk parameters, only the interface for the IDE's hard disk function, parameters:

1)-I: Display the hard drive parameters detected by the core

2)-C: Set 32-bit access mode. This is the access mode that refers to the mode of transmission between the hard disk and the PCI interface, and the hard disk itself is still stored in the in-place mode.

3)-D: Set whether DMA modeis enabled,-d1 is enabled,-d0 is canceled

4)-M: Set the mode toread multiple sector synchronously , in general, setting this mode can reduce the performance of the system because of the loss of reading disk, however,WD 's hard disk is not recommended to set this value, in general, Set to 16/32 is optimized, however,the w/d recommended value is 4/8. This is worth the maximum value can be used hdparm–i/dev/had output maxmultsect to set, generally if not know, set up is more reasonable.

5)-x: Set the mode of UTRADMA, generally speaking,the UDMA mode value is set value, and, the hard disk and the motherboard chip must be synchronized, so, Take the smallest one, in general:

-MHz DMA mode 0~2(x64~66)

-MHz DMA Mode(x67~68)

5 MHz DMA mode

If your hard drive shows the UTA above, then set X69 is also good.

-T: Test The access performance of the staging area cache

- T : Test the actual access performance of the hard drive.


This article is from "Tiger Brother's Blog" blog, please be sure to keep this source http://7613577.blog.51cto.com/7603577/1592062

Linux Disk partitioning instructions

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.