Linux HDD format, partition, mount, uninstall, delete partition

Source: Internet
Author: User

Linux HDD format, partition, mount, uninstall, delete partition

After Linux 2.6 kernel, Linux will identify the hardware devices and set up the corresponding device files under/dev/. For example:

SDA indicates a 1th SCSI drive

HDA represents the 1th IDE hard disk (that is, connected to the master port on the 1th IDE interface)

The scd0 represents a 1th USB drive.

0. View Mount Status

df -hl

See the system is only mounted 40G/dev/vda1 in/directory, respectively, to the different folders

1. View hard Drive information

fdisk -l

There is a 20G/dev/vdb unpartitioned

2. Create a partition

fdisk /dev/vdb

In turn, entern , p , 1 , 回车 , 回车 , wq , 回车

N: Create a new partition
P: Select Primary partition
1:partition number
WQ: Save and exit

3. View disk Information

fdisk -l

See disks that are already partitioned/dev/vdb1

4. Formatting partitions

mkfs.ext4 /dev/vdb1

If you want to format it as a different format, you can

5. Write the partition information to the Fstab, set the boot auto mount

vim /etc/fstabWrite /dev/xvdb1 /data ext4 defaults 0 0 Save and exit

6. Mount Partitions

mount -a

7. View the partition Mount situation

8. Lifting the Mount

umount /dev/vdb1

9. Deleting a partition

fdisk /dev/vdb

Inputd , wq

D: Delete partition

10. Check Again

Discovery has become an unpartitioned state

Linux HDD format, partition, mount, uninstall, delete 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.