linux认证:linux虚拟机添加硬盘Linux认证考试
文章作者 100test 发表时间 2009:10:30 16:41:09
来源 100Test.Com百考试题网
一.Linux的硬盘识别
2.6 kernel以后,linux会将识别到的硬件设备,在/dev/下建立相应的设备文件.如:
sda 表示第1块SCSI硬盘.
hda 表示第1块IDE硬盘(即连接在第1个IDE接口的Master口上).
scd0 表示第1个USB光驱.
当添加了新硬盘后,在/dev目录下会有相应的设备文件产生.cciss的硬盘是个例外,它的
设备文件在/dev/cciss/目录下.一般使用“fdisk -l”命令可以列出系统中当前连接的硬盘
设备和分区信息.新硬盘没有分区信息,则只显示硬盘大小信息.
二.在linux系统中添加新硬盘
下面说明一下,在GTES 11上,添加一块10G硬盘到第一个IDE口的Slave接口上.
安装好硬盘后,开机进入Turbolinux.以root身份登录.
执行fdisk -l命令显示当前系统的硬盘设备.
[root@g11-64-1 ~]# fdisk -l
Disk /dev/hda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 89 610470 82 Linux swap / Solaris
/dev/hda3 90 2610 20249932 83 Linux
Disk /dev/hdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/hdb doesn t contain a valid partition table
[root@g11-64-1 ~]#
显示hdb没有分区信息,大小为10G.
使用fdisk命令对hdb进行分区.
[root@g11-64-1 ~]# fdisk /dev/hdb
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 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)