在Solaris Nevada OS 中使用可移动存贮介质,USB 移动硬盘,U盘(Flash闪存)
在Solaris Nevada OS 中使用可移动存贮介质,USB 移动硬盘,U盘(Flash闪存)
非常感谢Sun中国技术社区wiki的贡献者。在wiki"如何在Solaris下使用USB设备"中有一个比较全面的介绍了。
但是在最新的Solaris Nevada(我用的是Build73)中有些内容有些不适用了,需要修改一下。在这里我就根据原文的结构修改了相关的一些内容。
1.利用服务自动mount,,(这个可不是所有的USB设备都可以支持的)
首先查看卷管理服务:svc:/system/filesystem/rmvolmgr:default
可以用以下命令查看
#svcs -a|grep vol
online 10月_29 svc:/system/filesystem/rmvolmgr:default
如果rmvolmgr服务没有启动:
offline 10月_29 svc:/system/filesystem/rmvolmgr:default
使用如下命令启动rmvolmgr服务
#svcadm enable svc:/system/filesystem/rmvolmgr:default
我的尼康数码相机是可以直接自动mount上了。还有哪些可以自动mount上,就靠你自己试了。
2。
如果不能自动mount你的U盘,那么就直接查询设备路径,手动mount该设备:
如果该USB设备已经存在文件系统,且Solaris支持该文件系统,可以直接mount该文件系统。以FAT32文件系统为例,首先要了解USB设备的路径:
# rmformat
正在查找设备...
1. Logical Node: /dev/rdsk/c3t0d0p0
Physical Node: /pci@0,0/pci1028,1c2@1d,7/storage@4/disk@0,0
Connected Device: aigo USB DISK 1100
Device Type: Removable
Bus: USB
Size: 967.5 MB
Label: <None>
Access permissions: 媒体未被写保护。
然后,直接mount该设备(以FAT32,即PCFS格式为例):
# mount -F pcfs /dev/dsk/c3t0d0p0:c /mnt
如果要使用的是有多个分区(这里例子为2个)移动硬盘:
首先,创建两个目录DiskC,DiskD.
#cd /mnt
#mkdir DiskC
#mkdir DiskC
# rmformat
正在查找设备...
1. Logical Node: /dev/rdsk/c5t0d0p0
Physical Node: /pci@0,0/pci1028,1c2@1d,7/storage@6/disk@0,0
Connected Device: SAMSUNG MP0402H 0811
Device Type: Removable
Bus: USB
Size: 38.2 GB
Label: <None>
Access permissions: 媒体未被写保护。
mount第一个分区:
# mount -F pcfs /dev/dsk/c5t0d0p0:c /mnt/DiskC
mount第二个分区:
# mount -F pcfs /dev/dsk/c5t0d0p0:d /mnt/DiskD
(注:关于硬盘名字的含义,参考:p0是整个硬盘,包括启动扇区和所有的分区。p1-p4 是代表四个可能的fdisk分区。(目前只能使用p0)在内部,在硬盘的slice表中它们是第16到第20的位置。允许你在p0上做一个使用整个硬盘的新的文件系统,这时使用p0:M的方法来在代表pcfs代码。 'M'为'c'时,代表主FAT分区,'M'为'd'-'z'时代表一个扩展分区内的逻辑分区。
p0 is the entire disk, including the boot sectors and all the partitions. The p1-p4 are the four possible fdisk partitions. Internally these are the 16th-20th positions in the slice table for the disk.This allows you to do a newfs on p0 and use the entire disk as a file system. The p0:M method is handled within the pcfs code, where 'M' is 'c' for a primary FAT partition and 'd'-'z' for logical FAT partitions within an extended partition.)
卸载U盘前,需要确保该mount目录没有正在使用:
# umount /mnt
Wiki中还说要:
# eject rmdisk0
或者,
# eject /dev/rdsk/c3t0d0p0
但是对于U盘,移动硬盘eject这个命令一般不用,因为没有看出来有什么作用,通常umount后就可以直接拔出U盘了。
卸载移动硬盘前,需要确保该mount目录没有正在使用:
# umount /mnt/DiskC
# umount /mnt/DiskD
关于USB的更多信息请参考:Solaris USB FAQ: http://www.sun.com/io_technologies/usb/USB-Faq.html








cool
Posted by wow gold on November 03, 2008 at 09:11 AM CST #
Thanks for reading and comment. :) The latest version may support more USB device automatically.
Posted by xue on November 17, 2008 at 12:34 PM CST #