银川网站推广3000元做网站

当前位置: 首页 > news >正文

银川网站推广,3000元做网站,新钥匙建站,成都网站建设哪便宜由于CentOS 5.5操作系统自身没有集成Logic MegaRAID SAS 1078驱动#xff0c;所以在标配有此类raid卡的服务器需要安装CentOS 5.5时#xff0c;需要我们用软驱或者U盘的方式来加载raid驱动#xff0c;进而完成系统的安装。针对此种情况#xff0c;本人突发奇想#xff0c;…     由于CentOS 5.5操作系统自身没有集成Logic MegaRAID SAS 1078驱动所以在标配有此类raid卡的服务器需要安装CentOS 5.5时需要我们用软驱或者U盘的方式来加载raid驱动进而完成系统的安装。针对此种情况本人突发奇想想自定制一套满足此类raid卡的CentOS 5.5系统盘此系统盘除了只需手动分区外由于分区会因业务的不同会有所变化故此处不定制其余所有要实现自动安装之目的而且需增加一些第三方的软件包与做一些系统安全方面的设置从而达到真正自动运维之目的为了这个梦想本人找遍谷歌与百度网上都能难找到一篇完全的教程与文档来实现我的这个想法。紧接着…下面就有了我自己艰难的定制之路。     在定制之前本人开始直接想尝试修改光盘根目录下的isolinux目录下的引导文件isolinux.cfg,直接在引导选项加入Logic MegaRAID SAS 1078卡的驱动文件megasr.img,即操作方式ddcdrom:/megasr.img文件可是事与愿违启动安装过程中提示让我们再次选择设备驱动器来加载第三方驱动故只有另辟蹊径重谋对策。考虑到系统安装识别驱动是靠initrd.img这个镜像来实现的需initrd.img这个文件解开把Logic MegaRAID SAS 1078 raid卡驱动文件中的.ko文件导入到initrd.img文件进行再次打包以实现系统的顺利安装同时为了实现安装好的系统顺利启动我们再次需要编辑ks.cfg这个kickstart文件将Logic MegaRAID SAS 1078 raid卡驱动文件中的.ko文件导入到/lib/modules/uname -r/updates/目录下mkinitrd重新制作initrd文件来实现安装后系统的引导具体步骤如下 1、挂载光驱 [rootlocalhost ]# mount /dev/cdrom /mnt  2、创建临时目录 [rootlocalhost ]# mkdir -p /root/iso/CentOS  3、提取安装好系统需要RPM包     正常安装好操作系统在/root目录下会有install.log文件这个就是操作系统安装RPM包的记录我们从这些记录中将所需的RPM包从/mnt/CentOS中复制到/root/iso/CentOS里面去这里我们编写脚本package.sh。 [rootlocalhost ]# vi package.sh  #!/bin/bashcd /rootawk /Installing/{print \(2} install.log | sed s/^[0-9]*://g package.txtDVD/mnt/CentOS PACKDIR/root/package.txt NEW_DVD/root/iso/CentOS/ while read LINEdocp \){DVD}/\({LINE}*.rpm /\){NEW_DVD} || echo $LINE dont cp…….done package.txtrm -f package.txt 运行package.sh脚本会筛选出我们需要的一些rpm包rpm包放置在我们定制系统盘的/root/iso目录下的CentOS目录中。 [rootlocalhost ]# sh package.sh  4、把原镜像除了CentOS目录外的文件全部复制至/root/iso目录下 [rootlocalhost ]# rsync -av –excludeCentOS /mnt/  /root/iso  5、解开initrd.img文件file /root/iso/isolinux/initrd.img查看是gzip文件 [rootlocalhost ]# mkdir /tmp/initrd   [rootlocalhost ]# cd /tmp/initrd   [rootlocalhost initrd]# gzip -dc /root/iso/isolinux/initrd.img | cpio -ivd   [rootlocalhost initrd]# cd modules   [rootlocalhost modules]# gzip -dc modules.cgz | cpio -ivd  modules子目录中的modules.cgz是经过gzip压缩过的cpio包将其解开。 6、解压Logic MegaRAID SAS 1078 raid卡驱动文件megasr.img文件这里以附件的形式上传到博文后面请自行解压导入 [rootlocalhost modules]# mkdir /tmp/megasr  [rootlocalhost modules]# mount -o loop /root/megasr.img /media   [rootlocalhost modules]# cp /media/*  /tmp/megasr   [rootlocalhost modules]# cd /tmp/megasr/   [rootlocalhost megasr]# gzip -dc modules.cgz | cpio -ivd   [rootlocalhost megasr]# cp 2.6.18-194.el5/megasr.ko /tmp/initrd/modules/2.6.18-194.el5/x86_64/   [rootlocalhost megasr]# cat modules.alias  /tmp/initrd/modules/modules.alias   mkdir /tmp/megasr   7、生成新的initrd.img文件    就像我们以前所做的修改了源码包中的内容就势必再次打包恢复这里我们需要把修改过的内容打包成一个initrd.img文件不过这里要注意打包时的压缩格式modules.cgz文件用的是crc格式而initrd.img文件用的是newc格式命令参数不要弄错。 [rootlocalhost megasr]# cd /tmp/initrd/modules   [rootlocalhost modules]# find 2.6.18-53.el5 | cpio -o -H crc | gzip -9  modules.cgz   [rootlocalhost modules]# rm -rf 2.6.18-53.el5   [rootlocalhost modules]# cd ..   [rootlocalhost initrd]# find . | cpio -o -H newc | gzip -9  /tmp/initrd.img  8、将打包好的initrd.img文件复制到 /root/iso/isolinux 目录 [rootlocalhost initrd]# cp /tmp/initrd.img /root/iso/isolinux  9、上述第3步操作中在/root/iso/CentOS目录下的软件包仅是我们定制的一些系统自带的rpm软件包除此之外我们还需要增加一些系统不自带的软件包如MegaCli与nload并且禁止了ipv6协议。其中MegaCli-2.00.15-1.i386.rpm与nload-0.7.4.tar.gz软件包详见博文后面的nload与MegaCli工具附件请自行解压开来上传到服务器上 [rootlocalhost initrd]# cd   [rootlocalhost ]# mkdir /root/iso/Custom   [rootlocalhost ]# cp MegaCli-2.00.15-1.i386.rpm /root/iso/CentOS   [rootlocalhost ]# cp /tmp/megasr/2.6.18-194.el5/megasr.ko /root/iso/Custom   [rootlocalhost ~]# cp nload-0.7.4.tar.gz /root/iso/Custom    10、安装上述定制的软件包我们需要配置ks.cfg文件具体ks.cfg的配置文件如下   [rootlocalhost ]# cd /root/iso [rootlocalhost iso]# vi ks.cfg # Kickstart file automatically generated by anaconda. install cdrom lang en_US.UTF-8 langsupport –defaulten_AU.UTF-8 en_US.UTF-8 zh_CN.UTF-8 zh_HK.UTF-8 zh_CN.UTF-8 zh_SG.UTF-8 zh_TW.UTF-8 en_AU.UTF-8 keyboard us # Network information network –deviceeth0 –bootprotodhcp –onbooton rootpw 123456. authconfig –enableshadow –enablemd5 firewall –disabled selinux –disabled timezone Asia/Shanghai bootloader –locationmbr # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work clearpart –all –drivessda # part /boot –fstype ext3 –size200 # part swap –size8196 # part / –fstype ext3 –size50000 # part /movies –fstype ext3 –size100 –grow # Reboot after installation reboot %packages base chinese-support core development-libs development-tools dialup editors ftp-server legacy-network-server legacy-software-development legacy-software-support server-cfg system-tools text-internet keyutils trousers fipscheck device-mapper-multipath perl-Convert-ASN1 imake lsscsi audit net-snmp-utils sysstat iptraf dstat expect MegaCli gfs-utils gfs2-utils OpenIPMI-tools %post –nochroot # 挂载光驱 mkdir -p /mnt/cdrom mount -r -t iso9660 /tmp/cdrom /mnt/cdrom # 拷贝Logic MegaRAID SAS 1078 raid卡驱动文件到系统驱动目录下 cp /mnt/cdrom/Custom/megasr.ko /mnt/sysp_w_picpath/lib/modules/2.6.18-194.el5/updates/ # 拷贝自定制的第三方软件包 cp /mnt/cdrom/Custom/nload-0.7.4.tar.gz /mnt/sysp_w_picpath/tmp/nload-0.7.4.tar.gz /dev/null # 解压自定制的第三方软件包 cd /mnt/sysp_w_picpath/tmp tar -zxvf nload-0.7.4.tar.gz /dev/null # 卸载光驱 umount /mnt/cdrom %post # 使安装后的系统支持Logic MegaRAID SAS 1078 raid上的磁盘 echo alias scsi_hostadapter megasr /etc/modprobe.conf depmod -v 2.6.18-194.el5 mv /boot/initrd-2.6.18-194.el5.img /boot/initrd-2.6.18-194.el5.img.bak mkinitrd –withmegasr /boot/initrd-2.6.18-194.el5.img 2.6.18-194.el5 # 安装自定制软件 cd /tmp/nload-0.7.4 ./configure /dev/null 21 make /dev/null 21 make install /dev/null 21 rm -rf /tmp/* /dev/null 21 # 禁止ipv6协议 echo alias ipv6 off /etc/modprobe.conf echo alias net-pf-10 off /etc/modprobe.conf # 停止一些不常用的系统服务 for service in NetworkManager NetworkManagerDispatcher acpid anacron apmd atd auditd autofs bluetooth conman cpuspeed cups dc_client dc_server dhcdbd dund firstboot gpm haldaemon hidd ip6tables irda irqbalance lm_sensors lvm2-monitor mcstrans mdmonitor mdmpd messagebus microcode_ctl netconsole netfs netplugd nfslock nscd ntpd pand pcscd portmap psacct rdisc readahead_early readahead_later restorecond rhnsd rpcgssd rpcidmapd rpcsvcgssd saslauthd smartd snmptrapd wpa_supplicant ypbind do chkconfig –level 35 \(service off done # 开启一些常用的系统服务 for service in ipmi crond do chkconfig --level 35 \)service on done # 系统安装完成弹出光驱 eject 11、为了使用系统安装按照ks.cfg文件来执行安装编辑/root/iso/isolinux目录下的isolinux.cfg文件如下 [rootlocalhost iso]# cd /root/iso/isolinux/  [rootlocalhost isolinux]# vi isolinux.cfg    default kickstart  prompt 1  timeout 60  display boot.msg  F1 boot.msg  F2 options.msg  F3 general.msg  F4 param.msg  F5 rescue.msg  label linux    kernel vmlinuz    append initrdinitrdinitrd.img  label text    kernel vmlinuz    append initrdinitrdinitrd.img text  label ks    kernel vmlinuz    append ks initrdinitrdinitrd.img  label local    localboot 1  label memtest86    kernel memtest    append -  label kickstart  kernel vmlinuz  append text initrdinitrdinitrd.img kscdrom:/ks.cfg ramdisk_size16384 ksdeviceeth0 consoletty0  12、生成comps.xml文件 [rootlocalhost isolinux]# cd ..   [rootlocalhost iso]# createrepo -g repodata/*comps.xml /root/iso/  13、制作自定制CentOS 5.5系统镜像 [rootlocalhost iso]# mkisofs -o /root/CentOS-5.5-x86_64-bin-DVD.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /root/iso/      好了这样在root根目录下就生成了我们制作的系统镜像CentOS-5.5-x86_64-bin-DVD.iso到此为止这样一个集成Logic MegaRAID SAS 1078 raid卡的CentOS 5.5系统盘已经定制完成了,下载下来刻盘就可以安装了~~   转载于:https://blog.51cto.com/tamenglang/866293