- 论坛徽章:
- 0
|
在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 |
|