2012年5月24日 星期四

手動mount LVM的Patition

列出所有 physical volumes

lvm pvscan

PV /dev/md5 VG vg1000 lvm2 [1.36 TB / 0 free]
Total: 1 [1.36 TB] / in use: 1 [1.36 TB] / in no VG: 0 [0 ]

使用 vgchange 在/dev下產生一個 vg1000 的目錄,並且在這個目錄下產生該有的device
vgchange -ay vg1000

找出裝置名
ls -l /dev/vg1000/

lrwxrwxrwx 1 root root 21 May 24 16:50 lv -> /dev/mapper/vg1000-lv

掛載檔案系統
mount /dev/mapper/vg1000-lv /mnt

Synology DS209內接硬碟(RAID1)改由USB外接存取

1.原NAS中硬碟改由usb外接

2.修復原 raid1
mdadm -A -R /dev/md5 /dev/sdq5

3.列出所有 physical volumes
lvm pvscan

PV /dev/md5 VG vg1000 lvm2 [1.36 TB / 0 free]
Total: 1 [1.36 TB] / in use: 1 [1.36 TB] / in no VG: 0 [0 ]

4.使用 vgchange 在/dev下產生一個 vg1000 的目錄,並且在這個目錄下產生該有的device
vgchange -ay vg1000

5.找出裝置名
ls -l /dev/vg1000/
lrwxrwxrwx 1 root root 21 May 24 16:50 lv -> /dev/mapper/vg1000-lv

6.掛載檔案系統
mount /dev/mapper/vg1000-lv /mnt

2012年3月14日 星期三

QNAP NAS TS212 安裝SVN

1.安裝SVN相關軟體
ipkg update
ipkg install svn

2.建立SVN資料目錄
mkdir /share/MD0_DATA/svn
svnadmin create /share/MD0_DATA/svn

3.修改SVN設定檔
修改 /share/MD0_DATA/svn/conf/passwd
[users]
harry = harryssecret
sally = sallyssecret

修改 /share/MD0_DATA/svn/conf/svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = passwd

4.執行 svnserve -d --listen-port=3690 -r /share/MD0_DATA/svn

Client 相關設定
Linux client  bash 中加入以下參數
export SVN_EDITOR="/usr/bin/vim"

2012年2月20日 星期一

測伺服器CPU滿載電源最大負載

測伺服器CPU滿載電源最大負載
1.執行以下程式,一個核心一次
cpuload.c
int main(){ int i; for(;;) i=1;}
2.量測電流負載

2012年1月12日 星期四

QNAP TS-412 自訂排程

1.安裝 cron, coreutilsipkg install cron
ipkg install coreutils

2.編輯 /opt/var/cron/cron.allow 內容如下admin
3.加入排程工作 /opt/bin/crontab -e 內容範例如下
*/1 * * * * date >> /tmp/crontab.test

2012年1月5日 星期四

HD SUPPORT TOOLS

1.安裝 hdsupp.lrp
apkg -i hdsupp.lrp

2.複製 MBR 至開機硬碟(/dev/sda)
dd if=/usr/sbin/mbr.bin of=/dev/sda bs=512 count=1

3.執行 syslinux 安裝 ldlinux.sys
syslinux /dev/sda1

2011年12月20日 星期二

QNAP TS-412 安裝 openssh

1.使用QPKG 外掛管理,安裝 Optware IPKG


2.安裝 openssh
ipkg update
ipkg install openssh

3.開機自動啟動 open sshd
修改 /etc/init.d/Optware.sh,尋找以下內容
case "$1" in
start)
...[elided]...
# adding Ipkg apps into system path ...
/bin/cat /etc/profile /bin/grep "PATH" /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
[ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile
;;
stop)

改為

case "$1" in
start)
...[elided]...
# adding Ipkg apps into system path ...
/bin/cat /etc/profile /bin/grep "PATH" /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
[ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile


# Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG
/bin/echo "Run Optware/ipkg /opt/etc/init.d/*"
source /etc/profile
# Start all init scripts in /opt/etc/init.d
# executing them in numerical order.
#
for i in /opt/etc/init.d/S??* ;do
# Ignore dangling symlinks (if any).
#[ ! -f "$i" ] && continue



case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
# End patch


;;
stop)