



前幾天在DS上面跑rsync備份的時候,發現會突然整個系統HANG住,沒辦法動作,ctrl-c也沒辦法中斷,只能強制REBOOT,
重開機之後,想說可能是ZFS有問題?所以執行了zpool status 來看一下狀況,果然有提示錯誤出現
[root ~]#zpool status -v zp
pool: zp
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: http://www.sun.com/msg/ZFS-8000-8A
scrub: scrub in progress for 1h19m, 46.10% done, 1h33m to go
config:NAME STATE READ WRITE CKSUM
zp ONLINE 0 0 0
raidz1 ONLINE 0 0 2
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0
da4 ONLINE 0 0 0errors: Permanent errors have been detected in the following files:
以下這兩行本來是有檔案名稱的,但是我手賤去把這兩個檔案砍掉了,結果就變成這副模樣..
zp:<0×1819>
zp:<0x181b>
但是不管是去查提示中的 sun原廠的訊息,或者是上google去查,提到的訊息都很模糊,只說試試看把錯誤的檔案從backup中restore回來?如果不行的話,可能整個POOL就要打掉!?瞎瞇!?整個POOL打掉?見鬼了咧!為了兩個檔案要砍掉整個POOL?林北又不是發神經說,而且也沒有人這樣做的啦,又不是說RAID出問題,只是因為不知道啥原因就要把POOL砍掉?
後來想到 zpool 有個scrub的指令,可以清除(清理、刷洗、whatever ..) ZPOOL ,那就來執行看看吧,執行過程中,系統又死當了一次,不過這次好像是VM的問題,重開之後,再看一下zpool 會發現scrub的指令繼續在跑,在執行的過程中,系統會變得比較緩慢,由於預估時間大概四個多小時,我就放著給他跑,然後剛剛想說看一下進度,結果系統反應變好快,似乎是整理完了,看一下訊息,果然沒錯。
[root ~]#zpool status -v zp
pool: zp
state: ONLINE
scrub: scrub completed after 2h2m with 0 errors on Wed Aug 18 12:14:19 2010
config:NAME STATE READ WRITE CKSUM
zp ONLINE 0 0 0
raidz1 ONLINE 0 0 6
da1 ONLINE 0 0 0 12K repaired
da2 ONLINE 0 0 0 12K repaired
da3 ONLINE 0 0 0 12K repaired
da4 ONLINE 0 0 0 12K repairederrors: No known data errors
看來是暫時沒問題了,只是可能還是要想辦法搞清楚到底是啥原因造成的




