有些时候centos Linux内核不存在raid卡的驱动,以前只能用软盘加载驱动,其实是还有其它方法的,只要找到官方相应的驱动,现在Raid卡的品牌很多,但是大部分独立raid卡为highpoint,3ware,adapter,lsi,promise等还有些是集成在主板上的,如果要制作带驱动的iso镜像光盘比较费时间费精力,要很熟悉ISO的目录结构,要把initrd.img文件加入驱动程序进去,然后封装起来,接下来介绍两种比较好的方法。
硬件型号为lsi 1064e集成raid卡
安装系统centos5.8 Linux
首先先介绍第一种方法:
第一种方法就是采用linux dd来加载驱动,首先准备一个读卡器和sd卡或者u盘
这里是打开u盘所看到的img文件
1g的U盘已经变成1.44m了。
加载光盘到boot: linux dd加载驱动
正在加载usb-storage driver驱动。
询问是否要加载驱动选择yes
选择sda设备usb设备都是被识别为scsi设备
是否要加载/dev/sda设备选择ok
是否要加载额外的驱动否
第二中方法:
利用linux nostorage
首先把u盘分区
[root@zh888 ~]# fdisk -l//查看所有分区和硬盘
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007103c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 524288 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 66 1371 10485760 83 Linux
/dev/sda3 1371 1632 2097152 82 Linux swap / Solaris
Disk /dev/sdb: 1000 MB, 1000341504 bytes//这是第二块u盘的信息为1g
31 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
Device Boot Start End Blocks Id System
[root@zh888 ~]# fdisk /dev/sdb//格式化第二块scsi设备u盘
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p//查看分区
Disk /dev/sdb: 1000 MB, 1000341504 bytes
31 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
Device Boot Start End Blocks Id System
Command (m for help): n//创建新分区new
Command action
e extended
p primary partition (1-4)
p//选择主分区类型
Partition number (1-4): 1//第一个主分区
First cylinder (1-1016, default 1): 回车
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1016, default 1016): 回车
Using default value 1016
Command (m for help): w//最重要的参数write写入保存退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@zh888 ~]# fdisk -l//接着查看分区
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007103c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 524288 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 66 1371 10485760 83 Linux
/dev/sda3 1371 1632 2097152 82 Linux swap / Solaris
Disk /dev/sdb: 1000 MB, 1000341504 bytes
31 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
Device Boot Start End Blocks Id System
/dev/sdb1 1 1016 976345 83 Linux//这里是查看sdb1分区但是没创建文件系统
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007103c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 524288 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 66 1371 10485760 83 Linux
/dev/sda3 1371 1632 2097152 82 Linux swap / Solaris
Disk /dev/sdb: 1000 MB, 1000341504 bytes//这是第二块u盘的信息为1g
31 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
Device Boot Start End Blocks Id System
[root@zh888 ~]# fdisk /dev/sdb//格式化第二块scsi设备u盘
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p//查看分区
Disk /dev/sdb: 1000 MB, 1000341504 bytes
31 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
Device Boot Start End Blocks Id System
Command (m for help): n//创建新分区new
Command action
e extended
p primary partition (1-4)
p//选择主分区类型
Partition number (1-4): 1//第一个主分区
First cylinder (1-1016, default 1): 回车
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1016, default 1016): 回车
Using default value 1016
Command (m for help): w//最重要的参数write写入保存退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@zh888 ~]# fdisk -l//接着查看分区
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007103c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 524288 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 66 1371 10485760 83 Linux
/dev/sda3 1371 1632 2097152 82 Linux swap / Solaris
Disk /dev/sdb: 1000 MB, 1000341504 bytes
31 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 1922 * 512 = 984064 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
Device Boot Start End Blocks Id System
/dev/sdb1 1 1016 976345 83 Linux//这里是查看sdb1分区但是没创建文件系统
[root@zh888 ~]# mkfs.vfat /dev/sdb1//格式化创建文件系统为vfat(fat32)格式,这个一定要在linux操作,在windows下格式化fat或者fat32都是无法识别的,会出现问题如下:
输入linux nostorage选择add device增加设备
选择usb mass storage driver for linux加载
出现选择设备驱动
以上按f2选择sdb设备也就是u盘设备
选择/dev/sdb1设备
选择你需要的lsi驱动程序按ok
加载lsi megasr driver 15.00多出来的驱动。
最后就可以识别到lsi raid卡了,还可以结合linux ks=http://ip/ks.cfg dd无人值守安装系统。
本文转自zh888 51CTO博客,原文链接:http://blog.51cto.com/zh888/867934,如需转载请自行联系原作者