• 挂载U盘到solaris上

    网上关于挂载硬盘/U盘到solaris10的方法很多,但自己实际动手做才发现还是有很多技巧在里面的。

    首先,硬盘很少有FAT/FAT32的,做IT的自己的移动硬盘,装的不是苍老师,就是IT的杂乱资料收集。所以,如果要上传某个零时比较大的资料到solaris上,建议用U盘(如果非要挂载移动硬盘上solaris去,那你就自己格式化移动硬盘,然后按照挂载U盘的方法挂载也是一样)
    其次,关于挂载方法我总结如下:

1)挂载前查看/dev/usb情况如下

 
   
  1. root@DNS03 # ls 
  2. hub0  hub1  hub2 

2)挂载后查看/dev/usb情况如下

 
   
  1. root@DNS03 # ls 
  2. 90c.1000       hub0           hub1           hub2           mass-storage0 
多了一个90c.100和一个mass-storage0 这个时候说明solaris已经识别出来了磁盘mass-storage0,但是也很奇怪为什么多了一个90c.1000这个文件
 
   
  1. root@DNS03 # ls -lh  
  2. 总数 10 
  3. drwxr-xr-x   3 root     root         512  2月 23日 20:08 90c.1000 
  4. lrwxrwxrwx   1 root     root          50 2010   1月  5 hub0 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5:hubd 
  5. lrwxrwxrwx   1 root     root          50 2010   1月  5 hub1 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@6:hubd 
  6. lrwxrwxrwx   1 root     root          56 2010   1月  5 hub2 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@6/hub@1:hubd 
  7. lrwxrwxrwx   1 root     root          64  2月 23日 20:08 mass-storage0 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1:scsa2usb 
  8. root@DNS03 # cd 90c.1000 
  9. root@DNS03 # ls 
  10. root@DNS03 # ls -lh  
  11. 总数 2 
  12. drwxr-xr-x   2 root     root         512  2月 23日 20:08 0 

3)最重要的挂载情况

a)我们查看/dev/dsk情况如下
 
   
  1. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s0 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:a 
  2. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s1 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:b 
  3. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s2 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:c 
  4. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s3 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:d 
  5. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s4 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:e 
  6. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s5 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:f 
  7. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s6 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:g 
  8. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t0d0s7 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@0,0:h 
  9. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s0 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:a 
  10. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s1 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:b 
  11. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s2 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:c 
  12. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s3 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:d 
  13. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s4 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:e 
  14. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s5 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:f 
  15. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s6 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:g 
  16. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t1d0s7 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:h 
  17. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s0 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:a 
  18. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s1 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:b 
  19. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s2 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:c 
  20. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s3 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:d 
  21. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s4 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:e 
  22. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s5 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:f 
  23. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s6 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:g 
  24. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t2d0s7 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@2,0:h 
  25. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s0 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:a 
  26. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s1 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:b 
  27. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s2 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:c 
  28. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s3 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:d 
  29. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s4 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:e 
  30. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s5 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:f 
  31. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s6 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:g 
  32. lrwxrwxrwx   1 root     root          49 2010   1月  5 c0t3d0s7 -> ../../devices/pci@780/pci@0/pci@9/scsi@0/sd@3,0:h 
  33. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s0 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:a 
  34. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s1 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:b 
  35. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s2 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:c 
  36. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s3 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:d 
  37. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s4 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:e 
  38. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s5 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:f 
  39. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s6 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:g 
  40. lrwxrwxrwx   1 root     root          54 2010   1月  5 c1t0d0s7 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/ide@8/sd@0,0:h 
这可以看到我们的设备名称链接到的各个实体设备上的情况。
最后一节我们看到c2t0d0s0对应这我们在/dev/usb里面看到的情况。
 
b)挂载设备上去。
   我们查看man mount发现-F参数信息如下:
 
   
  1. -F FSType 
  2.  
  3.      Used to specify the FSType  on  which  to  operate.  The 
  4.      FSType  must  be  specified or must be determinable from 
  5.      /etc/vfstab,  or  by   consulting   /etc/default/fs   or 
  6.      /etc/dfs/fstypes. 
但是去/etc/default/fs查看,结果只有
 
    
  1. root@DNS03 # more  /etc/default/fs 
  2.     LOCAL=ufs 
所以要用-F pcfs参数
root@DNS03 # mount -F pcfs /dev/dsk/c2t0d0s0 /mnt
mount: /dev/dsk/c2t0d0s2 is not a DOS filesystem.
如上,在不加":c"的情况下,会出现“mount: /dev/dsk/c2t0d0s0 is not a DOS filesystem.”的提示,所以“:c”应该就是指的挂载磁盘的那个顺序,如果挂碍的磁盘有多个分区,就依次用":d",":e"了。这一点从ls -l /dev/dsk可以看到
 
 
     
  1. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s0 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:a 
  2. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s1 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:b 
  3. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s2 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:c 
  4. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s3 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:d 
  5. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s4 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:e 
  6. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s5 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:f 
  7. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s6 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:g 
  8. lrwxrwxrwx   1 root     root          66  2月 23日 20:08 c2t0d0s7 -> ../../devices/pci@7c0/pci@0/pci@1/pci@0/usb@5/storage@1/disk@0,0:h 
c)所以,安装正确的方法输入mount -F pcfs /dev/dsk/c2t0d0s0:c /mnt提示挂载成功;
 
    
  1. root@DNS03 # mount -F pcfs /dev/dsk/c2t0d0s0:c /mnt 
  2. 文件系统               大小   用了   可用 容量      挂接在 
  3. /dev/md/dsk/d10        9.6G   534M   9.0G     6%    / 
  4. /devices                 0K     0K     0K     0%    /devices 
  5. ctfs                     0K     0K     0K     0%    /system/contract 
  6. proc                     0K     0K     0K     0%    /proc 
  7. mnttab                   0K     0K     0K     0%    /etc/mnttab 
  8. swap                    28G   1.5M    28G     1%    /etc/svc/volatile 
  9. objfs                    0K     0K     0K     0%    /system/object 
  10. sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab 
  11. /dev/dsk/c2t0d0s0:c    3.7G   2.3G   1.5G    61%    /mnt 

 

  • 挂载ISO文件到solaris下

lofiadm -a /tmp/eis*iso
mount -F hsfs /dev/lofi/1 /mnt