- 论坛徽章:
- 0
|
\r\n各位老大:我第一次写这种东西,抛砖引玉,欢迎大家狠劲儿砸我。\r\n\r\n需要了解的命令:lofiadm(1M), mount(1M)\r\n必须使用root权限。\r\n比如说我有一个文件Winxp.ISO是一个标准的光盘映像文件,放置在/tmp下面。\r\n键入如下命令:\r\n# lofiadm -a /tmp/Winxp.ISO\r\n/dev/lofi/1\r\n#\r\n等到提示符出现就说明虚拟的设备点已经生成。系统所返回的是一个block device 为止,但是同时系统其实还提供了一个raw device在:/dev/rlofi/1\r\n对于raw device的操作,诸如fsck之类,必须对这个device 做才会有效。\r\n然后,\r\n# mkdir /mount_ISO\r\n# mount -F hsfs /dev/lofi/1 /mount_ISO\r\n\r\n到此为止你就可以在/mount_ISO下面像在光盘里面一样执行命令了。 \r\n\r\n\r\n删除设备:\r\n# umount /mount_ISO\r\n( 如果不成功,可以使用-f选项枪支卸载)\r\n# lofiadm -d /tmp/Winxp.ISO\r\n\r\n下面是相关的man页:\r\nlofi:\r\nDevices lofi(7D)\r\nNAME\r\n lofi - Loopback file driver\r\n\r\nDESCRIPTION\r\n The lofi file driver exports a file as a block device.\r\n Reads and writes to the block device are translated to reads\r\n and writes on the underlying file. This is useful when the\r\n file contains a file system image. Exporting it as a block\r\n device through the lofi file driver allows normal system\r\n utilities to operate on the image through the block device\r\n (like fstyp(1M)fsck(1M), and mount(1M). This is useful for\r\n accessing CD-ROM and FAT floppy images. See lofiadm(1M) for\r\n examples.\r\n\r\n File block device entries are contained in /dev/lofi, while\r\n /dev/rlofi contains the character (or raw) device entries.\r\n Entries are in the form of decimal numbers which are\r\n assigned through lofiadm(1M). When created, these device\r\n entries are owned by root, in group sys, and have permis-\r\n sions 0600. While ownership, group, and permission settings\r\n can be altered, there are possible ramifications. See\r\n lofiadm(1M) for more information.\r\n\r\nFILES\r\n /dev/lofictl\r\n Master control device\r\n\r\n /dev/lofi/n\r\n Block device for file n\r\n\r\n /dev/rlofi/n\r\n Character device for file n\r\n\r\n /kernel/drv/lofi\r\n 32-bit driver\r\n\r\n /kernel/drv/lofi.conf\r\n Driver configuration file. (Should not be altered.)\r\n\r\n /kernel/drv/sparcv9/lofi\r\n 64-bit driver\r\n\r\nATTRIBUTES\r\n See attributes(5) for descriptions of the following attri-\r\n butes:\r\n\r\nSunOS 5.8 Last change: 30 Jul 1999 1\r\n\r\n\r\nSEE ALSO\r\n lofiadm(1M), fsck(1M), fstyp(1M), mount(1M), newfs(1M),\r\n attributes(5)\r\n\r\nNOTES\r\n Just as you would not directly access a disk device that has\r\n mounted file systems, you should not access a file associ-\r\n ated with a block device except through the lofi file\r\n driver.\r\n\r\n For compatability purposes, a raw device is also exported\r\n along with the block device. For example, newfs(1M) requires\r\n one.\r\n\r\nhsfs:\r\n\r\nFile Systems hsfs(7FS)\r\n\r\n\r\n\r\nNAME\r\n hsfs - High Sierra & ISO 9660 CD-ROM file system\r\n\r\nDESCRIPTION\r\n HSFS is a file system type that allows users access to files\r\n on High Sierra or ISO 9660 format CD-ROM disks from within\r\n the SunOS operating system. Once mounted, a HSFS file system\r\n provides standard SunOS read-only file system operations and\r\n semantics. That is, users can read files and list files in\r\n a directory on a High Sierra or ISO 9660 CD-ROM, and appli-\r\n cations can use standard UNIX system calls on these files\r\n and directories.\r\n\r\n This file system also contains support for the Rock Ridge\r\n Extensions. If the extensions are contained on the CD-\r\n ROM, then the file system will provide all of the file sys-\r\n tem semantics and file types of UFS, except for writability\r\n and hard links. |
|