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

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年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年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月11日星期一

solaris 10 自身帶gcc make

嘗試在solaris10下編譯apache, 儘管已經下載了gcc但是還是不能通過

報錯“make: can not found”

手工運行一把,確實如此,怎麼辦呢?google

發現soalris下確實已經有了gcc和make的program,但是位置沒有在/usr/bin or /sbin/下

gcc 在這裏:

bash-3.00# cd /usr/sfw/bin

bash-3.00# ./gcc -v
Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
Configured with: /sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
bash-3.00#

bash-3.00# cd /usr/ccs/bin

bash-3.00# ./make
make: Fatal error: No arguments to build

不熟悉solaris, 發現沒有default home directory, 只好把加載到 /etc/profile文件中

PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin
export PATH

從新configure;make ;make install

+--------------------------------------------------------+
| You now have successfully built and installed the      |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the         |
| (initially created or preserved) configuration files   |
|                                                        |
|   /user/local/apache/conf/httpd.conf
|                                                        |
| and then you should be able to immediately fire up     |
| Apache the first time by running:                      |
|                                                        |
|   /user/local/apache/bin/apachectl start
|                                                        |
| Thanks for using Apache.       The Apache Group        |
|                                http://www.apache.org/  |
+--------------------------------------------------------+

ok, 記錄一下,備忘!

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#

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