Ubuntu 14.04 LTS 如何挂载硬盘
2016-08-17 18:14
323 查看
1.创建分区
Shell代码sudo fdisk /dev/sdb
Shell代码
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, 1000202273280 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
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.格式化硬盘
Shell代码sudo mkfs -t ext4 /dev/sdb
3.手动挂载
Shell代码sudo mount -vl -t ext4 /dev/sdb1 /opt/sync
4.开机自动挂载
Shell代码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.重启机器查看结果
Shell代码df -h
参考资料:http://blog.csdn.net/chief1985/article/details/4610345
相关文章推荐
- 小白技巧:如何从Ubuntu 14.04 LTS 升级到Ubuntu 14.10
- 如何在ubuntu 14.04LTS上(java8)安装Openfire服务器端
- Ubuntu 14.04 挂载 3TB 大硬盘问题
- ubuntu14.04挂载新的硬盘
- 如何在Ubuntu 14.04 LTS上安装MariaDB
- Ubuntu 14.04 LTS Server 无法挂载光盘 启动initramfs等问题
- 如何在ubuntu14.04LTS和12.04LTS上安装OpenJdk8
- Ubuntu 14.04 LTS设备挂载
- 适用小白:为什么要用Jupyter?以及,如何在Linux的Ubuntu 14.04LTS上安装和启动Jupyter Notebook
- 如何在Ubuntu 14.04 LTS上安装MariaDB
- 如何在Linux(Ubuntu 14.04 LTS)上安装搜狗拼音输入法
- 如何在Ubuntu Server 14.04 LTS(Trusty) 上安装Ghost
- 如何在Ubuntu 14.04 LTS之上设置Nginx Server Blocks(即虚拟主机)
- 如何在同一台计算机上安装Windows 8.1和Ubuntu 14.04 LTS
- 如何在Ubuntu 14.04 LTS上安装MariaDB
- ubuntu下使用fstab挂载硬盘时,属于root,如何把它改为属于一个用户的(如sgjm)
- 如何在Ubuntu 14.04 LTS安装网络爬虫工具:Scrapy
- Ubuntu 14.04挂载NTFS硬盘
- 【完整流程】Linux / Ubuntu 服务器 如何挂载 exfat 格式的 U盘 / 移动硬盘
- VMware WorkStation环境下Ubuntu14.04LTS系统如何进入unity模式