之前為了找可以在Win7上面用的vshadow.exe 找了好久,又是去微軟安裝甚麼SDK,又是去下載了甚麼一堆有的沒的
後來在sourceforge上面找到一個vscsc,本來也是不行的 會發生這樣的錯誤
D:\vscsc-latest\vscsc\x86\winxp>vscsc -q
VSCSC.EXE 2.2 – Volume Shadow Copy Simple Client for Windows XP
This is a modified version of the original Volume Shadow Copy Client
by Microsoft (VSHADOW.EXE), originally bundled with the VSS SDK 7.2
for WinXP/Win2003.
(Option: Query all shadow copies)Querying all shadow copies in the system …
ERROR: COM call L”m_pVssObject->Query(GUID_NULL, VSS_OBJECT_NONE, VSS_OBJECT_SNA
PSHOT, &pIEnumSnapshots )” failed.
- Returned HRESULT = 0×80042308
- Error text: VSS_E_OBJECT_NOT_FOUND
- Please re-run VSCSC.EXE with the /tracing option to get more detailsD:\vscsc-latest\vscsc\x86\winxp>
結果發現在同樣x86目錄底下 還有一個 win2k3的目錄,想說死馬當活馬醫,加減執行看看,沒想到就給他成功了 天啊,這真是太神奇了
D:\vscsc-latest\vscsc\x86\win2k3>vscsc -q
VSCSC.EXE 2.2 – Volume Shadow Copy Simple Client for Windows XP
This is a modified version of the original Volume Shadow Copy Client
by Microsoft (VSHADOW.EXE), originally bundled with the VSS SDK 7.2
for WinXP/Win2003.
(Option: Query all shadow copies)
- Setting the VSS context to: 0xffffffffQuerying all shadow copies in the system …
* SNAPSHOT ID = {fa8798ba-db07-412c-be45-178e1b292b4f} …
– Shadow copy Set: {e6857592-3b00-4a3f-a63c-3c4e17679f43}
– Original count of shadow copies = 2
– Original Volume name: \\?\Volume{ffa032c1-9f8a-11df-9eb8-806e6f6e6963}\ [C:
\]
– Creation Time: 2010/8/15 ?? 07:00:13
– Shadow copy device name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6
– Originating machine: V2S-PC
– Service machine: V2S-PC
– Not Exposed
– Provider id: {b5946137-7b9f-4925-af80-51abd60b20d5}
– Attributes: No_Auto_Release Persistent Client_accessible Differential* SNAPSHOT ID = {016e816e-02ae-4800-a951-bd3bb24df64c} …
– Shadow copy Set: {22ba9b3f-d47a-4ba7-a85d-b26d6ae94402}
– Original count of shadow copies = 2
– Original Volume name: \\?\Volume{ffa032c1-9f8a-11df-9eb8-806e6f6e6963}\ [C:
\]
– Creation Time: 2010/8/17 ?? 02:48:25
– Shadow copy device name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy11
– Originating machine: V2S-PC
– Service machine: V2S-PC
– Not Exposed
– Provider id: {b5946137-7b9f-4925-af80-51abd60b20d5}
– Attributes: No_Auto_Release Persistent Client_accessible Differential
不過感覺使用上還是有點問題 還是要多測試看看才知道到底能不能用在辦公室環境..
Download Link : vscsc




原始資料:http://piotrkosoft.net/pub/mirrors/debian-www/doc/manuals/reference/debian-reference.zh-tw.html#s-backup
rdiff-backup提供了簡單好用的方法對任何檔案內含連結進行歷史差異備份。例如要對~/目錄下的所有檔案備份到/mnt/backup:
$ rdiff-backup --include ~/tmp/keep --exclude ~/tmp ~/ /mnt/backup
從該文文件案包中取出三天前的舊資料恢復到~/old目錄:
$ rdiff-backup -r 3D /mnt/backup ~/old
參閱rdiff-backup(1)。
pdumpfs進行每日備份pdumpfs是一種簡單的每日備份系統,與Plan9的dumpfs一樣,它每天都儲存系統快照。任何時候都可以用它來恢復到某天的系統狀態。請使用pdumpfs和cron來備份你的home目錄。
在目的地目錄中,pdumpfs以YYYY/MM/DD的方式建立系統快照。第一次執行時,它將所有來來源檔案拷貝到快照目錄。從每二次執行起,pdumpfs只有拷貝更新的或開新檔案的檔案,對於沒有改變的檔案用硬連結方式指向前一天的系統快照,以此來節省硬碟空間。
$ pdumpfs src-dir dest-dir [dest-basename]
See pdumpfs(8).




今天早上無意中看到的一個檔案
[root proc]#ls -laSr –block=G
lrwxrwxrwx 1 root root 1G 2010-07-21 10:57 net -> self/net
lrwxrwxrwx 1 root root 1G 2010-07-21 10:57 mounts -> self/mounts
lrwxrwxrwx 1 root root 1G 2010-07-21 10:17 self -> 18805
dr-xr-xr-x. 24 root root 1G 2010-07-13 17:55 ..
-r——– 1 root root 131072G 2010-07-21 10:57 kcore
居然用去了 131072G的空間!? 見鬼了!




