1.创建分区
- Command (m for help):
- 这里按m获得帮助
- a toggle a bootable flag 将分区设置为启动区
- b edit bsd disklabel 编辑bsd的disklabel
- c toggle the dos compatibility flag 设置该分区为dos分区
- d delete a partition 删除分区
- l list known partition types 列出已知的分区类型
- m print this menu 打印帮助列表
- n add a new partition 创建新分区
- o create a new empty DOS partition table
- p print the partition table查看分区信息
- q quit without saving changes 退出不保存
- s create a new empty Sun disklabel
- t change a partition's system id改变分区类型
- u change display/entry units
- v verify the partition table
- w write table to disk and exit 保存退出
- x extra functionality (experts only)
- Command (m for help):p //查看新硬盘的分区
- ********************************************************************
- Disk /dev/sdb: 1000204 MB, 1000202273280 bytes
- 255 heads, 63 sectors/track, 121601 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- Command (m for help):n //创建新分区
- File system type (default ext2): ext3 //输入想使用的分区格式
- Partition name: backup //输入分区的名字
- First cylinder (default 0cyl): //第几个柱面,我们按照默认
- Last cylinder or +size or +sizeMB or +sizeKB (default 0cyl):+1000000M //这里我们按大小输入 即+1000000M (注意这个M为大写)
- Warning: You requested a partition from 0cyl to 121576cyl.
- The closest location we can manage is 1cyl to 121575cyl. Is this still
- acceptable to you?
- y Yes
- n No
- 当然是y
- Command (m for help): p //查看新硬盘分区后的情况
- Disk /dev/sdb: 1000 GB,248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> Device Boot Start End Blocks Id System
- /dev/sdb1 2 121576 976559157 83 Linux
- ******************************************************************
- Command (m for help): w
- Information: Don't forget to update /etc/fstab, if necessary. //写入硬盘分区属性并结束
2.格式化硬盘
sudo mkfs -t ext4 /dev/sdb
3.手动挂载
sudo mount -vl -t ext4 /dev/sdb1 /opt/sync
4.开机自动挂载
sudo vi /etc/fstab
<file system> <mount point> <type> <options> <dump> <pass>
/dev/sdb1 /opt/sync/ ext4 defaults 0 0
- Shell 代码
- sudo mount -a #及时生效
5.重启机器查看结果
df -h
参考资料:http://blog.csdn.net/chief1985/article/details/4610345
原文地址:https://blog.csdn.net/yilovexing
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。