Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7611815
  • 博文数量: 1769
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16352
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1769)

文章存档

2024年(15)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类:

2006-04-26 13:44:41

用的命令是:
lofiadm -a /data/sybase10.iso /dev/lofi/1
mount -F hsfs -o ro /dev/lofi/1 /mnt
cd /mnt
 
Example 1: Mounting an existing CD-ROM image
     You should ensure that Solaris understands the image  before creating  the CD. lofi allows you to mount the image and see if it works.
     This example mounts an existing CD-ROM image (sparc.iso), of the  Red  Hat 6.0 CD which was downloaded from the Internet.
     It was created with the mkisofs utility from the Internet.
     Use lofiadm to attach a block device to it:
     # lofiadm -a /home/mike_s/RH6.0/sparc.iso  /dev/lofi/1
     lofiadm picks the device and prints the device name  to  the standard  output.  You  can run lofiadm again by issuing the following command:
     # lofiadm
     Block Device     File
     /dev/lofi/1      /home/mike_s/RH6.0/sparc.iso
     Or, you can give it one name and ask for the other, by issu-ing the following command:
     # lofiadm /dev/lofi/1
     /home/mike_s/RH6.0/sparc.iso
     Use the mount command to mount the image:
     # mount -F hsfs -o ro /dev/lofi/1 /mnt
     Check to ensure that Solaris understands the image:
     # df -k /mnt
     Filesystem            kbytes    used   avail capacity  Mounted on
     /dev/lofi/1           512418  512418       0   100%    /mnt
SunOS 5.8           Last change: 25 Aug 1999                    2
Maintenance Commands                                  lofiadm(1M)
     # ls /mnt
     ./            RedHat/       doc/          ls-lR         rr_moved/
     ../           TRANS.TBL     dosutils/     ls-lR.gz      sbin@
     .buildlog     bin@          etc@          misc/         tmp/
     COPYING       boot/         images/       mnt/          usr@
     README        boot.cat*     kernels/      modules/
     RPM-PGP-KEY   dev@          lib@          proc/
     Solaris can mount  the  CD-ROM  image,  and  understand  the filenames.  The  image was created properly, and you can now create the CD-ROM with confidence.
     As a final step, unmount and detach the images:
     # umount /mnt
     # lofiadm -d /dev/lofi/1
     # lofiadm

     Block Device             File
     Example 2: Mounting a floppy image
     This is similar to Example 1.
     Using lofi to help  you  mount  files  that  contain  floppy images  is helpful if a floppy disk contains a file that you need, but the machine which you're on doesn't have a  floppy drive. It is also helpful if you don't want to take the time to use the dd command to copy the image to a floppy.
     This is an example of getting to MDB floppy for Solaris x86:
     # lofiadm -a /export/s28/MDB_s28x_wos/latest/boot.3 /dev/lofi/1
     # mount -F pcfs /dev/lofi/1 /mnt
     # ls /mnt
     ./            COMMENT.BAT*  RC.D/         SOLARIS.MAP*
     ../           IDENT*        REPLACE.BAT*  X/
     APPEND.BAT*   MAKEDIR.BAT*  SOLARIS/
     # umount /mnt
     # lofiadm -d /export/s28/MDB_s28x_wos/latest/boot.3
     Example 3: Making a UFS filesystem on a file
     Making a UFS filesystm on a file can be useful, particularly if  a  test  suite  requires a scratch filesystem. It can be painful (or annoying) to have to re-partition  a  disk  just for  the  test suite, but you don't have to. You can newfs a file with lofi Create the file:
SunOS 5.8           Last change: 25 Aug 1999                    3
Maintenance Commands                                  lofiadm(1M)
     # mkfile 35m /export/home/test
     Attach it to a block device. You also get the character dev-
     ice that newfs requires, so newfs that:
     # lofiadm -a /export/home/test  /dev/lofi/1
     # newfs /dev/rlofi/1
     newfs: construct a new file system /dev/rlofi/1: (y/n)? y
     /dev/rlofi/1:   71638 sectors in 119 cylinders of 1 tracks, 602 sectors
             35.0MB in 8 cyl groups (16 c/g, 4.70MB/g, 2240 i/g)
     super-block backups (for fsck -F ufs -o b=#) at:
      32, 9664, 19296, 28928, 38560, 48192, 57824, 67456,
     Note that ufs might not be able  to  use  the  entire  file.
     Mount and use the filesystem:
     # mount /dev/lofi/1 /mnt
     # df -k /mnt
     Filesystem            kbytes    used   avail capacity  Mounted on
     /dev/lofi/1            33455       9   30101     1%    /mnt
     # ls /mnt
     ./           ../          lost+found/
     # umount /mnt
     # lofiadm -d /dev/lofi/1
ENVIRONMENT VARIABLES
     See environ(5)  for descriptions of the  following  environ-ment  variables  that  affect  the   execution  of  lofiadm:
     LC_CTYPE, LC_MESSAGES and NLSPATH.
EXIT STATUS
     The following exit values are returned:
     0     Successful completion.
     >0    An error occurred.
ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:
     ____________________________________________________________
   |        ATTRIBUTE TYPE       |        ATTRIBUTE VALUE      |
   | ____________________________|_____________________________|_
   |  Availability               |  SUNWcsu                    |
   |_____________________________|_____________________________|
SEE ALSO
     fsck(1M), mount(1M), mount_ufs(1M), attributes(5), lofi(7D)
SunOS 5.8           Last change: 25 Aug 1999                    4
Maintenance Commands                                  lofiadm(1M)
NOTES
     Just as you would not directly access a disk device that has mounted  file  systems, you should not access a file associ-ated with a  block  device  except  through  the  lofi  file driver. It might also be appropriate to ensure that the file has appropriate permissions to prevent such access.
     Associations are not persistant across reboots. A script can be used to re-establish them if required.
     The abilities of lofiadm, and who can  use  them,  are  con-trolled  by  the  permissions  of  /dev/lofictl. Read-access allows query operations, such as listing  all  the  associa-tions.  Write-access  is  required  to do any state-changing operations,  like  adding  an  association.    As   shipped, /dev/lofictl  is owned by root, in group sys, and mode 0644,so all users can do  query  operations  but  only  root  can change  anything.  The  should  probably  only be given to a trusted group.
     When mounting a filesystem image, take care to use appropri-ate  mount  options.  In particular, the nosuid mount option  might be appropriate for UFS images whose origin is unknown.
     Also,  some options might not be useful or appropriate, like logging or forcedirectio for UFS.   For  compatability  pur-poses,  a  raw  device is also exported along with the block device. For example, newfs(1M) requires one.
     The output of lofiadm  (without  arguments)  may  change  in future releases.
SunOS 5.8           Last change: 25 Aug 1999                    5
阅读(3142) | 评论(0) | 转发(0) |
0

上一篇:as400上的FTP~

下一篇:400操作入门

给主人留下些什么吧!~~