显示标签为“openSolaris”的博文。显示所有博文
显示标签为“openSolaris”的博文。显示所有博文

2010年3月17日星期三

solaris 7 force umount cmd

在一個超級古老的機器上mount 了一個nfs, 但是nfs server移除以後就沒有辦法 umount 這個目錄了

umount /backup

報錯如下:

nfs umount: /backup: is busy


怎麼辦呢?



google了一下,使用如下命令可以幹掉



Solaris 2.6 and Solaris 7: umount -o force /mount-point



試用了一下, 還是報錯



不過df -k的時候 發現已經很順暢了,感覺已經去掉了



當然還有另一種辦法



try following ...

unshare /backup
umount /backup


沒有測試過,等下次有機會測試一下



記錄一下備忘!

2010年3月2日星期二

BBED complie

發現一個有用的工具BBED,處理壞塊使用的, 根據網上提供的方法,自己做了一個實驗:

我的環境是openSolaris 其他的*nix也是類似

1,源文件在哪裡?

cd $ORACLE_HOME

 

oracle@opensolaris:/opt/oracle/product/10.2.0/db_1$ find . -name ins_rdbms.mk
./rdbms/lib/ins_rdbms.mk

2,編譯:

oracle@opensolaris:/opt/oracle/product/10.2.0/db_1/rdbms/lib$ make -f ins_rdbms.mk /opt/oracle/product/10.2.0/db_1/rdbms/lib/bbed

Linking BBED utility (bbed)
rm -f /opt/oracle/product/10.2.0/db_1/rdbms/lib/bbed
/usr/ccs/bin/ld -64 -o /opt/oracle/product/10.2.0/db_1/rdbms/lib/bbed -L/opt/oracle/product/10.2.0/db_1/rdbms/lib/ -L/opt/oracle/product/10.2.0/db_1/lib/ -dy /opt/oracle/product/10.2.0/db_1/lib/prod/lib/amd64/crti.o /opt/oracle/product/10.2.0/db_1/lib/prod/lib/amd64/crt1x.o /opt/oracle/product/10.2.0/db_1/lib/s0main.o /opt/oracle/product/10.2.0/db_1/rdbms/lib/ssbbded.o /opt/oracle/product/10.2.0/db_1/rdbms/lib/sbbdpt.o `cat /opt/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 /opt/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o  -ldbtools10 -lclntsh  `cat /opt/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /opt/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10  -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10  -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10  -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /opt/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /opt/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10  -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10  -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10  -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10  -lclient10 -lnnetd10  -lvsn10  -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10  -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10  -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /opt/oracle/product/10.2.0/db_1/lib/sysliblist` -R /opt/SUNWcluster/lib:/opt/oracle/product/10.2.0/db_1/lib:/opt/ORCLcluster/lib/  -Y P,:/opt/SUNWcluster/lib:/opt/ORCLcluster/lib/:/usr/ccs/lib/amd64:/usr/lib/amd64  -Qy -lc  -lrt  -laio -lposix4 -lkstat -lm  /opt/oracle/product/10.2.0/db_1/lib/prod/lib/amd64/crtn.o

驗證一下:

oracle@opensolaris:/opt/oracle/product/10.2.0/db_1/rdbms/lib$ ls -al bbed
-rwxr-xr-x 1 oracle oinstall 862016 2010-03-03 10:06 bbed

執行

oracle@opensolaris:/opt/oracle/product/10.2.0/db_1/rdbms/lib$ ./bbed
Password:(blockedit 為default password)

BBED: Release 2.0.0.0.0 - Limited Production on Wed Mar 3 10:07:15 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

************* !!! For Oracle Internal Use only !!! ***************

BBED>

這個工具是內部人員使用的哦

BBED> help all
SET DBA [ dba | file#, block# ]
SET FILENAME 'filename'
SET FILE file#
SET BLOCK [+/-]block#
SET OFFSET [ [+/-]byte offset | symbol | *symbol ]
SET BLOCKSIZE bytes
SET LIST[FILE] 'filename'
SET WIDTH character_count
SET COUNT bytes_to_display
SET IBASE [ HEX | OCT | DEC ]
SET OBASE [ HEX | OCT | DEC ]
SET MODE  [ BROWSE | EDIT ]
SET SPOOL [ Y | N ]
SHOW [ <SET parameter> | ALL ]
INFO
MAP[/v] [ DBA | FILENAME | FILE | BLOCK ]
DUMP[/v] [ DBA | FILENAME | FILE | BLOCK | OFFSET | COUNT ]
PRINT[/x|d|u|o|c] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
EXAMINE[/Nuf] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
</Nuf>:
N - a number which specifies a repeat count.
u - a letter which specifies a unit size:
  b - b1, ub1 (byte)
  h - b2, ub2 (half-word)
  w - b4, ub4(word)
  r - Oracle table/index row
f - a letter which specifies a display format:
  x - hexadecimal
  d - decimal
  u - unsigned decimal
  o - octal
  c - character (native)
  n - Oracle number
  t - Oracle date
  i - Oracle rowid
FIND[/x|d|u|o|c] numeric/character string [ TOP | CURR ]
COPY [ DBA | FILE | FILENAME | BLOCK ] TO [ DBA | FILE | FILENAME | BLOCK ]
MODIFY[/x|d|u|o|c] numeric/character string
      [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
ASSIGN[/x|d|u|o] <target spec>=<source spec>
<target spec> : [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]
<source spec> : [ value | <target spec options> ]
SUM [ DBA | FILE | FILENAME | BLOCK ] [ APPLY ]
PUSH [ DBA | FILE | FILENAME | BLOCK | OFFSET ]
POP [ALL]
REVERT [ DBA | FILE | FILENAME | BLOCK ]
UNDO
HELP [ <bbed command> | ALL ]
VERIFY [ DBA | FILE | FILENAME | BLOCK ]
CORRUPT [ DBA | FILE | FILENAME | BLOCK ]

BBED>

記錄一下,備忘,繼續學習!

ref:

http://www.databasejournal.com/features/oracle/article.php/3835546/Installing-Oracle-Block-Browser-and-Editor-tool-bbed.htm

http://www.eygle.com/archives/2005/09/how_to_compile.html

2010年2月25日星期四

oracle exp parfile mode

發現一個oracle exp的方法不錯,就是用file方式。記錄一下備查

 

oracle@opensolaris:~$ cat experfstat.par
userid=perfstat/perfstat
owner=perfstat
DIRECT=y
CONSISTENT=y
file=/export/home/oracle/perfstat.dmp
grants=y
indexes=y
oracle@opensolaris:~$

oracle@opensolaris:~$ exp parfile=experfstat.par
Export: Release 10.2.0.1.0 - Production on Thu Feb 25 17:55:39 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in UTF8 character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user PERFSTAT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user PERFSTAT
About to export PERFSTAT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export PERFSTAT's tables via Direct Path ...
. . exporting table         STATS$BG_EVENT_SUMMARY        308 rows exported
. . exporting table          STATS$BUFFERED_QUEUES          0 rows exported
. . exporting table     STATS$BUFFERED_SUBSCRIBERS          0 rows exported
. . exporting table   STATS$BUFFER_POOL_STATISTICS         14 rows exported
. . exporting table          STATS$CR_BLOCK_SERVER          0 rows exported
. . exporting table     STATS$CURRENT_BLOCK_SERVER          0 rows exported
. . exporting table        STATS$DATABASE_INSTANCE          1 rows exported
. . exporting table          STATS$DB_CACHE_ADVICE        294 rows exported
. . exporting table                 STATS$DLM_MISC          0 rows exported
. . exporting table   STATS$DYNAMIC_REMASTER_STATS          0 rows exported
. . exporting table       STATS$ENQUEUE_STATISTICS        826 rows exported
. . exporting table          STATS$EVENT_HISTOGRAM       6692 rows exported
. . exporting table               STATS$FILESTATXS         70 rows exported
. . exporting table           STATS$FILE_HISTOGRAM        350 rows exported
. . exporting table               STATS$IDLE_EVENT         70 rows exported
. . exporting table  STATS$INSTANCE_CACHE_TRANSFER          0 rows exported
. . exporting table        STATS$INSTANCE_RECOVERY         14 rows exported
. . exporting table         STATS$JAVA_POOL_ADVICE         28 rows exported
. . exporting table                    STATS$LATCH       5348 rows exported
. . exporting table           STATS$LATCH_CHILDREN          0 rows exported
. . exporting table     STATS$LATCH_MISSES_SUMMARY         14 rows exported
. . exporting table             STATS$LATCH_PARENT          0 rows exported
. . exporting table        STATS$LEVEL_DESCRIPTION          5 rows exported
. . exporting table             STATS$LIBRARYCACHE        154 rows exported
. . exporting table              STATS$MUTEX_SLEEP          0 rows exported
. . exporting table                   STATS$OSSTAT        238 rows exported
. . exporting table               STATS$OSSTATNAME         17 rows exported
. . exporting table                STATS$PARAMETER       3696 rows exported
. . exporting table                  STATS$PGASTAT        196 rows exported
. . exporting table        STATS$PGA_TARGET_ADVICE        196 rows exported
. . exporting table    STATS$PROCESS_MEMORY_ROLLUP        376 rows exported
. . exporting table           STATS$PROCESS_ROLLUP        111 rows exported
. . exporting table     STATS$PROPAGATION_RECEIVER          0 rows exported
. . exporting table       STATS$PROPAGATION_SENDER          0 rows exported
. . exporting table           STATS$RESOURCE_LIMIT         70 rows exported
. . exporting table                 STATS$ROLLSTAT        154 rows exported
. . exporting table         STATS$ROWCACHE_SUMMARY        532 rows exported
. . exporting table                 STATS$RULE_SET         14 rows exported
. . exporting table                 STATS$SEG_STAT          0 rows exported
. . exporting table             STATS$SEG_STAT_OBJ          4 rows exported
. . exporting table            STATS$SESSION_EVENT          0 rows exported
. . exporting table                  STATS$SESSTAT          0 rows exported
. . exporting table          STATS$SESS_TIME_MODEL          0 rows exported
. . exporting table                      STATS$SGA         56 rows exported
. . exporting table                  STATS$SGASTAT        318 rows exported
. . exporting table        STATS$SGA_TARGET_ADVICE        112 rows exported
. . exporting table       STATS$SHARED_POOL_ADVICE        196 rows exported
. . exporting table                 STATS$SNAPSHOT         14 rows exported
. . exporting table                  STATS$SQLTEXT        362 rows exported
. . exporting table                 STATS$SQL_PLAN        330 rows exported
. . exporting table           STATS$SQL_PLAN_USAGE          0 rows exported
. . exporting table           STATS$SQL_STATISTICS         14 rows exported
. . exporting table              STATS$SQL_SUMMARY        885 rows exported
. . exporting table   STATS$SQL_WORKAREA_HISTOGRAM         67 rows exported
. . exporting table      STATS$STATSPACK_PARAMETER          1 rows exported
. . exporting table        STATS$STREAMS_APPLY_SUM          0 rows exported
. . exporting table          STATS$STREAMS_CAPTURE          0 rows exported
. . exporting table      STATS$STREAMS_POOL_ADVICE          0 rows exported
. . exporting table                  STATS$SYSSTAT       5180 rows exported
. . exporting table             STATS$SYSTEM_EVENT        798 rows exported
. . exporting table           STATS$SYS_TIME_MODEL        266 rows exported
. . exporting table               STATS$TEMPSTATXS         14 rows exported
. . exporting table           STATS$TEMP_HISTOGRAM         14 rows exported
. . exporting table                   STATS$THREAD         14 rows exported
. . exporting table      STATS$TIME_MODEL_STATNAME         19 rows exported
. . exporting table                 STATS$UNDOSTAT          8 rows exported
. . exporting table                 STATS$WAITSTAT        252 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
oracle@opensolaris:~$

2010年2月22日星期一

openSolaris 0906 install GCC

1,像偉大的SUN默哀1 min

2,使用 open Solaris live CD 0906安裝一個測試環境。

運行gcc

root@opensolaris:~# gcc
-bash: gcc: command not found
root@opensolaris:~#

沒有找到gcc,安裝

圖形介面

System->Administration –> Package Manager

Search all package for “GCC” or “SUNWgcc”

Install /update packages

“installation completed successfully”

root@opensolaris:~# cd /usr/sfw/bin
root@opensolaris:/usr/sfw/bin# ls gcc
gcc
root@opensolaris:/usr/sfw/bin# ./gcc
gcc: no input files
root@opensolaris:/usr/sfw/bin# ./gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs
Configured with: /builds2/sfwnv-111a/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++,f77,objc --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-20050802)
root@opensolaris:/usr/sfw/bin#

記錄一下,備忘!

2010年1月31日星期日

opensolaris(solaris5.11)下如何mount ntfs 格式的usb disk?

opensolaris mount usb disk
################################################################
root@opensolaris:~/software# wget -c http://www.belenix.org/binfiles/FSWpart.tar.gz
--12:34:27--  http://www.belenix.org/binfiles/FSWpart.tar.gz
           => `FSWpart.tar.gz'
Resolving www.belenix.org... 204.152.191.108
Connecting to www.belenix.org|204.152.191.108|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34,587 (34K) [application/x-gzip]
100%[====================================>] 34,587        41.66K/s
12:34:28 (41.58 KB/s) - `FSWpart.tar.gz' saved [34587/34587]
root@opensolaris:~/software# ls
FSWpart.tar.gz
root@opensolaris:~/software# gunzip -c FSWpart.tar.gz |tar xvf -
FSWpart/
FSWpart/pkgmap
FSWpart/pkginfo
FSWpart/install/
FSWpart/install/copyright
FSWpart/reloc/
FSWpart/reloc/usr/
FSWpart/reloc/usr/bin/
FSWpart/reloc/usr/bin/prtpart
FSWpart/reloc/usr/bin/prtpart.bin
FSWpart/reloc/usr/share/
FSWpart/reloc/usr/share/src/
FSWpart/reloc/usr/share/src/prtpart.c
root@opensolaris:~/software# ls
FSWpart  FSWpart.tar.gz
root@opensolaris:~/software# pkgadd -d . FSWpart
Processing package instance <FSWpart> from </root/software>
x86 Partition Table Dumper(i386) 0.1
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Author Moinak Ghosh
#
Using </> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
Installing x86 Partition Table Dumper as <FSWpart>
## Installing part 1 of 1.
/usr/bin/prtpart
/usr/bin/prtpart.bin
/usr/share/src/prtpart.c
[ verifying class <none> ]
Installation of <FSWpart> was successful.
root@opensolaris:~/software#
root@opensolaris:~/software# wget -c http://www.belenix.org/binfiles/FSWfsmisc.tar.gz
--12:37:17--  http://www.belenix.org/binfiles/FSWfsmisc.tar.gz
           => `FSWfsmisc.tar.gz'
Resolving www.belenix.org... 204.152.191.108
Connecting to www.belenix.org|204.152.191.108|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,286,525 (4.1M) [application/x-gzip]
100%[====================================>] 4,286,525     72.92K/s    ETA 00:00
12:38:03 (91.30 KB/s) - `FSWfsmisc.tar.gz' saved [4286525/4286525]
root@opensolaris:~/software#
root@opensolaris:~/software# gunzip -c FSWfsmisc.tar.gz  |tar xvf -
FSWfsmisc/
FSWfsmisc/pkgmap
FSWfsmisc/pkginfo
FSWfsmisc/install/
FSWfsmisc/install/copyright
FSWfsmisc/install/depend
FSWfsmisc/reloc/
FSWfsmisc/reloc/etc/
FSWfsmisc/reloc/etc/gnome-vfs-2.0/
FSWfsmisc/reloc/etc/gnome-vfs-2.0/modules/
FSWfsmisc/reloc/etc/gnome-vfs-2.0/modules/libntfs.conf
FSWfsmisc/reloc/usr/
FSWfsmisc/reloc/usr/bin/
FSWfsmisc/reloc/usr/bin/chattr
FSWfsmisc/reloc/usr/bin/lsattr
FSWfsmisc/reloc/usr/bin/ntfscat
FSWfsmisc/reloc/usr/bin/ntfscluster
FSWfsmisc/reloc/usr/bin/ntfscmp
FSWfsmisc/reloc/usr/bin/ntfsfix
FSWfsmisc/reloc/usr/bin/ntfsinfo
FSWfsmisc/reloc/usr/bin/ntfsls
FSWfsmisc/reloc/usr/bin/uuidgen
FSWfsmisc/reloc/usr/bin/xlsmounts
FSWfsmisc/reloc/usr/bin/xumount
FSWfsmisc/reloc/usr/include/
FSWfsmisc/reloc/usr/include/et/
FSWfsmisc/reloc/usr/include/et/com_err.h
FSWfsmisc/reloc/usr/include/ext2fs/
FSWfsmisc/reloc/usr/include/ext2fs/bitops.h
FSWfsmisc/reloc/usr/include/ext2fs/ext2_err.h
FSWfsmisc/reloc/usr/include/ext2fs/ext2_fs.h
FSWfsmisc/reloc/usr/include/ext2fs/ext2_io.h
FSWfsmisc/reloc/usr/include/ext2fs/ext2_types.h
FSWfsmisc/reloc/usr/include/ext2fs/ext2fs.h
FSWfsmisc/reloc/usr/include/ntfs/
FSWfsmisc/reloc/usr/include/ntfs/attrib.h
FSWfsmisc/reloc/usr/include/ntfs/attrlist.h
FSWfsmisc/reloc/usr/include/ntfs/bitmap.h
FSWfsmisc/reloc/usr/include/ntfs/bootsect.h
FSWfsmisc/reloc/usr/include/ntfs/collate.h
FSWfsmisc/reloc/usr/include/ntfs/compat.h
FSWfsmisc/reloc/usr/include/ntfs/compress.h
FSWfsmisc/reloc/usr/include/ntfs/debug.h
FSWfsmisc/reloc/usr/include/ntfs/device.h
FSWfsmisc/reloc/usr/include/ntfs/device_io.h
FSWfsmisc/reloc/usr/include/ntfs/dir.h
FSWfsmisc/reloc/usr/include/ntfs/endians.h
FSWfsmisc/reloc/usr/include/ntfs/gnome-vfs-method.h
FSWfsmisc/reloc/usr/include/ntfs/gnome-vfs-module.h
FSWfsmisc/reloc/usr/include/ntfs/index.h
FSWfsmisc/reloc/usr/include/ntfs/inode.h
FSWfsmisc/reloc/usr/include/ntfs/layout.h
FSWfsmisc/reloc/usr/include/ntfs/lcnalloc.h
FSWfsmisc/reloc/usr/include/ntfs/list.h
FSWfsmisc/reloc/usr/include/ntfs/logfile.h
FSWfsmisc/reloc/usr/include/ntfs/logging.h
FSWfsmisc/reloc/usr/include/ntfs/mft.h
FSWfsmisc/reloc/usr/include/ntfs/mst.h
FSWfsmisc/reloc/usr/include/ntfs/ntfstime.h
FSWfsmisc/reloc/usr/include/ntfs/rich.h
FSWfsmisc/reloc/usr/include/ntfs/runlist.h
FSWfsmisc/reloc/usr/include/ntfs/security.h
FSWfsmisc/reloc/usr/include/ntfs/support.h
FSWfsmisc/reloc/usr/include/ntfs/tree.h
FSWfsmisc/reloc/usr/include/ntfs/types.h
FSWfsmisc/reloc/usr/include/ntfs/unistr.h
FSWfsmisc/reloc/usr/include/ntfs/version.h
FSWfsmisc/reloc/usr/include/ntfs/volume.h
FSWfsmisc/reloc/usr/info/
FSWfsmisc/reloc/usr/info/libext2fs.info.gz
FSWfsmisc/reloc/usr/lib/
FSWfsmisc/reloc/usr/lib/e2initrd_helper
FSWfsmisc/reloc/usr/lib/fs/
FSWfsmisc/reloc/usr/lib/fs/ext2fs/
FSWfsmisc/reloc/usr/lib/fs/ext2fs/mount
FSWfsmisc/reloc/usr/lib/fs/ntfs/
FSWfsmisc/reloc/usr/lib/fs/ntfs/mount
FSWfsmisc/reloc/usr/lib/gnome-vfs-2.0/
FSWfsmisc/reloc/usr/lib/gnome-vfs-2.0/modules/
FSWfsmisc/reloc/usr/lib/gnome-vfs-2.0/modules/libntfs-gnomevfs.a
FSWfsmisc/reloc/usr/lib/gnome-vfs-2.0/modules/libntfs-gnomevfs.la
FSWfsmisc/reloc/usr/lib/gnome-vfs-2.0/modules/libntfs-gnomevfs.so.1.0.0
FSWfsmisc/reloc/usr/lib/libcom_err.a
FSWfsmisc/reloc/usr/lib/libext2fs.a
FSWfsmisc/reloc/usr/lib/libntfs.la
FSWfsmisc/reloc/usr/lib/libntfs.so.9.0.0
FSWfsmisc/reloc/usr/sbin/
FSWfsmisc/reloc/usr/sbin/badblocks
FSWfsmisc/reloc/usr/sbin/blkid
FSWfsmisc/reloc/usr/sbin/debugfs
FSWfsmisc/reloc/usr/sbin/dumpe2fs
FSWfsmisc/reloc/usr/sbin/e2fsck
FSWfsmisc/reloc/usr/sbin/e2image
FSWfsmisc/reloc/usr/sbin/e2label
FSWfsmisc/reloc/usr/sbin/filefrag
FSWfsmisc/reloc/usr/sbin/findfs
FSWfsmisc/reloc/usr/sbin/fsck.ext2
FSWfsmisc/reloc/usr/sbin/fsck.ext3
FSWfsmisc/reloc/usr/sbin/logsave
FSWfsmisc/reloc/usr/sbin/mke2fs
FSWfsmisc/reloc/usr/sbin/mkfs.ext2
FSWfsmisc/reloc/usr/sbin/mkfs.ext3
FSWfsmisc/reloc/usr/sbin/mklost+found
FSWfsmisc/reloc/usr/sbin/mkntfs
FSWfsmisc/reloc/usr/sbin/ntfsclone
FSWfsmisc/reloc/usr/sbin/ntfscp
FSWfsmisc/reloc/usr/sbin/ntfslabel
FSWfsmisc/reloc/usr/sbin/ntfsresize
FSWfsmisc/reloc/usr/sbin/ntfsundelete
FSWfsmisc/reloc/usr/sbin/tune2fs
FSWfsmisc/reloc/usr/share/
FSWfsmisc/reloc/usr/share/locale/
FSWfsmisc/reloc/usr/share/locale/cs/
FSWfsmisc/reloc/usr/share/locale/cs/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/cs/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/de/
FSWfsmisc/reloc/usr/share/locale/de/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/de/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/es/
FSWfsmisc/reloc/usr/share/locale/es/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/es/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/fr/
FSWfsmisc/reloc/usr/share/locale/fr/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/fr/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/it/
FSWfsmisc/reloc/usr/share/locale/it/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/it/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/nl/
FSWfsmisc/reloc/usr/share/locale/nl/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/nl/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/pl/
FSWfsmisc/reloc/usr/share/locale/pl/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/pl/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/rw/
FSWfsmisc/reloc/usr/share/locale/rw/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/rw/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/sv/
FSWfsmisc/reloc/usr/share/locale/sv/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/sv/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/locale/tr/
FSWfsmisc/reloc/usr/share/locale/tr/LC_MESSAGES/
FSWfsmisc/reloc/usr/share/locale/tr/LC_MESSAGES/e2fsprogs.mo
FSWfsmisc/reloc/usr/share/man/
FSWfsmisc/reloc/usr/share/man/man1/
FSWfsmisc/reloc/usr/share/man/man1/chattr.1
FSWfsmisc/reloc/usr/share/man/man1/lsattr.1
FSWfsmisc/reloc/usr/share/man/man1/uuidgen.1
FSWfsmisc/reloc/usr/share/man/man5/
FSWfsmisc/reloc/usr/share/man/man5/e2fsck.conf.5
FSWfsmisc/reloc/usr/share/man/man5/mke2fs.conf.5
FSWfsmisc/reloc/usr/share/man/man8/
FSWfsmisc/reloc/usr/share/man/man8/badblocks.8
FSWfsmisc/reloc/usr/share/man/man8/blkid.8
FSWfsmisc/reloc/usr/share/man/man8/debugfs.8
FSWfsmisc/reloc/usr/share/man/man8/dumpe2fs.8
FSWfsmisc/reloc/usr/share/man/man8/e2fsck.8
FSWfsmisc/reloc/usr/share/man/man8/e2image.8
FSWfsmisc/reloc/usr/share/man/man8/e2label.8
FSWfsmisc/reloc/usr/share/man/man8/filefrag.8
FSWfsmisc/reloc/usr/share/man/man8/findfs.8
FSWfsmisc/reloc/usr/share/man/man8/fsck.ext2.8
FSWfsmisc/reloc/usr/share/man/man8/fsck.ext3.8
FSWfsmisc/reloc/usr/share/man/man8/libntfs-gnomevfs.8
FSWfsmisc/reloc/usr/share/man/man8/logsave.8
FSWfsmisc/reloc/usr/share/man/man8/mke2fs.8
FSWfsmisc/reloc/usr/share/man/man8/mkfs.ext2.8
FSWfsmisc/reloc/usr/share/man/man8/mkfs.ext3.8
FSWfsmisc/reloc/usr/share/man/man8/mklost+found.8
FSWfsmisc/reloc/usr/share/man/man8/mkntfs.8
FSWfsmisc/reloc/usr/share/man/man8/ntfscat.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsclone.8
FSWfsmisc/reloc/usr/share/man/man8/ntfscluster.8
FSWfsmisc/reloc/usr/share/man/man8/ntfscmp.8
FSWfsmisc/reloc/usr/share/man/man8/ntfscp.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsfix.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsinfo.8
FSWfsmisc/reloc/usr/share/man/man8/ntfslabel.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsls.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsmount.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsprogs.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsresize.8
FSWfsmisc/reloc/usr/share/man/man8/ntfsundelete.8
FSWfsmisc/reloc/usr/share/man/man8/tune2fs.8
root@opensolaris:~/software#
root@opensolaris:~/software# pkgadd -d . FSWfsmisc
root@opensolaris:~/software# rmformat -l
Looking for devices...
     1. Logical Node: /dev/rdsk/c10t0d0p0
        Physical Node: /pci@0,0/pci1458,5006@1d,7/storage@1/disk@0,0
        Connected Device: ST350032 0NS
        Device Type: Removable
        Bus: USB
        Size: 476.9 GB
        Label: <Unknown>
        Access permissions: Medium is not write protected.
     2. Logical Node: /dev/rdsk/c7t0d0p0
        Physical Node: /pci@0,0/pci-ide@1f,2/ide@1/sd@0,0
        Connected Device: PIONEER  DVD-RW  DVR-212  1.24
        Device Type: DVD Reader/Writer
        Bus: IDE
        Size: <Unknown>
        Label: <Unknown>
        Access permissions: <Unknown>
root@opensolaris:~/software# mount -F ntfs /dev/rdsk/c10t0d0p0 /rmdisk/
root@opensolaris:~/software#
root@opensolaris:~/software# cd /rmdisk/
root@opensolaris:/rmdisk# ls
admin  a.txt  now  System Volume Information  three  www1  www2
root@opensolaris:/rmdisk#
成功了!
http://blogs.sun.com/mandalika/entry/mounting_windows_ntfs_on_open

2010年1月22日星期五

RedHat Linux NFS server and solaris NFS client 實驗

臨時需要將一個老舊的Solaris2.7上面的數據備份出來,但是這個Sun的server不支持USB,如何處理呢?

想了一個辦法NFS, NFS是sun開發的,估計應該支持,所以找了一個RedHat的server做個NFS server, 這個Solaris nfs方式mount上去

參考鳥哥的nfs server的設定:

RedHat端:

[oracle@oracle03 mnt_usb]$ cat /etc/exports
/mnt_usb  *(rw,no_root_squash)
[oracle@oracle03 mnt_usb]$

/mnt_usb是server機器的一個目錄文件

對任何機器都開放

當然前提是server端已經安裝了nfs server的軟件:

 

  /etc/init.d/portmap restart
  /etc/init.d/nfs start

驗證:
  netstat –ultn

  netstat -ultn |grep 111


  netstat -ultn |grep 2049

rpcinfo -p localhost

因為沒有設置防火牆,所以沒有安全方面的問題,如果你有,自己檢查一下

如果上述都正常,成功一半了

另一半在Soaris這裡

相對簡單:

root權限

建立一個目錄作為mount的節點:

# mkdir /backup

# mount -F nfs -o rw 172.16.12.24:/mnt_usb /backup

如果沒有報錯就說明成功了!

做一個備份的測試

test>tar cvf - ivantest |gzip -c >/backup/www1/ivantest.tar.gz
ivantest/
ivantest/a.txt
test>

沒有問題,從server哪裡可以看到,解壓也成功了

2010年1月21日星期四

Awk處理根據行處理文本的例子

現有一個測試文本

a.txt

107542 A000904
104005 A000426
  64636 A000347
  54304 A000900
  52480 A000901
  34814 A000930
  14346 A000562
  10239 A000929
   9821 A000782
  8515 A000417
   7161 A000599
   6961 A000813
   6845 A000422
   5676 A000092
   5329 A000685
   5288 A000547
   4939 A000834
   4829 A000903
   4804 A000011
   4245 A000010
   4161 A000302
   3831 A000550

如何取行號>10的呢?

[root@test tmp]# awk 'NR > 10 {print $1 "----" $2}' a.txt >/tmp/b.txt

查看b.txt的文本

b.txt
------------
7161----A000599
6961----A000813
6845----A000422
5676----A000092
5329----A000685
5288----A000547
4939----A000834
4829----A000903
4804----A000011
4245----A000010
4161----A000302
3831----A000550

如何取行號<10的呢?

[root@test tmp]# awk 'NR < 10 {print $1 "----" $2}' a.txt >/tmp/c.txt

c.txt
107542----A000904
104005----A000426
64636----A000347
54304----A000900
52480----A000901
34814----A000930
14346----A000562
10239----A000929
9821----A000782

第10行是什麼呢?

10    8515 A000417

[root@test tmp]# awk 'NR <= 10 {print $1 "----" $2}' a.txt >/tmp/d.txt
[root@CRRACTEST tmp]# cat d.txt
107542----A000904
104005----A000426
64636----A000347
54304----A000900
52480----A000901
34814----A000930
14346----A000562
10239----A000929
9821----A000782
8515----A000417
[root@test tmp]#

記錄一下,這個腳本對於大文本處理相當有用!

2010年1月10日星期日

Solaris 10 上如何安裝c/c++ 等的compilers?

最近在公司整理一個sun 450的服務器,從新安裝solaris 10, 居然可以成功的安裝10年前的Server, 進而想會不會有編譯環境呢?

gcc了一下沒有,我愛想在上面做的開發啥的,怎麼辦呢?google

發現sun 免費發放gcc的compliers

https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=GCC-4.2.1-G-F@CDS-CDS_SMI

安裝說明參考

http://cooltools.sunsource.net/gcc/4.2.0/install.html

我的實驗:

bash-3.00# ls
SUNW0scgfss421.tar.bz2  SUNWgccfss421.tar.bz2
bash-3.00# /bin/bunzip2 -c SUNWgccfss421.tar.bz2  |/bin/tar xf -
bash-3.00# /bin/bunzip2 -c SUNW0scgfss421.tar.bz2 |/bin/tar xf -

bash-3.00# pwd
/usr/local/gcc/bin
bash-3.00# ls
ats                              gccbug
bit                              gcov
c++                              sparc-sun-solaris2.10-c++
cpp                              sparc-sun-solaris2.10-g++
discover                         sparc-sun-solaris2.10-gcc
g++                              sparc-sun-solaris2.10-gcc-4.2.1
gcc
bash-3.00#

bash-3.00# ./gcc
gcc: no input files
bash-3.00#

參考Advanced Programming in the UNIX 2ed

寫個小例子測試一下:

bash-3.00# cat test.c
#include<stdio.h>
#include<dirent.h>

int main(int argc, char *argv[])
{
        DIR   *dp;
        struct dirent *dirp;

        if(argc != 2)
        {
                printf("usage: ls directory_name \n");
                return 1;
        }

        if((dp = opendir(argv[1]))== NULL)
                printf("can't open %s", argv[1]);

        while((dirp = readdir(dp)) !=NULL)
                printf("%s \n", dirp->d_name);

        closedir(dp);
        //exit(0);
        return 0;
}
bash-3.00#

bash-3.00# /usr/local/gcc/bin/gcc -o test test.c
bash-3.00#

bash-3.00# ./test
usage: ls directory_name
bash-3.00# ./test .
.
..
test.c
test.o
test
core
bash-3.00#

貌似可以了, 記錄一下備忘!

2009年12月7日星期一

sun ZFS學習筆記

Sun 提供了一個ZFS的免費教程,感覺不錯,講部分內容和自己的實驗記錄下來,備查!

參考:
https://learning.sun.com/solc/files/solc/tblo_selfcontained/1179270410/module1/default.htm

What is ZFS?

ZFS is a revolutionary new file system that fundamentally changes the way file systems are administered, with features and benefits not found in any other file system available today. ZFS has been designed to be robust, scalable, and simple to administer.

Instead of using a storage volume model and its associated limitations, ZFS aggregates storage devices into 'pools.' The storage pool describes the physical characteristics of the system's storage (device layout, data redundancy, and so on) and acts as an general data store from which file systems can be created.

The Benefits of ZFS

ZFS's pooling model has a lot of useful benefits. For example, using pools means that you no longer need to predetermine the size of a file system, as file systems grow automatically within the space allocated to the storage pool.

More Benefits of ZFS

ZFS is also designed to scale easily and can handle extremely large quantities of data. It does this by using 128-bit data addressing and dynamically scaling its metadata.

In addition, ZFS ensures that its data is always consistent on disk. Because ZFS uses checksums with each block of data, it can detect data corruption caused by any element of the storage subsystem, not just disk errors. That means you can use inexpensive disks to provide similar reliability to high-priced storage systems.

Even More Benefits of ZFS

Finally, ZFS provides a greatly simplified administration model. ZFS makes it easy to create and manage file systems without needing multiple commands or editing configuration files.

For example, with ZFS you can easily:

  • Set quotas or reservations
  • Turn compression on or off
  • Manage mount points for numerous file systems with a single command, and
  • Examine or repair devices without having to understand a separate set of volume manager commands

Now you understand why ZFS is such a popular file system!

the two basic elements of a ZFS file system are:

. Pools and datasets

which kind of storage model does ZFS use?

Pooled storage

summary

In summary , ZFS is an amazing new file system technology that is fast, scalable, and filled with useful features.

Understanding ZFS Basics

Now that you have a general understanding ZFS , let's dive into the details. In this topic we'll cover the basic components of the ZFS file systems, such as pools and datasets. Like always, if you think that you already have a good understanding of these basic concepts, you're welcome to jump to Lesson 2.

If you're ready to proceed, click the Next button.

Pools and Datasets

Conceptually, ZFS is pretty simple. There are two basic elements: Pools and datasets.

Pools consist of storage devices that provide space for datasets. Each pool is comprised of one or more virtual devices. A virtual device is an internal representation of the storage pool that describes the layout of physical storage and its fault characteristics. In a system with multiple devices, often these storage devices are grouped in pairs.

Datasets are groups of information that reside in storage space allocated from the pools.

Think of it this way:

  • A pool is like a convention center where a tradeshow is taking place.

  • The storage devices are like convention center rooms that can be opened up to fit the number of people in attendance.

  • The datasets are attendees from different professional backgrounds. For example, one dataset is made up of the marketing people, another of engineers, etc. These attendees (or datasets) can sit whereever they want in the room until it is full. Then another room can be opened up to accommodate more attendees. When the tradeshow is over, the attendees leave the convention center leaving room for others to use the space.

Pools and Datasets (cont)

Now let's take a closer look at datasets. A “dataset” is a generic name for the following ZFS entities: file systems, volumes, snapshots, or clones.

  • A file system dataset is just a directory hierarchy for organizing and storing files.

  • A volume is a dataset that is used to emulate a physical device. For example, ZFS swap and dump volumes are created automatically when the OpenSolaris release is installed.

  • A snapshot is a read-only image of a file system or volume at a given point in time.

  • A clone is a file system whose initial contents are identical to the contents of a snapshot.

Examining Pools and Datasets

In ZFS, you can examine pools and datasets with the corresponding administration commands:

  • “zpool” for pools, and
  • “zfs” for datasets

Using the ZPOOL Command

First, use the “zpool status tank” command to see the available pools.

This system has just one pool called “tank.”

Take a moment to review the “config” section. This section displays the devices that make up the pool. This is a simple pool that contains a single storage device called “c1t0d0.”

---------- sample---

root@opensolaris:~# zpool status
  pool: mypool
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        mypool      ONLINE       0     0     0
          c9d0      ONLINE       0     0     0
errors: No known data errors
  pool: rpool
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c7d0s0    ONLINE       0     0     0
errors: No known data errors
root@opensolaris:~#
root@opensolaris:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c7d0 <DEFAULT cyl 30390 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
1. c8d1 <drive type unknown>
          /pci@0,0/pci-ide@1f,2/ide@1/cmdk@1,0
       2. c9d0 <WDC WD80-  WD-WMAM9SH8120-0001-74.50GB>
          /pci@0,0/pci-ide@1f,5/ide@0/cmdk@0,0
3. c10d0 <drive type unknown>
          /pci@0,0/pci-ide@1f,5/ide@1/cmdk@0,0
Specify disk (enter its number): ^D

创建tank pool
root@opensolaris:~# zpool create tank c8d1
root@opensolaris:~#
root@opensolaris:~# zpool list tank
NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
tank   696G   106K   696G     0%  ONLINE  -
root@opensolaris:~#

-----------------

Using the ZFS Command

Now let's use the 'zfs list -r tank' command to review the datasets on the root pool, or “rpool.”

First, let's look at the column names in the output display.

The “NAME” column lists the name of the file system.

The “USED” and ”AVAIL” columns display the amount of space has been used used and the amount of space that is still available respectivey.

The REFER column displays the amount of data accessible within the specific file system, and the amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.

The “MOUNTPOINT” column identifies the directory where the file system resides.

The zfs  command is used to examine:

.datasets

Summary

ZFS is a new file system technology. It uses pools and datasets. Pools include virtual devices and storage devices. Datasets include file systems, volumes, snapshots, and clones. These components can be explored with the zpool and zfs commands.

Ready to move on? Click the exit button to return to the lesson menu and continue to the next lesson.

https://learning.sun.com/solc/files/solc/tblo_selfcontained/1179270410/module2/default.htm

Introduction

Now that you understand the basics of ZFS, let's discuss how to create a ZFS pool. In this lesson, you'll learn how to create a ZFS pool and why its important to use mirrored pools.

Creating a ZFS Pool

ZFS administration has been designed with simplicity in mind. Among the goals of the ZFS design is to reduce the number of commands needed to create a usable file system. When you create a new pool, a new ZFS file system is created and mounted automatically. Let me show you how its done.

Let's start by creating a simple single-device pool named "tank."

Use the "zpool create" command to create the pool by first identifying the pool name “tank” and then the device, c1t0d0 as follows:

Now use the "zpool status tank" command to see the results.

You now have a single-disk storage pool named tank, with a single storage device called c1t0d0.

Although it is possible to create a single-disk pool, a mirrored pool provides data redundancy and better protection again disk failures. We'll cover how to create a mirrored pool in the next section.

To learn more about mirrors, see Lesson 3: Mirrors.

zfs create
zfs destroy
zfs rollback
zfs rename
zfs list
zfs mount
zfs clone
zfs promote

--- sample -----
zpool create tank cit0d0
zpool status tank
root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          c8d1      ONLINE       0     0     0
errors: No known data errors
root@opensolaris:~#
---

Converting a Single-Device Storage Pool to a Mirrored Storage Pool

Mirrored storage pools are recommended over single-disk pools because mirrored pools can more effectively protect your data. After creating a single-disk pool, its is easy to convert it into a mirrored pool. Let's see how its done.

First, we'll use the “zpool status tank” command to see how the pool is configured.

The output shows us that currently there is only one device in the pool.

To convert this single device pool to a mirror, use the “zpool attach” command followed by the pool name, the existing device name, and the new device name.

Now, rerun the “zpool status tank” command to see if you were successful.

In the output, notice that the status listing includes the “scrub” status. When a new device is attached to a mirror, ZFS automatically duplicates all of the existing pool data onto the mirror device. This is called a “resilver.”

----
zpool attach tank c1t0d0 c1t1d0   做一个mirror
zpool status tank
Although its possible to create a single-disk pool, using mirrored pools is : true!
to convert a single-disk pool to a mirrored pool, you add a storage with which of the following commands?
attach

Summary

Creating ZFS pools is fast and simple. Just use the zpool create command and the device name and ZFS does the rest. However, make sure to follow up to convert the single-disk pool to a mirrored pool. More on this topic, see Lesson 3: Mirrors .

Summary

Creating ZFS pools is fast and simple. Just use the zpool create command and the device name and ZFS does the rest. However, make sure to follow up to convert the single-disk pool to a mirrored pool. More on this topic, see Lesson 3: Mirrors .

In a previous lesson, we created a single-device pool called 'tank.' Let's take another look at this pool. Use the “zpool status tank” command to review the pool configuration.

If you need to add more storage to this pool, start with the “zpool attach” command followed by the pool name, an existing device in the pool, and the new device that you want to attach.

Now use the zpool status tank command to see the results.

Review the OpenSolaris output on this page. Notice that both devices are now listed in the pool configuration. Also notice that both devices are now part of a “mirror” as identified in the “config” section. A mirror is a virtual device that stores identical copies of data on two or more disks. See Lesson 3: Mirrors for more information.

--

zpool status tank

zpool attach tank c1t0d0 c1t1d0

root@opensolaris:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c7d0 <DEFAULT cyl 30390 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
       1. c8d1 <ST375033-         9QK1MYJ-0001-698.63GB>
          /pci@0,0/pci-ide@1f,2/ide@1/cmdk@1,0
       2. c9d0 <WDC WD80-  WD-WMAM9SH8120-0001-74.50GB>
          /pci@0,0/pci-ide@1f,5/ide@0/cmdk@0,0
       3. c10d0 <drive type unknown>
          /pci@0,0/pci-ide@1f,5/ide@1/cmdk@0,0
Specify disk (enter its number): ^D
root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          c8d1      ONLINE       0     0     0
errors: No known data errors
root@opensolaris:~# zpool attach tank c8d1 c10d0
root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Dec  7 16:09:21 2009
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c8d1    ONLINE       0     0     0
            c10d0   ONLINE       0     0     0  73K resilvered
errors: No known data errors
root@opensolaris:~#

---

to add a device to the storage pool, you use the following ZFS command:

attach

Summary

Adding storage to a ZFS pool is easy. Simply use the “zpool attach” command combined with the pool and device names and ZFS does the rest. Simple, isn't it? Let's move on to the next topic.

Introduction

When administering a system, its often necessary to adjust and reconfigure your setup. Often this includes destroying storage pools.

Destroying a ZFS Pool

Sometimes you make a mistake or need to reconfigure your system. To destroy a pool that is no longer needed, simply use the “zpool destroy” command. Let me show you how its done.

First, use the “zpool status tank” command to review the pools on your system.

Review the image of the OpenSolaris output on this page. It looks like we have one pool named “tank” with two devices. Next, use the “zpool destroy” command plus the name of the pool you want to destroy.

Finally, use the “zpool status tank” command to see the results.

Review the image of the OpenSolaris output once again. Notice that the pool called 'tank' has been removed from the system.

---zpool status tank
zpool destroy tank
zpool status tank
----sample---


root@opensolaris:~# zpool destroy tank
root@opensolaris:~# zpool status tank
cannot open 'tank': no such pool
root@opensolaris:~#
---------------------

ZFS provides a safety feature that allows you to recover a destroyed pool if the devices haven't been reused.

For example, suppose we accidentally destroyed the tank pool. We would simply use the “zpool import -D command” followed by the pool name to reimport the pool.

Then you would use the “zpool list” command to see the results.

Notice that the tank pool has been successfully restored.

---------
zpool import -D tank
zpool status tank
-------------sample ----------------
root@opensolaris:~# zpool import -D tank
root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c8d1    ONLINE       0     0     0
            c10d0   ONLINE       0     0     0
errors: No known data errors
root@opensolaris:~#
-------------------------------------
the correct ZFS command to eliminate a pool is:
destroy

Summary

Now you know how to a create a ZFS pool, add storage, and destroy a pool if necessary. You even know how to get it back if you delete it on accident.

https://learning.sun.com/solc/files/solc/tblo_selfcontained/1179270410/module3/default.htm

Traditionally, storage management products use a convention called a “mirror.” A mirror is a virtual device that stores identical copies of data on two or more disks. If any disk in a mirror fails, any other disk in that mirror can provide the same data .

The topics in this lesson will teach you all about using a mirrored ZFS configuration to protect your data. However, you should already know the basic definition of a pool and how to create one. If you've skipped those lessons or are still unsure about them, go back and review.

If you're ready, click Next to continue.

What Is A Mirror?

A “mirror” is a kind of storage pool that keeps identical copies of data on two or more disks.

This redundancy provides basic storage protection because if one device fails, the data is still available from the other device (or devices) in the pool.

What are the Benefits of a Mirrored ZFS Configuration?

The benefit of using a mirrored ZFS configuration is that ZFS can attempt to recover the data in the event of a disk failure.

A ZFS storage pool is really just a tree of blocks. ZFS helps to identify data errors by storing the checksum of each block in its parent block pointer, not in the block itself. Every block in the tree contains the checksums for all its children, so the entire pool is self-validating.

When an error occurs, ZFS is able to automatically checks the other device in the mirror, and if it finds good data, it uses the good copy to repair the bad block.

a mirror is : a system that keeps a copy of the data on each one of the mirrorred devices
ZFS checksum feature allows it to:
check for failed blocks of data

Summary

In this topic you have learned that a mirrored ZFS configuration is a storage pool with built in redundancy. You also learned that a mirrored ZFS configuration is recommended because it can recover data in the event of a disk failure.

Introduction

ZFS uses a process called 'mirroring' to improve data security by creating redundancy in the system. This is done by grouping storage devices in pairs and making sure to that the data on each device is mirrored by the other. This arrangment is called a 'mirrored pool.'

In this lesson you'll learn how to set up a mirrored pool.

Creating a Mirrored ZFS Pool

Suppose want to create a mirrored ZFS storage pool. Here's how you do it.

Simply use the “zpool create” command followed by the pool name and device names. We'll create a pool called “tank” with two attached devices called “c1t0d0” and “c1t1do.”

Now use the “zpool status tank” command to see the results.

Notice that you now have a mirrrored pool named tank with two devices.

--------

zpool create tank mirror c1t0d0 c1t1d0

zpool status tank

Converting a Single-Device Pool to a Mirror

Mirrored storage pools are recommended rather than single-disk pools because mirrored pools can more effectively protect your data. After creating a single-disk pool, its is easy to convert it into a mirrored pool. Let's see how its done.

First, we'll use the “zpool status tank” command to see how the pool is configured.

The output shows us that currently there is only one device in the pool.

To convert this single device pool to a mirror, use the “zpool attach” command plus the pool name, the existing device name, and the name of the device you want to attach.

Now, rerun the “zpool status tank” command to see if you were successful.

In the output, notice that the status listing includes the “scrub” status. When a new device is attached to a mirror, ZFS automatically duplicates all of the existing pool data onto the mirror device. This is called a “resilver.”

---

zpool status tank

zpool attach tank c1t0d0 c1t1d0

zpool status tank

-----sample----

root@opensolaris:~# zpool create tank mirror c8d1 c10d0
root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c8d1    ONLINE       0     0     0
            c10d0   ONLINE       0     0     0
errors: No known data errors
root@opensolaris:~#
--------------------

--

to convert a single-device pool to multiple-device pool you use which of the following:

Summary

Creating ZFS pools is fast and simple. Just use the zpool attach command and the device name to convert your single-device pool to a mirrored-pool.

Introduction

While managing your ZFS mirror, you might want to modify the configuration. This could mean replacing one device with another or taking a device offline.

This topic will teach you how to manage these tasks.

Taking a Device Offline

ZFS allows individual devices to be taken offline or brought online. When hardware is unreliable or not functioning properly, ZFS continues to read or write data to the device, assuming the condition is only temporary. If the condition is not temporary, it is possible to instruct ZFS to ignore the device by bringing it offline. This is done with the “zpool offline” command.

Again, let's run the “zpool status tank” command to review our mirror configuration.

Suppose you wanted to take the device c1t1d0 offline for maintenance. You would type the following “zpool offline “ command followed by the pool name and then the device name.

Now let's run the “zpool status tank” command again to see what happened.

Notice that in the “Config” section the device is listed as “offline.” Also notice that the mirror's state is listed as “degraded.” This means that the mirror is operating with less than full capacity.

In addition, the “Status” line reports that one of the devices has been taken offline, and the “Action” line provides guidance about how to return the mirror to the normal online state.

zpool status tank

zpool offline tank c1t1d0

------------sample ---------------

root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c8d1    ONLINE       0     0     0
            c10d0   ONLINE       0     0     0
errors: No known data errors
root@opensolaris:~# zpool offline tank c10d0
root@opensolaris:~# zpool status tank
  pool: tank
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
scrub: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        tank        DEGRADED     0     0     0
          mirror    DEGRADED     0     0     0
            c8d1    ONLINE       0     0     0
            c10d0   OFFLINE      0     0     0
errors: No known data errors
root@opensolaris:~#

-----------------------------------

Bringing a Device Online

Once you have finished your maintenance tasks, you can easily bring the device back online. Simply use the 'zpool online” command accompanied by the pool name and the device name.

Then we'll use the “zpool status tank” command to check the results:

As you can see, the device c1t1d0 is back online and part of the mirrored pool.

zpool online tank c1t1d0

---------------sample-----------

root@opensolaris:~#  zpool online tank c10d0
root@opensolaris:~# zpool status tank
  pool: tank
state: ONLINE
scrub: resilver completed after 0h0m with 0 errors on Mon Dec  7 16:20:44 2009
config:
        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c8d1    ONLINE       0     0     0
            c10d0   ONLINE       0     0     0  1.50K resilvered
errors: No known data errors
root@opensolaris:~#

---------------------------------

Replacing One Device With Another

Sometimes you might want to replace one device with another. ZFS allows you to do this with a single operation. Just use the “zpool replace” command.

For example, let's look at our mirror called “tank.” We type in the “zpool status tank” command and review the output.

You'll notice that there are two devices in the pool: c1t0d0 and c1t1d0. Now we'll use the “zpool replace” to replace the device c1t10d0 with a new device named c1t2d0.

During this operation ZFS displays the following output showing that the device is being replaced.

Running the “zpool status tank” command again shows the new configuration.

Notice that the new device has replaced the old device in the mirror.

---
zpool status tank
zpool replace tank c1t1d0 c1t2d0
zpool status tank
It takes two commans in ZFS to replace one drive with another drive.
false

Summary

As you can see, managing ZFS pools is very simple. Just master a few simple commands and you can complete a variety of important tasks.

If you have any questions, please click the Back button and review. Otherwise, click the Exit button to return to the Main Menu and proceed to the next lesson.

不勝其煩,將OpenSolaris的sshd改成允許root用戶登錄了

因為最近學習openSolaris,裝了臺服務器,問題是出於安全考慮,要轉一次才能使用root用戶權限,煩啊!

通過修改/etc/ssh/sshd_config中的

#PermitRootLogin no
PermitRootLogin yes

svcadm restart ssh

再次登錄,ok!

記錄一下。生產環境慎用!

2009年12月4日星期五

opensolaris comstar iscsi 實驗

包檢查:

root@opensolaris:~# pkg info SUNWstmf
          Name: SUNWstmf
       Summary: Sun Common Multiprotocol SCSI Target
      Category: System/Hardware
         State: Installed
     Publisher: opensolaris.org
       Version: 0.5.11
Build Release: 5.11
        Branch: 0.111
Packaging Date: Fri May  8 16:37:12 2009
          Size: 2.28 MB
          FMRI: pkg:/SUNWstmf@0.5.11,5.11-0.111:20090508T163712Z
root@opensolaris:~# pkg info SUNWiscsidm
          Name: SUNWiscsidm
       Summary: Sun iSCSI Data Mover
      Category: System/Hardware
         State: Installed
     Publisher: opensolaris.org
       Version: 0.5.11
Build Release: 5.11
        Branch: 0.111
Packaging Date: Fri May  8 16:10:41 2009
          Size: 711.90 kB
          FMRI: pkg:/SUNWiscsidm@0.5.11,5.11-0.111:20090508T161041Z
root@opensolaris:~#
root@opensolaris:~# pkg info SUNWiscsit
          Name: SUNWiscsit
       Summary: Sun iSCSI COMSTAR Port Provider
      Category: System/Hardware
         State: Installed
     Publisher: opensolaris.org
       Version: 0.5.11
Build Release: 5.11
        Branch: 0.111
Packaging Date: Fri May  8 16:10:47 2009
          Size: 647.71 kB
          FMRI: pkg:/SUNWiscsit@0.5.11,5.11-0.111:20090508T161047Z
root@opensolaris:~#

空間創建:

root@opensolaris:~# zfs create -V 1G mypool/vol
root@opensolaris:~# zpool list mypool
NAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
mypool    74G   475K  74.0G     0%  ONLINE  -
root@opensolaris:~# zfs list mypool/vol
NAME         USED  AVAIL  REFER  MOUNTPOINT
mypool/vol     1G  71.8G    16K  -
root@opensolaris:~#

安裝 storage-server 和SUNWiscsit

root@opensolaris:~# pkg info SUNWiscsit
          Name: SUNWiscsit
       Summary: Sun iSCSI COMSTAR Port Provider
      Category: System/Hardware
         State: Installed
     Publisher: opensolaris.org
       Version: 0.5.11
Build Release: 5.11
        Branch: 0.111
Packaging Date: Fri May  8 16:10:47 2009
          Size: 647.71 kB
          FMRI: pkg:/SUNWiscsit@0.5.11,5.11-0.111:20090508T161047Z
root@opensolaris:~#
root@opensolaris:~# pkg info storage-server
pkg: no packages matching the following patterns you specified are
installed on the system.  Try specifying -r to query remotely:
        storage-server
root@opensolaris:~#
root@opensolaris:~# pkg install storage-server
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  16/16     845/845   28.58/28.58
PHASE                                        ACTIONS
Install Phase                              1657/1657
root@opensolaris:~#

root@opensolaris:~# svcs -a |grep stmf
disabled       16:10:50 svc:/system/stmf:default
root@opensolaris:~# svcadm enable stmf
root@opensolaris:~# svcs -a |grep stmf
online         16:13:25 svc:/system/stmf:default
root@opensolaris:~#

root@opensolaris:~# stmfadm list-state
Operational Status: online
Config Status     : initialized
root@opensolaris:~#

root@opensolaris:/dev/zvol/rdsk/mypool# pwd
/dev/zvol/rdsk/mypool
root@opensolaris:/dev/zvol/rdsk/mypool# ls -al
total 5
drwxr-xr-x 4 root root  4 2009-12-04 16:10 .
drwxr-xr-x 4 root root  4 2009-12-04 11:41 ..
drwxr-xr-x 3 root root  3 2009-12-04 16:10 iscsi
lrwxrwxrwx 1 root root 39 2009-12-04 16:10 vol -> ../../../../devices/pseudo/zfs@0:1c,raw
root@opensolaris:/dev/zvol/rdsk/mypool# sbdadm create-lu /dev/zvol/rdsk/mypool/vol
Created the following LU:
              GUID                    DATA SIZE           SOURCE
--------------------------------  -------------------  ----------------
600144f0d9cf880000004b18c5c30001      1073676288       /dev/zvol/rdsk/mypool/vol
root@opensolaris:/dev/zvol/rdsk/mypool#
l
root@opensolaris:/dev/zvol/rdsk/mypool# stmfadm add-view 600144f0d9cf880000004b18c5c30001
root@opensolaris:/dev/zvol/rdsk/mypool#
root@opensolaris:/dev/zvol/rdsk/mypool# stmfadm list-view -l 600144f0d9cf880000004b18c5c30001
View Entry: 0
    Host group   : All
    Target group : All
    LUN          : 0
root@opensolaris:/dev/zvol/rdsk/mypool#

root@opensolaris:/dev/zvol/rdsk/mypool# svcadm enable iscsi/target
root@opensolaris:/dev/zvol/rdsk/mypool# svcs iscsi/target
STATE          STIME    FMRI
online         16:21:11 svc:/network/iscsi/target:default
root@opensolaris:/dev/zvol/rdsk/mypool#
root@opensolaris:/dev/zvol/rdsk/mypool# itadm create-target
Target iqn.1986-03.com.sun:02:4a34aae0-f41e-6b82-9af0-eb7e8db6cec1 successfully created
root@opensolaris:/dev/zvol/rdsk/mypool#

測試機是winXP

現在最新的Initiator-2.08-build3825-x86fre.exe

url:http://www.microsoft.com/downloads/details.aspx?familyid=12cb3c1a-15d6-4585-b385-befd1319f825&displaylang=en

安裝之

Discovery –> add-->opensolaris的IP. default port 3260

Target –> “Log On” 如果發現”Connected”就對了

管理工具--》存儲--》磁盤管理--》發現新增的disk。

剩下的內容就是初始化,格式化,不說了

記錄一下!

基本上smb方式, iSCSI都測試了,就是權限問題了。繼續研究

2009年12月3日星期四

openSolaris ZFS 實現smb共享的實驗

小弟初學openSolaris 下實現smb 共享, 經過幾次失敗終於可以用了,記錄一下:

root@opensolaris:~# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c7d0 <DEFAULT cyl 30390 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
       1. c9d0 <WDC WD80-  WD-WMAM9SH8120-0001-74.50GB>
          /pci@0,0/pci-ide@1f,5/ide@0/cmdk@0,0
Specify disk (enter its number): ^D
root@opensolaris:~#
root@opensolaris:~# zpool create -f mypool c9d0
root@opensolaris:~# zpool list
NAME     SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
mypool    74G  74.5K  74.0G     0%  ONLINE  -
rpool    232G  8.99G   223G     3%  ONLINE  -
root@opensolaris:~#

root@opensolaris:~# zfs create -o casesensitivity=mixed mypool/Demo
root@opensolaris:~# zfs set compression=on mypool/Demo
root@opensolaris:~# zfs set snapdir=visible mypool/Demo
root@opensolaris:~# zfs set sharesmb=name=Demo mypool/Demo
root@opensolaris:~# zfs set quota=1G mypool/Demo
root@opensolaris:~# zfs set reservation=1G mypool/Demo
root@opensolaris:~# zfs get all mypool/Demo |egrep '(NAME|smb|comp|case|quota|reservation)'
NAME         PROPERTY              VALUE                  SOURCE
mypool/Demo  compressratio         1.00x                  -
mypool/Demo  quota                 1G                     local
mypool/Demo  reservation           1G                     local
mypool/Demo  compression           on                     local
mypool/Demo  casesensitivity       mixed                  -
mypool/Demo  sharesmb              name=Demo              local
mypool/Demo  refquota              none                   default
mypool/Demo  refreservation        none                   default
mypool/Demo  usedbyrefreservation  0                      -
root@opensolaris:~#
root@opensolaris:~# useradd  -d /mypool/smbtest smbtest
root@opensolaris:~# passwd smbtest
New Password:
Re-enter new Password:
passwd: password successfully changed for smbtest
root@opensolaris:~#
root@opensolaris:~# smbadm join -w Galaxy
After joining Galaxy the smb service will be restarted automatically.
Would you like to continue? [no]: y
Successfully joined Galaxy
root@opensolaris:~#
root@opensolaris:~# sharemgr show -vp
default nfs=()
zfs
    zfs/mypool/myfs nfs=() nfs:sys=(rw="@172.16.X.X/24" root="@172.16.X.X/24")
          /export/zfs1
    zfs/mypool/Demo smb=()
          Demo=/mypool/Demo
    zfs/mypool/myfs2 smb=()
          mypool_myfs2=/mypool/myfs2
root@opensolaris:~#

這是會出現類似這樣的介面:

root@opensolaris:/mypool/Demo# svcs -a |grep smb
online         12:48:40 svc:/network/smb/client:default
online*         12:48:41 svc:/network/smb/server:default
root@opensolaris:/mypool/Demo#

從remote訪問不行

reboot一次,結果ok,可以使用了。

smbd: kernel bind error: No such file or directory 問題處理

在opensolaris11上配置smb server

root@opensolaris:~# rem_drv smbsrv
root@opensolaris:~# pkg install SUNWsmbskr
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1         6/6     0.43/0.43
PHASE                                        ACTIONS
Install Phase                                  20/20
root@opensolaris:~# pkg install SUNWsmbs
DOWNLOAD                                    PKGS       FILES     XFER (MB)
SUNWsmbs                                     0/1        2/29     0.00/1.49
Completed                                    1/1       29/29     1.49/1.49
PHASE                                        ACTIONS
Install Phase                                  70/70
root@opensolaris:~#
root@opensolaris:~# add_drv smbsrv
Driver (smbsrv) is already installed.

root@opensolaris:~# svccfg import /var/svc/manifest/network/smb/server.xml
root@opensolaris:~#

root@opensolaris:~# svcadm enable -r smb/server
svcadm: svc:/milestone/network depends on svc:/network/physical, which has multiple instances.
root@opensolaris:~# svcs -a |grep smb
online         15:40:47 svc:/network/smb/client:default
maintenance    16:38:21 svc:/network/smb/server:default
root@opensolaris:~#

到這裏報錯了,沒有在solaris 上高過smb,不知道哪裏出問題了,怎麼辦?google

原來opensoalris的日誌目錄在

/var/svc/log

root@opensolaris:/var/svc/log# cat network-smb-server\:default.log
[ Dec  3 16:10:52 Disabled. ]
[ Dec  3 16:10:52 Rereading configuration. ]
[ Dec  3 16:36:29 Rereading configuration. ]
[ Dec  3 16:37:44 Rereading configuration. ]
[ Dec  3 16:38:19 Enabled. ]
[ Dec  3 16:38:20 Executing start method ("/usr/lib/smbsrv/smbd start"). ]
smbd: NetBIOS services started
smbd: kernel bind error: No such file or directory
smbd: daemon initialization failed
[ Dec  3 16:38:21 Method "start" exited with status 95. ]
[ Dec  3 16:40:00 Leaving maintenance because disable requested. ]
[ Dec  3 16:40:00 Disabled. ]
[ Dec  3 16:40:17 Enabled. ]
[ Dec  3 16:40:17 Executing start method ("/usr/lib/smbsrv/smbd start"). ]
smbd: NetBIOS services started
smbd: kernel bind error: No such file or directory
smbd: daemon initialization failed
[ Dec  3 16:40:18 Method "start" exited with status 95. ]
root@opensolaris:/var/svc/log#

繼續google之

http://www.opensolaris.org/jive/thread.jspa?threadID=70302&tstart=0中說“A reboot solved the problem.”

reboot機器後,果然

root@opensolaris:~# svcs -a |grep smb
online         17:04:07 svc:/network/smb/client:default
online         17:04:08 svc:/network/smb/server:default

好了,繼續。

2009年12月2日星期三

OpenSolaris下mount iso文件 和安裝包

如何在openSolaris下mount一個iso的鏡像文件呢?

第一步,決定那個設備用於掛接這個文件

root@opensolaris:~/Downloads# lofiadm -a sol-nv-b125-x86-dvd.iso
/dev/lofi/1

root@opensolaris:~/Downloads#

第二步:

root@opensolaris:~/Downloads# mkdir /mnt2
root@opensolaris:~/Downloads# mount -F hsfs /dev/lofi/1 /mnt2

root@opensolaris:~/Downloads# cd /mnt2
root@opensolaris:/mnt2# ls
autorun.inf  Copyright                    License     Solaris_11
autorun.sh   installer                    README.txt  Sun_HPC_ClusterTools
boot         JDS-THIRDPARTYLICENSEREADME  sddtool
root@opensolaris:/mnt2#

成功了,繼續

root@opensolaris:/mnt2# cd Solaris_11/
root@opensolaris:/mnt2/Solaris_11# ls
Docs  Misc  Patches  Product  Tools
root@opensolaris:/mnt2/Solaris_11# cd Product/
root@opensolaris:/mnt2/Solaris_11/Product# cp -rf SUNWjhrt SUNWjhdev SUNWj5dev SUNWj5rt SUNWj6rt SUNWjato  SUNWmconr SUNWmcon SUNWmcos SUNWmcosx SUNWmctag SUNWmfrun SUNWzfsgr SUNWzfsgu /var/spool/pkg

root@opensolaris:~# pkgadd

The following packages are available:
  1  SUNWj5dev     JDK 5.0 Dev. Tools (1.5.0_20)
                   (i386) 1.5.0,REV=2004.12.06.22.53
  2  SUNWj5rt      JDK 5.0 Runtime Env. (1.5.0_20)
                   (i386) 1.5.0,REV=2004.12.06.22.53
  3  SUNWj6rt      JDK 6.0 Runtime Env. (1.6.0_15)
                   (i386) 1.6.0,REV=2006.11.29.05.03
  4  SUNWjato      Java Studio Enterprise Web Application Framework
                   (all) 2.1.5,REV=2006.07.18.09.36
  5  SUNWjhdev     JavaHelp Development Utilities
                   (all) 2.0,REV=2008.10.08
  6  SUNWjhrt      JavaHelp Runtime
                   (all) 2.0,REV=2008.10.08
  7  SUNWmcon      Sun Java(TM) Web Console 3.1 (Core)
                   (i386) 3.1,REV=2008.08.25.16.44
  8  SUNWmconr     Sun Java(TM) Web Console 3.1 (Root)
                   (i386) 3.1,REV=2008.08.25.16.44
  9  SUNWmcos      Implementation of Sun Java(TM) Web Console (3.1) services
                   (i386) 3.1,REV=2008.08.25.16.44
10  SUNWmcosx     Implementation of Sun Java(TM) Web Console (3.1) services
                   (i386) 3.1,REV=2008.08.25.16.44

... 4 more menu choices to follow;
<RETURN> for more choices, <CTRL-D> to stop display:

11  SUNWmctag     Sun Java(TM) Web Console 3.1 (Tags & Components)
                   (i386) 3.1,REV=2008.08.25.16.44
12  SUNWmfrun     Motif RunTime Kit
                   (i386) 2.1.4,REV=10.2009.09.07
13  SUNWzfsgr     ZFS Administration for Sun Java(TM) Web Console (Root)
                   (i386) 1.0,REV=2009.09.16.20.27
14  SUNWzfsgu     ZFS Administration for Sun Java(TM) Web Console (Usr)
                   (i386) 1.0,REV=2009.09.16.20.27

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance <SUNWj5dev> from </var/spool/pkg>

JDK 5.0 Dev. Tools (1.5.0_20)(i386) 1.5.0,REV=2004.12.06.22.53
Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Using </usr> as the package base directory.
## Processing package information.
## Processing system information.
   2 package pathnames are already properly installed.
## Verifying package dependencies.
WARNING:
    The <SUNWj5rt> package "JDK 5.0 Runtime Env.
    (1.5.0_01)" is a prerequisite package and should be
    installed.
WARNING:
    The <SUNWmfrun> package "Motif RunTime Kit" is a
    prerequisite package and should be installed.

Do you want to continue with the installation of <SUNWj5dev> [y,n,?]

一路y下去了

Installation of <SUNWzfsgu> was successful.

root@opensolaris:~# svccfg
svc:> select system/webconsole
svc:/system/webconsole> setprop options/tcp_listen=true
svc:/system/webconsole> quit

root@opensolaris:~# /usr/sbin/smcwebserver restart
Restarting Sun Java(TM) Web Console Version 3.1 ...
The console is running

root@opensolaris:~# netstat -a|grep 6789
      *.6789               *.*                0      0 49152      0 LISTEN
      *.6789                            *.*                             0      0 49152      0 LISTEN
root@opensolaris:~#

成功了