linux挂载新硬盘过程分享
本文导语: 代码如下:fdisk –l ----------------------------------------------------------------------------Disk /dev/sda: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x000af383 Device Boot Start End Blocks Id Syst...
fdisk –l
----------------------------------------------------------------------------
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000af383
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1244 9992398+ 83 Linux
/dev/sda2 1245 1305 489982+ 5 Extended
/dev/sda5 1245 1305 489951 82 Linux swap / Solaris
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a valid partition table
----------------------------------------------------------------------------
1
看到新增加的硬盘是/deb/sdb,但是还没有分区表
3. 分区
fdisk /dev/sdb
这时有很多选项,选择m
然后选择n
然后选择p
然后选择1
之后还有两个选项
First Cylinder(1-1014,default 1):
Last cylindet or +siza or +sizeM or +sizeK:
我均选择了默认,然后输入w,保存,退出
4. 格式化分区
sudo mkfs -t ext3 /dev/sdb1
5. 挂载分区
sudo mkdir /www // 创建新的挂载点,装matlab用
sudo mount /dev/sdb1 /www
sudo df
6. 开机自动挂载
vi /etc/fstab // 修改这个文件,或者用gedit都行
然后添加到末尾
dev/sdb1 /www ext3 defaults 1 2
这样开机,就可以挂载了www了!