***********************************************声明************************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
*****************************************************************************************************
*****************************************************************************************************
Linux硬盘分区(一):添加*****************************************************************************************************
*************************
过程简述
*************************
--添加磁盘
# fdisk -l --查看磁盘情况
# fdisk /dev/sdb --为/dev/sdb设备分区
n --添加分区
p/e --主分区/逻辑分区
w --保存退出
# mkdir /data --创建挂载目录
# mkfs.ext3 /dev/sdb --格式化磁盘为ext3文件系统
# fdisk -l --再次查看磁盘情况
# mount /dev/sdb /data --挂载磁盘到创建的挂载目录下
# vi /etc/fstab --修改启动自动挂载项
/dev/sdb /data ext3 defaults 0 0
*************************说明
*************************
1、以上操作为精炼总结,若如可以看懂,下面内容无需浏览;
2、以下简单列举两例,细化操作过程。
*****************************************************************************************************
举例1:添加1块90G磁盘,将其分为1个分区
******************************************************************************************************************************
查看磁盘情况
*************************
[root@hyldb /]# fdisk -l
Disk /dev/sda: 128.8 GB, 128849018880 bytes
255 heads, 63 sectors/track, 15665 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 514048+ 83 Linux
/dev/sda2 65 586 4192965 82 Linux swap / Solaris
/dev/sda3 587 15665 121122067+ 83 Linux
Disk /dev/sdb: 96.6 GB, 96636764160 bytes
255 heads, 63 sectors/track, 11748 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
*************************磁盘分区
*************************
[root@hyldb /]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 11748.
There is nothing wrong with that, but this is l