Solstice Disksuite command line reference.

发表于:2007-06-08来源:作者:点击数: 标签:
SolsticeDisksuite Locationofcomponents ---------------------- [color=blue:3262023abf][b:3262023abf]commandlineutilitiesin/usr/opt/SUNWmd/sbin drivermodulesin/kernel/drvand/kernel/misc daemonsin/usr/opt/SUNWmd/sbin administrativefilesin/etc

Solstice Disksuite


Location of components
----------------------

[color=blue:3262023abf][b:3262023abf]command line utilities in /usr/opt/SUNWmd/sbin
driver modules in /kernel/drv and /kernel/misc
daemons in /usr/opt/SUNWmd/sbin
administrative files in /etc/opt/SUNWmd[/b:3262023abf][/color:3262023abf]


[color=red:3262023abf]metadevices are named /dev/md/{dsk|rdsk}/dn, with n from 0 to 127 by default

the packages are SUNWmd and SUNWmdg (the GUI)[/color:3262023abf]




Useful options
--------------

[color=blue:3262023abf]The [size=18:3262023abf][b:3262023abf]-f[/b:3262023abf][/size:3262023abf] option can be used with most commands to force the operation.  This is needed when doing an operation on a mounted filesystem.[/color:3262023abf]





[size=18:3262023abf][color=red:3262023abf][b:3262023abf]md.tab[/b:3262023abf][/color:3262023abf][/size:3262023abf] file
-----------

The /etc/opt/SUNWmd/md.tab file can be used to configure ODS automatically.

# metastat -p > <filename>

This will output your configuration in md.tab format

# metainit -a

This command reads the md.tab file and sets up the configuration aclearcase/" target="_blank" >ccordingly




[color=blue:3262023abf][b:3262023abf]Creating replicas[/b:3262023abf][/color:3262023abf]
-----------------

# metadb -a -f c0t3d0s7

Before you can use Disksuite software, you must create the metadevice state database. The replica can exist on a dedicated disk partition or within a concat, stripe, or logging metadevice.

There MUST be 3 replicas or Disksuite S/W cannot be used correctly.
Se Documentation for more info on replicas.
it modifies /etc/system, /etc/opt/SUNWmd/mddb.cf

you can also modify the md.tab file to create a configuration




[b:3262023abf][color=blue:3262023abf]Concatenation[/color:3262023abf][/b:3262023abf]
-------------

[color=red:3262023abf][b:3262023abf]# metainit d1 3 1 c0t1d0s2 1 c1t1d0s2 1 c2t1d0s2

where d1 is the metadevice, 3 is the number of components to concatenate and 1 is the number of components per device[/b:3262023abf][/color:3262023abf]





[color=blue:3262023abf][b:3262023abf]Simple Stripe[/b:3262023abf][/color:3262023abf]
-------------

[color=red:3262023abf]# metainit d2 1 3 c0t1d0s2 c1t1d0s2 c2t1d0s2 -i 16k

where d2 is the metadevice, 1 is the number of components to concatenate and 3 is the number of slices to stripe across -i 16k indicates the amount of data to write to each disk in stripe before moving to next one[/color:3262023abf]





[size=18:3262023abf][b:3262023abf][color=blue:3262023abf]Concat/Stripe[/color:3262023abf][/b:3262023abf][/size:3262023abf]
-------------

# metainit d3 3 3 c0t1d0s2 c1t1d0s2 c2t1d0s2 -i 16k  3 c3t1d0s2 c4t1d0s2 c5t1d0s2 -i 16k  3 c6t1d0s2 c7t1d0s2 c8t1d0s2 -i 16k

Here there are three stripes concatenated together.  d3 is the metadevice.
The first 3 is the number of components to concatenate.
The second and subsequent 3's indicate the number of slices to
stripe across.  The options there are as in the simple stripe.





[color=blue:3262023abf][b:3262023abf]Extending a metadevice[/b:3262023abf][/color:3262023abf]
----------------------

# metattach d1 c3t1d0s2

[b:3262023abf][color=red:3262023abf]extends a metadevice by concatenating a slice to the end.  It does not add a filesystem.

# growfs /dev/md/rdsk/d1

If the metadevice is not mounted, the above command extends the filesystem to include the added section.  You cannot shrink this filesystem later.

# growfs -M /export/home /dev/md/rdsk/d1

If the metadevice is mounted, the above command will extend the filesystem to include the concatenated section.  Again, you cannot shrink the filesystem later.[/color:3262023abf][/b:3262023abf]





[size=18:3262023abf][color=blue:3262023abf][b:3262023abf]Removing a metadevice[/b:3262023abf][/color:3262023abf][/size:3262023abf]
---------------------

# metaclear d3

d3 is the metadevice.

# metaclear -a -f

clears all metadevices.  Don't do this unless you want to blow away your entire configuration.

The devices cannot be open for use.., i.e. mounted






[size=18:3262023abf][color=blue:3262023abf][b:3262023abf]Viewing your configuration and status[/b:3262023abf][/color:3262023abf][/size:3262023abf]
-------------------------------------

[b:3262023abf]# metastat

shows the configuration and status of all metadevices

# metastat d3

will tell the configuration and status of just metadevice d3

# metadb

tells the location and status of locally configured replicas[/b:3262023abf]






[size=18:3262023abf][color=blue:3262023abf][b:3262023abf]Hot Spare pools[/b:3262023abf][/color:3262023abf][/size:3262023abf]
---------------

[color=red:3262023abf][b:3262023abf]# metainit hsp001

sets up a pool called hsp001.  It contains no disks yet.

# metahs -a hsp001 c0t1d0s4

adds a slice to the hot spare pool.  
NOTE: it is advisable to add disks/slices to the pool in order of smallest to largest.  
This way the smallest hotspare capable of replacing a disk will kick in.

# metahs -s all c1t1d0s4

adds a slice to all pools


# metaparam -h hsp001 d1
makes a hot spare pool available to the metadevice d1 {submirror or RAID5}


# metahs -e c1t1d0s4
reenables a a hot spare that was previously unavailable

# metahs -r hsp001 c1t1d0s4 c2t1d0s4
replaces the first disk listed with the second

# metahs -d all c1t1d0s4
removes a disk from all hot spare pools

# metahs -d hsp001 c1t1d0s4
removes a slice from hsp001

# metahs -d hsp001
removes a hot spare pool

# metahs -i
# metastat

tell you the status[/b:3262023abf][/color:3262023abf]






[size=18:3262023abf][color=red:3262023abf][b:3262023abf]Mirrors[/b:3262023abf][/color:3262023abf][/size:3262023abf]
-------

[color=blue:3262023abf][b:3262023abf]# metainit d0 -m d1
makes a one-way mirror.  d0 is the device to mount, but d1 is the only one associated with an actual device.  
A "one-way mirror" is not really a mirror yet.  There's only one place where the data is actually stored, namely d1.

# metattach d0 d2
attaches d2 to the d0 mirror.  Now there are 2 places where the data are stored, d1 and d2.  But you mount the metadevice d0.

# metadetach d0 d1
detaches d1 from the d0 mirror

# metaoffline d0 d2
# metaonline d0 d2
suspends/resumes use of d2 device on d0 mirror

# metareplace d0 c1t0d0s2 c4t1d0s2
replaces first disk listed with second on the d0 mirror

# metareplace -e d0 c1t1d0s2
re-enables a disk that has been errored. [/b:3262023abf][/color:3262023abf]







[size=18:3262023abf][color=red:3262023abf][b:3262023abf]Mirroring root[/b:3262023abf][/color:3262023abf][/size:3262023abf]
--------------

You must take a few extra steps to mirror the root partition

[color=blue:3262023abf][b:3262023abf]# metainit d1 1 1 c0t3d0s0 <-- the root partition
# metainit d0 -m d1
# metaroot d0

the metaroot command updates /etc/system and /etc/vfstab so that the device /dev/md/dsk/d0 is now the root device.

# reboot

you must do this to have d0 be the mounted device.  Otherwise if you do the next step, data corruption will occur because of the round robin manner in which data is written

# metainit d2 1 1 c0t4d0s0
# metattach d0 d2

Now d2 is attached and data is mirrored on d1 and d2.  The device to mount is d0.[/b:3262023abf][/color:3262023abf]



[size=18:3262023abf][b:3262023abf][color=red:3262023abf]RAID 5[/color:3262023abf][/b:3262023abf][/size:3262023abf]
------

[color=blue:3262023abf][b:3262023abf]# metainit d1 -r c0t1d0s2 c1t1d0s2 c2t1d0s2 -i 16k

sets up a RAID 5 configuration.
The -i option is the same as in striping.

# metareplace d1 c2t3d0s2 c3t1d0s2
# metareplace -e d1 c0t1d0s2
replacing disks as in the mirror.

# metattach d1 c4t3d0s2
concatenates a disk to the end of the RAID 5 configuration.

# metaparam -h hsp001 d1
adds a hot spare pool

# metaclear d1
removes a metadevice

# metastat
tells status[/b:3262023abf][/color:3262023abf]






[size=18:3262023abf][color=red:3262023abf][b:3262023abf]UFS logging[/b:3262023abf][/color:3262023abf][/size:3262023abf]
-----------

[color=blue:3262023abf][b:3262023abf]# metainit d0 -t d1 d2

sets up a trans device d0 with d1 as the master and d2 as the logging device.
recommended 1MB logging/1GB data on master

# metainit d0 -t c0t1d0s2 c3t2d0s5
same as above

# metattach d0 d1
# metattach d0 c3t1d0s5
# metadetach d0
attaching and detaching[/b:3262023abf][/color:3262023abf]







[size=18:3262023abf][color=red:3262023abf][b:3262023abf]Disksets[/b:3262023abf][/color:3262023abf][/size:3262023abf]
--------

[color=blue:3262023abf][b:3262023abf]# command -s <setname> options

you can do almost everything the same way, except specify -s <deskset> 

metadevices in shared diskset are called /dev/md/<setname>/{dsk|rdsk}/dn

hot spare pools within a shared diskset are named <setname>/hspnnn

disksets are only supported on SSA disks and disks are repartitioned when put into a diskset unless slice 2 is zeroed out and slice 7 has cylinders 0-4 or 0-5 allocated to it for the diskset metadb 

# metaset -s <setname> -a -h <hostname1> <hostname2>
adds hosts to a set

# metaset -s <setname> -a c2t0d0 c2t1d0 c2t2d0 c2t3d0
adds drives to a set.  Notice we do not specify slice.

# metaset -s <setname> -d c2t3d0
# metaset -s <setname> -d -h <hostname>
removes hosts and drives

# metaset -s <setname> -t
take control of a diskset.  the -f option will force control but will panic other machine, unless it has been released from other host.

# metaset -s <setname> -r
releases control of a diskset[/b:3262023abf][/color:3262023abf]







[color=red:3262023abf][b:3262023abf]Troubleshooting info to gather[/b:3262023abf][/color:3262023abf]
------------------------------

output from following...

[b:3262023abf][color=blue:3262023abf]# metastat
# metadb -i
# prtvtoc on relevant devices
# mount
# /var/adm/messages[/color:3262023abf][/b:3262023abf]

 nanaskylead 回复于:2004-06-19 10:18:58
好东西,收了。
这两天郁闷啊,面试了好几个人,没有一个达到要求的。

 xiaorui15 回复于:2004-06-19 21:07:26
大哥面试我吧

 nanaskylead 回复于:2004-06-20 12:16:40
你说你是学生?应届的,我们公司是不招的啊。

 kitten@TS 回复于:2004-06-20 21:09:08
[quote:0285bcfba1="nanaskylead"]你说你是学生?应届的,我们公司是不招的啊。[/quote:0285bcfba1]

这就让我想起来为啥我难找工作了,毕竟经验还是很重要的,幸好huasun去年招毕业生,才让我....



[b:0285bcfba1]一楼的东东收到谢谢[/b:0285bcfba1]

 伯爵的Druid 回复于:2004-06-21 09:42:11
请问搂搂主
使用metastat -p的结果是查看本主机的metadisk的状态,我如何查看我的存储阵列sun storedge的metadisk的状态呢?

 swallowcn 回复于:2004-06-21 10:53:04
哪就来面试一下我,看我行不!


 :em11:

 sunmarmot 回复于:2004-06-21 14:05:34
[size=24:2fa7765894][color=darkred:2fa7765894][b:2fa7765894]偶要求参加面试 :em09:  :em09: [/b:2fa7765894][/color:2fa7765894][/size:2fa7765894]

 nanaskylead 回复于:2004-06-24 18:47:26
[quote:2d44b41a38="sunmarmot"][/quote:2d44b41a38]

你就别凑热闹了吧?
:),我们开不起你的工资啊。

 nimysun 回复于:2004-06-24 19:58:30
这贴子写的有水平。收下了。

 iricyan 回复于:2004-06-24 20:12:07
[quote:df66215bcd="伯爵的Druid"]请问搂搂主
使用metastat -p的结果是查看本主机的metadisk的状态,我如何查看我的存储阵列sun storedge的metadisk的状态呢?[/quote:df66215bcd]
咣当。

 伯爵的Druid 回复于:2004-06-25 09:32:32
斑竹,咣当啥子捏?
我说大白话了?
disksuite不能管理disk arrays ?
vxvm呢?

 伯爵的Druid 回复于:2004-06-25 09:33:02
斑竹,咣当啥子捏?
我说大白话了?
disksuite不能管理disk arrays ?
vxvm?

 pengtao_hlp 回复于:2004-06-25 11:51:41
我KKKKKKK。又是鹦哥历士

 mysin 回复于:2004-06-28 15:34:42
面试我啊,呵呵。我是SUN的FE工程师,工作6年了,CISCO的CCNP工程师。。联系我啊,QQ  2537253

 mazu 回复于:2004-06-28 17:23:12
先藏了 ^_^

 我爱臭豆腐 回复于:2004-10-12 14:28:27
非常非常的好受教育

 韦小宝 回复于:2004-10-16 23:00:16
infodoc<14698>

原文转自:http://www.ltesting.net