- 论坛徽章:
- 0
|
制作方法同在Sparc上,需要解决的问题是:Solaris X86不认识Solaris SPARC的安装盘
解决此问题,垄共分以下三步:
1、将安装盘放到SPARC中,执行如下:
cd /cdrom
tar cvf /opt/cdrom1.tar cdrom0
cd /
eject cdrom
依次将需要的三张盘放入CD中打包
cd /cdrom
tar cvf /opt/cdrom2.tar cdrom0
cd /
eject cdrom
cd /cdrom
tar xvf /opt/cdrom3.tar cdrom0
2、将文件传到Vmware虚拟机中后解包即可
技巧:为了减少安装服务器所占硬盘空间的大小,请将SPARC介质释放到第二个硬盘中,安装结束后,删除这块硬盘,然后压缩Vmware的目录
如果你希望安装solaris操作系统的时候,系统不会问你一大堆问题而耽误你的时间,或者你想在系统塌掉以后,在很短的时间内做出一个全新的操作系统,或者只去敲入一条命令,所有的安装过程不再需要人为的干预,或者在你为经常的手动升级系统感到厌烦的话,那么就来跟着我一起配置一台jumpstart server吧,它能让你从繁重的安装或者升级的工作中解脱出来,而且还可以很灵活的安排安装和升级任务,它可以根据不同的情况,不同的机器,选择不同的安装或升级脚本。
1,原理
jumpstart方式安装需要下面四种服务
Boot services
Identification services
Configuration services
Installation services
以上四项服务可以分别由不同的机器来完成,要注意的是Boot server一定要和client在一个子网里,其他的倒不一定,一般情况下我习惯将他们做到同一个机器里。
Boot services为客户端提供启动服务,能够提供客户端的ip地址,hostname等启动参数,服务器要想提供boot services,下面的文件和目录必须要正确配置:
/etc/ethers
/etc/inet/hosts
/tftpboot(目录)
/etc/inet/inetd.conf
/etc/bootparams
/etc/dfs/dfstab
除了hosts和ethers文件外,其他的文件和目录可以由add_install_client工具来生成,该工具存在于solaris安装光盘的第一张光盘里。
hosts和ethers文件存储有客户端的主机名,MAC地址,ip地址,可以响应RARP查询,提供客户端的主机名和ip地址。
/tftpboot目录下面存储有对应于特定机型的启动文件,使用tftp协议传送给客户端,因此服务器要起tftp服务,所以inetd.conf里面的tftp服务前面的注释要去掉。
添加/tftpboot目录及下面的内容,以及修改inetd.conf文件都可以由add_install_client工具来完成。
bootparams文件指定client所需要的Root文件系统,以及安装所需要的config目录,install目录所在服务器的正确位置,以便正确mount到自己的本地。dfstab文件指定服务器要把那些目录给share出去,以便让client端mount到自己的本地使用,否则client是无法mount上去的,这要求服务器端要开nfs服务。
修改bootparams和dfstab文件也都可以有add_install_client工具来完成。
Identification Services响应client发出的identification查询请求,这些identification信息包括:网络信息,安全策略,nameserver,timezone,terminal type,时间取得方式,还有root的密码等,也就是当你手动安装时,需要回答的问题。可以以文件的形式提供,也可以使用NIS或NIS+服务提供,我习惯以
文件sysidcfg的形式。以文件形式提供时,要确保该文件所在目录已经share出去,保证client能够mount上。
我的sysidcfg文件如下:
#cat sysidcfg
network_interface=primary
{protocol_ipv6=no
netmask=255.255.255.0
default_route=192.168.1.1}
security_policy=none
name_service=NONE
timezone=Asia/Shanghai
system_locale=en_US
terminal=vt100
timeserver=localhost
root_password=W8Dhz34xImLI.
有关sysidcfg文件的关键字,以及取值请参考sun的文档:
http://docs.sun.com/app/docs/doc/806-5205/6je7vd5ra?a=view#indexterm-75
Configuration Services提供的信息包括:安装类型(初始化安装还是升级安装),系统类型(standalone,server),硬盘分区,文件系统,软件安装类型(Core,End Use,Developer,Entire Distribution,Entire Distribution plus OEM)以及不同的客户端采用的不同的安装配置脚本等。有rules文件和profiles文件决定。rules文件决定客户端的类型,决定客户端适用于那个安装配置文件。profiles文件是真正安装配置文件,决定系统如何安装,安装那些东西。rules文件就一个,而profiles文件由多个,由rules文件决定使用哪一个配置文件。
Installation Services最好理解,提供安装操作系统所需要的程序包,只需将光盘里的内容copy到硬盘里就行了。
2,具体步骤
步骤大概解释如下:
我的两台solaris机器,hostname分别为sun1和sun2,用sun2做jumpstart服务器,sun1做client。
在安装服务器的solaris操作系统(sun2)上新建一目录,我的是/jumpstart目录,下面建目录solaris9,以区别于其他solaris版本的jumpstart安装目录,在solaris9下面建两个目录install和config,也就是说两个目录分别是:
/jumpstart/solaris9/install
/jumpstart/solaris9/config
config目录用来存储sysidcfg文件,rules文件,profiles文件
install目录用来保存操作系统光盘复制过来的操作系统安装程序。
配置客户端启动需要的参数文件。最后将install和config两个目录share出去
详细步骤如下:
生成install server:
将光盘上的文件copy到硬盘上的/jumpstart/solaris9/install目录。
如果vold daemon没有起来,需要手动mount光驱,如果起来,就不需要,插入光驱就能用,vold是一个能够自动mount光驱和软驱的后台进程。
插入第一张光盘
#mkdir -m 755 /jumpstart/solaris9/install
#cd /cdrom/cdrom0/s0/Solaris_9/Tools
#./setup_install_server /jumpstart/solaris9/install
#cd /
#eject cdrom
插入第二张光盘
#cd /cdrom/cdrom0/Solaris_9/Tools
#./add_to_install_server /jumpstart/solaris9/install
#cd /
#eject cdrom
插入Lang光盘
#cd /cdrom/cdrom0/Tools
#./add_to_install_server /jumpstart/solaris9/install
#cd /
#eject
生成identification server:
我用的是文件方式,即sysidcfg文件,将sysidcfg保存到/jumpstart/solaris9/config目录下,定义的都是手动安装时需要输入的信息,可以避免再次手动输入,如果这里定义的信息不全,安装的时候还是会提示的。
#mkdir -m 755 /jumpstart/solaris9/config
#cd /jumpstart/solaris9/config
#vi sysidcfg
network_interface=primary
{protocol_ipv6=no
netmask=255.255.255.0
default_route=192.168.1.1}
security_policy=none
name_service=NONE
timezone=Asia/Shanghai
system_locale=en_US
terminal=vt100
timeserver=localhost
root_password=W8Dhz00xImLI.
root密码是从/etc/shadow中粘贴过来的。根据实际情况填写。
有关sysidcfg文件的更多内容请参考sun的文档:
http://docs.sun.com/app/docs/doc/806-5205/6je7vd5ra?a=view#indexterm-75
生成configuration server:
编辑rules文件和profiles文件,这里的profiles文件名一定要用rules文件里定义的名字
#cd /jumpstart/solaris9/config
#vi rules
hostname sun1 - profiles1 -
意思是:如果client的hostname是sun1,那么采用profiles1安装脚本。这里采用的是用hostname来区分不同client,如果有多个机器,每个机器占一行,可以使用不同的安装脚本。当然,如果机器非常多,也可以按机器类型,或者组别来分类。profiles1前后的两个-(dash),分别表示安装前后要执行的脚本。这里为空,用-(dash)表示。前面的执行脚本,一般配置安装前的环境变量,后面的脚本一般配置安装后对某些服务要做的修改。
rules文件的更详细的信息,请参考sun文档:
http://docs.sun.com/app/docs/doc/806-5205/6je7vd5tg?a=view
http://docs.sun.com/app/docs/doc/806-5205/6je7vd5v2?a=view
#vi profiles1
install_type initial_install
system_type standalone
partitioning explicit
filesys c0t2d0s0 1024 swap
filesys c0t2d0s1 free /
cluster SUNWCall
locale en_US
locale en_CA
locale ja_JP
locale zh_CN
locale zh_HK
locale zh_TW
意思是:执行初始化安装,将硬盘的1G空间分给swap,剩下的给/,执行的软件安装类型是:Entire Distribution,安装的语言包:英文,日语,中文。
profiles的更详细的说明,请参考:
http://docs.sun.com/app/docs/doc/806-5205/6je7vd5v3?a=view
rules和profiles文件配置完成后要用一个名为check的脚本来检验一下是否正确,如果错误,会提示那个地方出错,是什么错误,然后修改,直至不再有错误提示。
#cd /jumpstart/solaris9/install/Solaris_9/Misc/JumpStart_sample
#cp check /jumpstart/solaris9/config
#cd /jumpstart/solaris9/config
#./check
如果check完成后正确无误,会生成一个rules.ok文件,client在安装的时候读取的是rules.ok文件,而不是rules文件。
生成boot server:
#vi /etc/hosts
127.0.0.1 localhost
192.168.1.239 sun2 loghost
192.168.1.238 sun1 sun1.vst-china.com
#vi /etc/ethers
0:3:BA:35:7E:2C sun1
此两个文件的作用是:当客户端起来发起RARP查询和whoami查询的时候,服务器会根据发起RARP查询的MAC地址,查询ethers文件和hosts文件的记录返回给客户端hostname和ip地址,所以ethers文件要有client端的MAC地址对应的hostname,即sun1,hosts文件要有sun1对应的ip地址。
#cd /jumpstart/solaris9/install/Solaris_9/Tools
#./add_install_client \
-s sun2:/jumpstart/solaris9/install \
-c sun2:/jumpstart/solaris9/config \
-p sun2:/jumpstart/solaris9/config \
sun1 sun4u
add_install_client工具生成/tftpboot目录以及下面的文件。修改inetd.conf文件,生成bootparams文件,以及dfstab文件。
-s指定安装目录
-c指定sysidcfg目录
-p指定config目录
sun1是client的名字
sun4u是client的机器类型,具体是sun4u还是sun4m或者是其他的型号可以用下面命令查询:
#uname -m
add_install_client工具的详细说明请参考sun文档:
http://docs.sun.com/app/docs/doc/806-5205/6je7vd5s5?a=view
确保dfstab的内容正确
#vi /etc/dfs/dfstab
share -F nfs -o ro,anon=0 /jumpstart/solaris9/install
share -F nfs -o ro,anon=0 /jumpstart/solaris9/config
执行命令:
#shareall
#share
shareall命令可以将dfstab中指定的目录share出去,share命令可以查看share的状态。
3,执行client端安装
在sun1机器上,在ok状态执行:
ok>; boot net - install
然后就可以回家吃饭了,回来后,就可以看到一个全新的操作系统已经做好了。
[这个贴子最后由bear在 2002/06/13 04:45pm 编辑]
又被mmmmn“出卖”,不过也好,我也该发推荐贴了,箱子见底了:(
用途不太广泛,对有些需要的朋友有帮助的话就没白忙活:)
如果还有人说照着这个还装不出来的话!
我就!!!@#$^@$%^&#$%&$%&
==================================================================
Jumpstart安装实例(作者:bear)
一、正常用CD-ROM手工安装一台机器(以下称Install_sever),准备将其配置成Install Server
;
二、按照用户分配的IP地址、规划的hostname,和需要利用网络安装的主机的Ethernet Address
修改Server的/etc/hosts和/etc/ethers
例如:/etc/hosts中加入以下行
129.148.94.6 Client1
129.148.94.7 Client2
.
.
/etc/ethers中加入以下行
8:0:20:30:6:9a Client1
8:0:20:30:6:83 Client2
.
.
三、制作Solaris OS Image
1、在Install_sever的CD-ROM中放入Solaris 8 Software 1 of 2光盘
2、运行以下命令:
# cd /cdrom/cdrom0/s0/Solaris_8/Tools
# ./setup_install_server /export/install
(其中/export/install所在的分区必须有足够的空间,至少800M以上,建议1G
如果/分区空间不够,可选用其他目录,只要于以后使用该目录时保持一致即可
如可以使用/export/home/install)
3、等待程序运行完成以后,运行以下命令取出Solaris 8 Software 1 of 2光盘
并放入Solaris 8 Software 2 of 2光盘
# cd /
# eject
4、运行以下命令:
# cd /cdrom/cdrom0/Solaris_8/Tools
# ./add_to_install_server /export/install
5、等待程序运行完成以后,运行以下命令取出Solaris 8 Software 2 of 2光盘
并放入Solaris 8 Language 光盘
# cd /
# eject
6、运行以下命令:
# cd /cdrom/cdrom0/Tools
# ./add_to_install_server -s /export/install
按照系统提示选择"Simplified Chinese"(简体中文)选项,安装相应软件包
7、等待程序运行完成以后,运行以下命令取出Solaris 8 Language 光盘
# cd /
# eject
至此制作Solaris OS Image的工作完成
四、配置jumpstart相关信息
1、运行以下命令
# mkdir /jumpstart
# cp -r /export/install/Solaris_8/Misc/jumpstart_sample/* /jumpstart
2、用ftp将事先制作好的以下几个文件上传至/jumpstart中(ftp上传时请用ascii码格式)
(用vi看一下文件的内容,如果文本行结尾有多余的^M,请将文件中的^M全部删除,或用
命令dos2unix转换)
sysidcfg
rules
test_prof_18G
test_prof_36G
3、按照用户设置的netmask(网络掩码)修改sysidcfg文件中network_interface的相关参数
例如:
原条目:network_interface=primary {netmask=255.255.255.0 protocol_ipv6=no}
修改成:network_interface=primary {netmask=255.255.252.0 protocol_ipv6=no}
保存文件
4、运行以下命令:
# cd /jumpstart
# ./check; 具体每一个分区的信息(大小为兆字节)
filesys c0t0d0s6 2000 /usr - |
filesys c0t0d0s4 15 unnamed |
filesys c0t0d0s7 free /export/home -/
geo Asia#指定地理区域
locale zh#指定本地化语言包
isa_bits 64#计算位长(64 或32)
配置注意事项:
1、install_type 必须写在第1行
2、标记为容量为“free”的分区如“filesys c0t0d0s7 free /export/home -”
必须写在所有“filesys”定义的最后一个
test_prof_36G 文件内容
相应的解释与test_prof_18G 文件相同
区别只在“filesys”的分区大小定义不同
install_type initial_install
usedisk c0t0d0
boot_device c0t0d0s0 update
root_device c0t0d0s0
cluster SUNWCXall
system_type standalone
partitioning explicit
filesys c0t0d0s0 3000 / -
filesys c0t0d0s1 3000 /var -
filesys c0t0d0s3 3000 swap
filesys c0t0d0s5 5000 /opt -
filesys c0t0d0s6 3000 /usr -
filesys c0t0d0s4 15 unnamed
filesys c0t0d0s7 free /export/home -
geo Asia
locale zh
isa_bits 64
如果有其他特殊需求请参照:“Solaris 8 Advanced Installation Guide”
(Part Number:806–0957–10)
附例:JumpStart Install Server 安装过程:
附录1:实例安装记录
此例中:
JumpStart Install_Server的信息如下:
Hostame: jumptest
IP: 10.11.147.60
2个Install Client信息如下
Client1:
Hostame: test-1
IP: 10.11.147.38
Ethernet: 8:0:20:ce:ec:d6
c0t0d0: 18G
Client2:
Hostame: test-2
IP: 10.11.147.39
Ethernet: 8:0:20:ce:ec:ae
c0t0d0: 18G
root@jumptest # cd /cdrom/sol_8_sparc/s0/Solaris_8/Tools
root@jumptest # ./setup_install_server /export/home/install
Verifying target directory...
Calculating the required disk space for the Solaris_8 product
Copying the CD image to disk...
Install Server setup complete
root@jumptest # cd /
root@jumptest # eject
root@jumptest # cd /cdrom/sol_8_sparc_2/Solaris_8/Tools
root@jumptest # ./add_to_install_server /export/home/install
The following Products will be copied to /export/home/install/Solaris_8/Product:
Solaris_2_of_2
If only a subset of products is needed enter Control-C
and invoke ./add_to_install_server with the -s option.
Checking required disk space...
Copying the Early Access products...
41990 块
Processing completed successfully.
root@jumptest # cd /
root@jumptest # eject
root@jumptest # cd /cdrom/sol_8_lang_sparc/Tools
root@jumptest # ./add_to_install_server -s /export/install /export/home/install
Enter the number of the product(s) you want to add
to /export/home/install/Solaris_8/Product or 'all' for all products.
The following are valid products:
1Simplified_Chinese
2French
3German
4Italian
5Japanese
6Korean
7Spanish
8Swedish
9Traditional_Chinese
10shared
1
Checking required disk space...
Copying SimplifiedChinese packages...
Processing completed successfully.
root@jumptest # cd /
root@jumptest # eject
root@jumptest # cd /jumpstart
root@jumptest # ./check
Validating rules...
Validating profile test_prof_18G...
Validating profile test_prof_36G...
The custom JumpStart configuration is ok.
root@jumptest # ls
any_machine net924_sun4c rules sysidcfg x86-begin.conf
check test_prof_18G rules.ok upgrade x86-class
host_class test_prof_36G set_root_pw x86-begin
root@jumptest # /usr/lib/nfs/nfsd -a 16
root@jumptest # /usr/lib/nfs/mountd
root@jumptest # share /jumpstart
root@jumptest # shareall
root@jumptest # dfshares jumptest
RESOURCE SERVER ACCESS TRANSPORT
jumptest:/jumpstart jumptest - -
root@jumptest # cd /export/home/install/Solaris_8/Tools
root@jumptest # ./add_install_client -c jumptest:/jumpstart -p jumptest:/jumpstart test-1 sun4u
saving original /etc/dfs/dfstab in /etc/dfs/dfstab.orig
Adding "share -F nfs -o ro,anon=0 /export/home/install" to /etc/dfs/dfstab
updating /etc/bootparams
copying inetboot to /tftpboot
root@jumptest # ./add_install_client -c jumptest:/jumpstart -p jumptest:/jumpstart test-2 sun4u
updating /etc/bootparams
root@jumptest #
备注:例子中会有目录不同的情况
如不是/cdrom/cdrom0,而是/cdrom/sol_8_sparc/、/cdrom/sol_8_sparc_2
或/cdrom/sol_8_lang_sparc,其实/cdrom/cdrom0是指向这些目录的连接,没有问题
(bear:2002/6/13 下午于chinaunix.net)
jumpstart安装
----Installation services---------------------------------------------------------------------------
#mkdir /install
插入光盘soft1
#cd /cdrom/cdrom0/s0/solaris_9/tools
#./setup_install_server /install
#cd /
#eject
插入光盘soft2
#cd /cdrom/cdrom0/solaris_9/tools
#./add_to_install_server /install
#cd /
#eject
----------------------------------------------------------------------------------------------------
#cp /etc/nsswitch.file /etc/nsswitch.conf
#vi /etc/hosts
unix0 192.168.0.30
#vi /etc/ethers
mac地址 unix0
#vi /etc/dfs/dfstab
share -o ro,anon=0 /install
share -o ro /config
#/etc/init.d/nfs.server stop
#/etc/init.d/nfs.server start
#unshareall
#shareall
#share
- ro /config "" *配置文件所在目录
- ro,anon=0 /install "" *安装文件所在目录
#cd /config
#vi sysidcfg
system_local=en_US
timeserver=localhost
name_service=NONE
security_policy=NONE
network_interface=primary{protocol_ipv6=no netmask=255.255.255.0 \
default_route=192.168.0.1}
root_password=eA8g11uxwlb2k *密钥chrdw101
#cd /install/solaris_9/Misc/jun...samle/
#cp -r * /config
#cd /config
#vi rules
主机名 之前 生效配置 安装后
hostname unix0 - unix0-config after-unix0
#vi unix0-config
install_type initial_install
system_type standalone
partitioning explicit
cluster SUNWCall
filesys c0t0d0s0 3500 /
filesys c0t0d0s1 512 swap
. . . .
#vi after-unix0
touch /etc/a/noautoshutdown */etc/a为光盘目录,挂载c0t0d0s0
#./check *此操作产生rules.ok文件
#cd /install/solaris_9/Misc/Jumpstart
#./add_install_client -s unix3:/install -c unix3:/config -p unix3:/config unix0 sun4u
注:
-s 为安装服务(installation services) 在这里对应安装包路径
-c 为配置和身份验证服务(configuration services) 在这里对应sysidcfg文件所在目录
-p 为确认服务(identification services) 在这里对应rules.ok及相关文件所在目录
unix0 sun4u 分别为客户端主机名与主机板类型,在应用中通常要执行多次
-----------------------------------------------------------------------------------------------------------------
老师总结:
-------------unix6为server-----------unix3为client--------------------------
1 /config/sysidcfg
2 /config/rules(prlfile1,finish)
3 check ------> rules.OK
4 CD1: setup_install_server /install
5 CD2: add_to_install_server /install
6 /etc/hosts 192.168.0.33 unix3
7 /etc/dfs/dftab
share -F nfs -o ro,anon=0 /install
share -F nfs -o ro /config
8 /etc/init.d/nfs.server stop -------->start
9 unshareall--------->shareall
10 /install/solaris_9/Misc/Jumpstart/add_install_client -s unix6:/install -c unix6:/config \
-p unix6:/config unix3 sun4u
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10718/showart_92386.html |
|