1 为什么要挂载
我们应该都知道,Linux里,没有C,D盘这样的概念,有的只有目录,一切都是以目录为标准。Linux将所有的硬件设备都当做文件来处理,因此当使用光驱等硬件设备时,必须将其挂载到系统中,只有这样Linux才能识别。
最基本的也是最上层的就是根目录(/),下面可以有很多目录,根目录里可以加载成一个硬盘分区,下面的任意目录,也可以加载另一个硬盘分区,正是因为这种组织方式,挂载必须挂载到某个特定的目录中。2 新建分区
2.1 添加硬盘
在服务器上新添加一块硬盘,重新启动,按F5进入开始做RAID,在此不做介绍。系统启动后通过fdisk查看所有分区信息。
<span style="font-size:12px;">[root@localhost ~]# fdisk -l
<span style="color:#ff0000;">Disk /dev/sdb: 599.9 GB, 599932844032 bytes</span>
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0xa70f5417
Disk /dev/sda: 300.0 GB, 299966445568 bytes
255 heads, 63 sectors/track, 36468 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk identifier: 0x00002b09
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 36469 292422656 8e Linux LVM
Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 30.0 GB, 29993467904 bytes
255 heads, 63 sectors/track, 3646 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_home: 215.8 GB, 215759192064 bytes
255 heads, 63 sectors/track, 26231 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk identifier: 0x00000000
</span>
通过查看,一块600GB的硬盘已添加成功。
2.2 分区操作
(1)显示帮助菜单,通过fdisk命令来为新的硬盘分区,通过fdisk命令查看,新的硬盘为/dev/sdb
<span style="font-size:12px;">[root@localhost ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x14c853e7.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be r