linux mount hard disk

 

fdisk -l command to view disk information

 

fdisk /dev/sdb to partition

 

According to the prompt,

Command (m for help): n
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):
Using default value 209715199
Command (m for help): w

Re-view disk partition fdisk -l
to format mkfs -t ext4 /dev/vdb1

Mount the disk to the specified directory mount /dev/vdb1 /usr/local/

Autostart: /etc/fstab add the line /dev/vdb1 /usr/local ext4 defaults 1 2

Finished: You can refer to http://blog.chinaunix.net/uid-25829053-id-3067619.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326442451&siteId=291194637