ls /dev/sd*
查看硬盘及硬盘分区
fdisk /dev/sdc
Select (default p): p
Partition number (1-4, default 1): (直接按下 enter)
First sector (2048-167772159, default 2048): (直接按下 enter)
Last sector, +sectors or +size {K,M,G} (2048-167772159, default 167772159): (直接按下 enter)
Command (m for help): w
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition 注:这是删除一个分区的动作;
l list known partition types 注:l 是列出分区类型,以供我们设置相应分区的类型;
m print this menu 注:m 是列出帮助信息;
n add a new partition 注:添加一个分区;
o create a new empty DOS partition table
p print the partition table 注:p 列出分区表;
q quit without saving changes 注:不保存退出;
s create a new empty Sun disklabel
t change a partition's system id 注:t 改变分区类型;
u change display/entry units
v verify the partition table
w write table to disk and exit 注:把分区表写入硬盘并退出;
x extra functionality (experts only) 注:扩展应用,专家功能;
mkdir -p /mnt/sd*1
echo /dev/sd*1 /mnt/sd*1 ext4 defaults 1 2 >> /etc/fstab