免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1234 | 回复: 1
打印 上一主题 下一主题

从Solaris 9 ISO中得到slice1的数据 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-19 16:27 |只看该作者 |倒序浏览
如何从Solaris 9 ISO中得到slice1的数据

In order to setup a Jumpstart server using the Solaris 9 CD's you need to have access to both slice 0 and slice 1 on the CDs. If you're using a physical CD then thats not a problem (经测试如用安装在X86架构上的solaris系统也只能读出CD的slice 0, 只有在sparc架构上才能读取CD的slice0 & slice1)- vold will automatically mount both of the required slices for you, or if you're not using vold you can mount them manually yourself.

However, if you're trying to use an ISO image, mounted using the "lofi" driver, then you've got a problem as lofi is not VTOC aware, which in short means that it has no way of knowing that slice 1 even exists, let alone being able to access it.

In order to fix this you need to split the contents of slice 1 into it's own image file that you can then point lofiadm at. The procedure for doing this is described below...

I'm presuming you've already download the ISO images for Solaris 9, which means you should already have two files which look something like the following :


代碼:
# ls -l sol-9*
-rw-r--r--   1 root     root     576364544 Jan  1 11:16 sol-9-u1-sparc-v1.iso
-rw-r--r--   1 root     root     291962880 Jan  1 21:42 sol-9-u1-sparc-v2.iso

(The exact names and sizes will vary, depending on where you got the files from, and what version of Solaris 9 they are).
The only one we are interested in is the first image - "CD 1 of 2".

Firstly we need to get a copy of the VTOC (Virtual Table of Contents) from the ISO image. We do this with :


代碼:
# dd if=sol-9-u1-sparc-v1.iso of=vtoc bs=512 count=1
1+0 records in
1+0 records out

Now that we've got the VTOC we need to find out where Slice 1 start in the image, and how long it is. The starting cylinder for slice 1 is located at offset 452 (decimal) into the VTOC, whilst the length in blocks is at offset 456, with both being 4 bytes long. Thus we can find them out using :

代碼:
# od -D -j 452 -N 8 < vtoc
0000000 0000000888 0000546560
0000010

So slice 1 starts on cylinder 888, and is 546,560 blocks long. Solaris CD's always have a fixed 640 blocks per cylinder, which means that we can calculate the starting block of slice 1 with :

代碼:
# echo 888*640 | bc
568320

So slice one starts at block 568320, and is 546560 blocks long.
We can then take a copy of this slice into a separate file with :


代碼:
# dd if=sol-9-u1-sparc-v1.iso of=sol-9-u1-sparc-v1-s1 bs=512 skip=568320 count=546560
546560+0 records in
546560+0 records out

Once we've got this, we just need to mount both slice 0 (ie, the original ISO) and slice 1. The setup_install_server script expects to find these two mounted beside each other, with slice 1 in a directory called "s1" (as vold does it), although you can mount them wherever you want and just use the "-t" option to setup_install_server.

代碼:
# mkdir /cd
# mkdir /cd/s0
# mkdir /cd/s1
# lofiadm -a /path/to/sol-9-u1-sparc-v1.iso
/dev/lofi/1
# lofiadm -a /path/to/sol-9-u1-sparc-v1-s1.iso
/dev/lofi/2

When mounting slice 1 we need to remember that it is a UFS partition, not HSFS like you'd normally expect on a CD-ROM.

代碼:
# mount -F hsfs -o ro /dev/lofi/1 /cd/s0
# mount -F ufs -o ro /dev/lofi/2 /cd/s1
# cd /cd/s0/Solaris_9/Tools/
# ./setup_install_server  dest_dir

If you get an error "ERROR: Copy of CD image failed", then check your messages file for an entry like "NOTICE: hsfs: hsnode table full, 356 nodes allocated" then you need to apply patch 109764-03 or later.

[ 本帖最后由 spooky 于 2006-9-19 16:58 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-09-19 16:27 |只看该作者
使用Linux系统的方法(其他步骤同上)

1. 查看slice 1信息
代碼:
# fdisk -l /dev/cdrom

Disk /dev/cdrom (Sun disk label): 1 heads, 640 sectors, 2048 cylinders
Units = cylinders of 640 * 512 bytes

     Device Flag    Start       End    Blocks   Id  System
/dev/cdrom1   r         0       951    304320    4  SunOS usr
/dev/cdrom2   r       951      1879    296960    2  SunOS root
/dev/cdrom3          1879      1887      2560    0  Empty
/dev/cdrom4          1887      1895      2560    0  Empty
/dev/cdrom5          1895      1903      2560    0  Empty
/dev/cdrom6          1903      1911      2560    0  Empty


2. 计算offset及其slice 1的长度值
offset = 951 * 640 = 608640
count = (1879 - 851) * 640 = 657920

3. 导出slice1 ISO文件
代碼:
#dd if=/dev/cdrom of=sol-9-s1.iso bs=512 skip=608640 count=657920
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP