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/fstab
Write /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