免费注册 查看新帖 |

Chinaunix

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

在solaris下挂接iso镜像文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-12-22 19:29 |只看该作者 |倒序浏览
在solaris下挂接iso镜像文件
许多软件包下载下来时是iso格式的。ISO也可以通过cd-rom来生成。
# cat /dev/somecd > somename.iso
也可以使用dd命名来从cdrom光驱生成ISO文件
# dd if=/dev/cdrom of=/home/tubin/somename.iso bs=512
其中/dev/cdrom表示linux下的光驱设备,solaris下表示光驱的设备和这不一样,可以
通过df -h来查看。
在solairs下,可以使用lofiadm和mount这两个命令来挂接iso文件,这比把它刻成光盘来读取它方便多了。
假定有个iso文件在/home/tubin/software.iso,我们可以通过以下命令来创建一个loopback file
device。
# lofiadm -a /home/tubin/software.iso /dev/lofi/1
lofi设备创建了一个文件的块设备。这个块设备可以挂载在/mnt。
# mount -F hsfs -o ro /dev/lofi/1 /mnt
如果还有其他的ISO文件,可以依此类推:
# lofiadm -a /home/tubin/file2.iso /dev/lofi/2
# lofiadm -a /home/tubin/file3.iso /dev/lofi/3
等等。
原文如下:
Mounting an ISO image on Solaris
--------------------------------------------------------------------------------
Many software packages can be downloaded in the form of an ISO image. ISO images can also be created from CD and saved as ISO images:
$ cat /dev/somecd > somename.iso
Rather than burning the image to a CD-ROM to access its contents, it is easy to mount the image directly into the filesystem using the lofiadm and mount commands.
Given an ISO image in /export/temp/software.iso, a loopback file device (/dev/lofi/1) is created with the following command:
# lofiadm -a /export/temp/software.iso /dev/lofi/1
The lofi device creates a block device version of a file. This block device can be mounted to /mnt with the following command:
# mount -F hsfs -o ro /dev/lofi/1 /mnt
These commands can be combined into a single command:
# mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt
Other ISO images can be mounted by incrementing the lofi device:
# lofiadm -a /export/temp/software2.iso /dev/lofi/2
# lofiadm -a /export/temp/software3.iso /dev/lofi/3
etc.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7635/showart_62951.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP