Linux disk Partitions fdisk command usage instructions

Source: Internet
Author: User


1.FDISK-L View partition information

Enter the Fdisk interactive interface
M View Help
L View the file system number and name
N New Partition
D Delete Partitions
P View partition table (partition information)
t change the partition file system type
Q Do not save exit
W Save exit


First step: Partition

Second cloth: Update the partition table
Partprobe/dev/sdb REDHAT5 Scan Hard Drive
Partx-a/dev/sdb redhat6 (reboot if not possible)
Step three: Format the file system
MKFS.EXT4/DEV/SDA5 format into EXT4 format file system
Mkisofs-o test.iso-r./

Fourth Step: Mount
Mount-a Automatic Mount

NFSG-3G (software) Mounts NTFS system files

Mount-o ro/dev/sdb1/mnt Mount, read only
Mount-o remount/dev/sdb1/mnt Mount File system

Mount-o Loop etc.iso/mnt Mount mirrored file

Fifth Step: Modify the configuration file, restart effective
Vim/etc/fstab

Cat/etc/redhat-release View Linux Version

E2LABEL/DEV/SDA1 View Partition Alias
e2label/dev/sda1 haha set partition alias

Blkid View Partition UID

Instance:
[Root@localhost ~]# FDISK/DEV/HDD

Press the "P" key to print the partition table

This piece of hard magnetism has not been partitioned
Press the "n" key to create a new partition.

Two menu e indicates an extended partition, p represents the primary partition
Press the "P" key to prompt: "Partition number (1-4):" Select Primary Partition No.
Enter "1" to represent the first primary partition.

Press ENTER directly to represent the 1 cylinder start partition.

Tip the last cylinder or size.
Enter +5620m Press ENTER
Indicates that the first partition is 5G space.
Press "P" to view the partitions



Such a primary partition is divided.
Next, divide the second primary partition and give the rest to the second primary partition.
Press "n"
Key Add a partition
Press the "P" key to set the primary partition
Enter "2" to set the primary partition number to 2
Press the two-carriage return to divide the remaining space into the second primary partition.
Press the "P" key to print the partition table


Press the "W" Key to save the exit.
The reader can divide the appropriate partitions according to their hard disk size.

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.