參考網址:http://www.apics.co.uk/content/zfs-snapshot-script
修改了時間格式以及加入zfs 的路徑
BSD 這一點很奇怪,如果加入crontab 去呼叫這隻script ,會發生錯誤
mail中看到的訊息是zfs: command not found.
後來才想到原來的script中,zfs沒加入路徑,所以會造成這樣的錯誤,當然也可能是我系統預設的路徑沒改的關係。
總之,加入路徑之後,就都解決了~
#!/bin/sh
# beerware license, written by Aldis Berjoza (aldis@bsdroot.lv)[ $# = 0 ] && cat << EOF
Syntax:
${0##./} [-a seconds] [-p prefix] [-P postifx] [-r] z/fs1 [[[-r] z/fs2] …]Options:
-a seconds = set how long snapshot should be kept (in seconds)
-p prefix = prefix snapshots with prefix
-P postifx = postifx snapshots with postfix
-r = recursive snapshots
EOFage=2592000 # default max snapshot age in seconds (30 days)
[ "$1" = '-a' ] && { age=$2; shift 2; }
[ "$1" = '-p' ] && { prefix=$2; shift 2; }
[ "$1" = '-P' ] && { postfix=$2; shift 2; }tfrmt=”%Y-%m-%d”
ntime=`date +$tfrmt`
while [ $1 ]; do
[ $1 = '-r' ] && { zopt=$1; shift; } || zopt=”
/sbin/zfs snapshot $zopt $1@${prefix}${ntime}${postfix}
shift
donedtime=`date +%s-$age | bc -l`
for i in `/sbin/zfs list -H -t snapshot | awk ‘{print $1}’ | grep -E -e “^.*@${prefix}20[0-9]{2}-[01][0-9]-[0-3][0-9]${postfix}$”`; do
[ $dtime -gt $(date -j -f $tfrmt $(echo $i | sed -e "s/^.*@${prefix}//" -e "s/${postfix}$//") +%s) ] && /sbin/zfs destroy $i
done
exit 0




最近因為安裝的機器越來越多,pietty 在連線的時候原本的設定是在左上角的TITLE 顯示hostname
但是這些機器有的是重灌之後,還是使用一樣的IP位置,變成說只看HOSTNAME有時候會造成不知道是連到哪一台了..
所以想說找看看有沒有方法可以修改title 顯示,加入hostname & IP位置,這樣會比較好區別
以下是設定方法
Fedora Core
修改 ~/.bashrc
加入
export title=`hostname`
export ip=`/sbin/ifconfig eth0 | awk ‘/inet addr/ {print $2}’ | cut -f2 -d “:”`
export PS1=’\e]2; \[$title -\] \[$ip -\] \u\w\a[\u \W]\$’
source ~/.bashrc 看看有沒有成功
有的話TITLE應該會變成這樣
以上修改參考:http://dev.firnow.com/course/6_system/linux/Linuxjs/20100325/201257.html
cd /usr/ports/shells/bash
make install clean
執行chsh (change shell)
將shell 修改成 /usr/local/bin/bash
#Changing user information for root.
Login: root
Password: ***************************************
Uid [#]: 0
Gid [# or name]: 0
Change [month day year]:
Expire [month day year]:
Class:
Home directory: /root
Shell: /usr/local/bin/bash <—修改這邊
Full Name: Charlie &
Office Location:
Office Phone:
Home Phone:
Other information:
接著修改 /etc/profile 加入
export title=`hostname`
export ip=`/sbin/ifconfig em0 | awk ‘/inet/ {print $2}’ | cut -f2 -d “:”` <—em0 要依照自己的網路卡代號做修正
export PS1=’\e]2; \[$title -\] \[$ip -\] \u\w\a[\u \W]\$’
alias ls=’ls -fGa’
alias rm=’rm -i’
alias mv=’mv -i’
重新登入 就可以看到效果了
update
修改/etc/profile
加入
LC_CTYPE=en_US.ISO8859-1; export LC_CTYPE
LC_CTYPE=zh_TW.Big5; export LC_ALL
LANG=zh_TW.Big5; export LANG
就可以看到Big5編碼的檔案名稱




早上看到這個測試軟體,就去抓來玩玩看
VM Host:
========================================================================
BYTE UNIX Benchmarks (Version 5.1.2)System: storage.pic.com.tw: GNU/Linux
OS: GNU/Linux — 2.6.33.5-112.fc13.x86_64 — #1 SMP Thu May 27 02:28:31 UTC 2010
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap=”UTF-8″, collate=”UTF-8″)
CPU 0: AMD Athlon(tm) II X4 630 Processor (5626.7 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, AMD virtualization, SYSCALL/SYSRET
CPU 1: AMD Athlon(tm) II X4 630 Processor (5625.9 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, AMD virtualization, SYSCALL/SYSRET
CPU 2: AMD Athlon(tm) II X4 630 Processor (5625.8 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, AMD virtualization, SYSCALL/SYSRET
CPU 3: AMD Athlon(tm) II X4 630 Processor (5625.8 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, AMD virtualization, SYSCALL/SYSRET
12:18:28 up 2:12, 2 users, load average: 0.73, 0.54, 0.35; runlevel 5————————————————————————
Benchmark Run: 二 7月 13 2010 12:18:28 – 12:47:27
4 CPUs in system; running 1 parallel copy of testsDhrystone 2 using register variables 24723357.6 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2547.2 MWIPS (9.9 s, 7 samples)
Execl Throughput 949.7 lps (29.6 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 610671.9 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 202411.6 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1294547.6 KBps (30.0 s, 2 samples)
Pipe Throughput 1650249.6 lps (10.0 s, 7 samples)
Pipe-based Context Switching 50693.6 lps (10.0 s, 7 samples)
Process Creation 3232.0 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 1724.9 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 1762.0 lpm (60.0 s, 2 samples)
System Call Overhead 1889898.6 lps (10.0 s, 7 samples)System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 24723357.6 2118.5
Double-Precision Whetstone 55.0 2547.2 463.1
Execl Throughput 43.0 949.7 220.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 610671.9 1542.1
File Copy 256 bufsize 500 maxblocks 1655.0 202411.6 1223.0
File Copy 4096 bufsize 8000 maxblocks 5800.0 1294547.6 2232.0
Pipe Throughput 12440.0 1650249.6 1326.6
Pipe-based Context Switching 4000.0 50693.6 126.7
Process Creation 126.0 3232.0 256.5
Shell Scripts (1 concurrent) 42.4 1724.9 406.8
Shell Scripts (8 concurrent) 6.0 1762.0 2936.6
System Call Overhead 15000.0 1889898.6 1259.9
========
System Benchmarks Index Score 790.1————————————————————————
Benchmark Run: 二 7月 13 2010 12:47:27 – 13:16:45
4 CPUs in system; running 4 parallel copies of testsDhrystone 2 using register variables 97760445.1 lps (10.0 s, 7 samples)
Double-Precision Whetstone 10170.4 MWIPS (9.9 s, 7 samples)
Execl Throughput 16149.0 lps (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 504884.5 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 151583.7 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1316255.6 KBps (30.0 s, 2 samples)
Pipe Throughput 6526919.7 lps (10.0 s, 7 samples)
Pipe-based Context Switching 1247079.8 lps (10.0 s, 7 samples)
Process Creation 44030.3 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 15106.8 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 2058.2 lpm (60.1 s, 2 samples)
System Call Overhead 4109974.6 lps (10.0 s, 7 samples)System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 97760445.1 8377.1
Double-Precision Whetstone 55.0 10170.4 1849.2
Execl Throughput 43.0 16149.0 3755.6
File Copy 1024 bufsize 2000 maxblocks 3960.0 504884.5 1275.0
File Copy 256 bufsize 500 maxblocks 1655.0 151583.7 915.9
File Copy 4096 bufsize 8000 maxblocks 5800.0 1316255.6 2269.4
Pipe Throughput 12440.0 6526919.7 5246.7
Pipe-based Context Switching 4000.0 1247079.8 3117.7
Process Creation 126.0 44030.3 3494.5
Shell Scripts (1 concurrent) 42.4 15106.8 3562.9
Shell Scripts (8 concurrent) 6.0 2058.2 3430.4
System Call Overhead 15000.0 4109974.6 2740.0
========
System Benchmarks Index Score 2856.5[root@storage unixbench-5.1.2]#
VM:FreeBSD 8.0(模擬雙核 , 2G RAM , 160G Mirror with onboard RAID Controller )
不知道為啥,這個版本(5.1.2)在 FreeBSD上面不能跑,所以就沒進行測試了..


More Options ...
Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 