Home > Computer Tutorials > Computer Knowledge > [Linux system] fdisk related partition commands.

[Linux system] fdisk related partition commands.

WBOY
Release: 2024-02-19 18:00:18
forward
908 people have browsed it

[Linux system] fdisk related partition commands.

fdisk is a commonly used Linux command line tool used to create, manage and modify disk partitions. The following are some commonly used
fdisk commands:

  1. Display disk partition information:

    fdisk -l
    Copy after login

    This command will display the partition information of all disks in the system.

  2. Select the disk to operate:

    fdisk /dev/sdX
    Copy after login

    Replace
    /dev/sdX with the actual disk device name to be operated, such as
    /dev/sda.

  3. Create new partition:

    n
    Copy after login

    This will guide you to create a new partition. Follow the prompts to enter the partition type, starting sector, size and other information.

  4. Delete partition:

    d
    Copy after login

    This will guide you to select the partition you want to delete. Follow the prompts to select the partition number to be deleted.

  5. Modify partition type:

    t
    Copy after login

    This will guide you to select the partition you want to modify the type of. Follow the prompts to select a partition number and new partition type.

  6. View partition information:

    p
    Copy after login

    This will display the partition information of the currently selected disk.

  7. Save and exit:

    w
    Copy after login

    This will save changes to the disk partition and exit
    fdisk.

Please note that
fdisk is a powerful tool, but please make sure you operate the disk partition very carefully before using it to avoid losing data. In addition, the above commands only provide some common
fdisk usage examples. You can view more detailed usage and options through the
man fdisk command.

The above is the detailed content of [Linux system] fdisk related partition commands.. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:mryunwei.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template