Linux------Disk Partitioning, formatting, checking and mounting

Source: Internet
Author: User

1.

If you have a hard drive installed, you should do something to him

(1) to partition the disk, create a new available partition

(2) partition format, create file system

(3) Inspection file system

(4) Create mount point (directory), mount file system to directory

View disk Capacity: DF

View directory Capacity: Du

Disk partitioning: Fdisk 1. Only root can perform 2. Only disk partitions below 2TB can be processed 3. If the partition is in use and the partition table cannot be read, unmount the partition, enter the partition again, and write to the partition table.

Required after partitioning; Partprobe forcing the kernel to look up the partition table

2. Disk formatting: (Create file system)

General use: mkfs-t ext3 device file name

The MKFS (make file systm) Composite command calls different commands according to the parameters to see the callable commands with MKFS [tab][tab]

MKFS-T file system format device file name

For special Needs:

MKE2FS: (Make ext2 file system)

MKE2FS [-B Block Size] [-i inode size] [-l volume label] [-CJ] Device file name

-C Test Quick Read

-c-c test Reading and writing

-j into ext3 mode (with log file)

3. Disk inspection;

Used to verify file system errors

(1) fsck;

Perform fsck needs to unload the partition if the system has a problem he will put the file in the Lost+found directory

(2) To verify that the hard drive or floppy disk has a bad track

BADBLOCKS-SVW Device files

4. Disk Mount

A mount point is a directory, which is the entry into the disk partition (file system).

Attention:

Single file system cannot be repeatedly mounted to different mount points (separate file system is an area separately)

A directory should not repeatedly mount multiple directories (a directory can only be a portal to a filesystem, only the last file System entry)

mount point directory is empty directory (not empty, the files inside will be temporarily hidden, wait until the uninstall directory will automatically come out)

Mount

Mount-l Viewing mounted devices

Mount device name/volume label directory

To mount the root directory again:

Mount-o Remount,rw,auto/

The directory can be mounted in addition to the mounted file system

Mount--bind A B

Mount B on A, a, a, and a to the entrance of a.

Unloading:

Umount [-FN] mount point (directory name)

-F Forced uninstallation

-N Do not update the/etc/mtab file

Linux------Disk Partitioning, formatting, checking and mounting

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.