Linux notes: File System Management-fdisk partition

Source: Internet
Author: User

The FDISK command partitioning process:

1. Add a new hard drive

2. View the new drive:

Fdisk-l

3. Use the FDISK command partition:

Fdisk hard drive device file name (e.g. Fdisk/dev/sdb)

Fdisk Interactive instruction Description:

4. Re-read the partition table information (must be restarted if not in effect):

Partprobe

5. Format the partition:

Mkfs-t EXT4/DEV/SDB1

6. Set up the mount point and mount it:

7. Automatic Partition mount:

Because FDISK partitions are mounted manually using the Mount command, each restart of the machine will fail. So we need to mount the partition automatically, that is, to write a configuration file/etc/fstab

Use the Mount-a Auto mount command to automatically mount the configuration file to test that the configuration file is correctly written to prevent the system from crashing.

8. If the configuration file is wrong, the Fstab file must be repaired to start properly, and the configuration file cannot be modified until the root directory is re-read or written before repair:

9. Allocate the SWAP partition:

The process of creating a new swap partition is to create a new normal partition and then change the partition ID to 82, which is the swap partition:

To format a swap partition:

Add a swap partition (similar to a normal partition) and cancel the swap partition:

Swap partition boot automatically mount:

Linux notes: File System Management-fdisk partition

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.