Linux uses the FDISK command to manipulate the hard disk

Source: Internet
Author: User

Knowledge Points:

Mbr:master boot record master boot recorded on hard disk 0 cylinder 0 head of the first sector, accounting for 512 bytes (3 part of the Master Boot program 446 bytes, hard disk partition table Dpt[disk partion table]16*4 Bytes, partition valid flag 55AA has 2 bytes) , so the maximum manageable 2T hard drive.

Steps to add a hard disk:

Add device--partition--format (create file system)--name--Modify configuration file (/etc/tab)--Create mount point-mount

Fdisk-l #查看磁盘信息

Fdisk/deb/sdb #管理分区

M Get help

P Print Partition Table

N New

P Primary partition E extends #在MBR such that there is only one extended partition in the partitioned table, up to 4 primary partitions

Q exit

D Delete

W Save

Format command:

Mkfs.ext3/dev/sdb1

Mkfs.ext4/dev/sdb2

Mount command: (The U-disk and ISO file mount commands are slightly different to add parameters)

Mount/dev/sdb1/opt/sdb1

View: Df-h

Unload mount point: umount/opt/sdb1 behind and mount points and partitions can be

Disk volume Label: (If you use/dev/sdb to mount, when the server disk data line swap disk may be a problem, the volume label will not)

E2lable/dev/sdb #查看卷标

E2lable/dev/sdb Softdisk #把这个磁盘卷标设置为softdisk

Automatic Mount via volume label:

Modify configuration file: Vim/etc/fstab

The inside can be mounted with UUID, volume label mount, and device name Mount

/dev/sdb/sdb EXT4 Defaults 0 0

Lable=softdisk/sdb EXT4 Defaults 0 0

To mount the partition mount point format Mount option whether to back up (0 no backup) Start check (0 not checked)

Test Mount Success Mount-a (check/etc/fstab configuration is correct)

Other:

Motherboard with Blos and EFI two interface

Linux uses the FDISK command to manipulate the hard disk

Related Article

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.