公告版位

step 1) 建立一個6G的空檔os.img

$ dd if=/dev/zero of=/root/os.img bs=1M count=6144

 

step 2) 將此6G空檔轉換成ext3的img格式

$ mke2fs -t ext3 -m 0 /root/os.img

dreamtails 發表在 痞客邦 留言(0) 人氣()

開機時若出現,以下訊息
=================================
Give root password for maintenance
(or type Control-D to continue):
================================= 

 

可以重新mount / 看看是否可以解決!

$ mount -o remount,rw /

dreamtails 發表在 痞客邦 留言(0) 人氣()

格式1:${var#pattern}

把pattern與var變數值做比對時,是從var變數值的前面部分比對起,如果有符合之處,就刪除變數值中最短的部分,並傳回其餘的變數值。

[centos@~]$ var=/home/snoopy/dir/file
[centos@~]$ echo ${var#/*/}
--------------------------------------------
snoopy/dir/file
-------------------------------------------- 

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

我們需要使用到Linux command: sshpass

到此下載並自行安裝:http://sourceforge.net/projects/sshpass/

用法:

$ sshpass -p <密碼> ssh <使用者>@<主機> <指令>

dreamtails 發表在 痞客邦 留言(0) 人氣()

step1) $ yum install expect

step2) $ vim ssh.login.exp

------------------------------------------------------
#!/usr/bin/expect -f

set HOST [lindex $argv 0]
set USER [lindex $argv 1]
set PASS [lindex $argv 2]
set CMD [lindex $argv 3]
set timeout -1

spawn ssh -o StrictHostKeyChecking=no $USER@$HOST
match_max 100000

#若出現要輸入password
expect "*?assword:*"
#則輸入$PASS變數的字串,\r表示<Enter>鍵
send -- "$PASS\r"
send -- "\r"

expect "#"
send -- "$CMD\r"
expect eof
------------------------------------------------------

 

step3) $ expect ssh.login.exp 192.168.1.1 root password 'uname -a'

      root是帳號
      password是密碼
      uname -a是指令


dreamtails 發表在 痞客邦 留言(0) 人氣()

# ipconfig /flushdns

Windows IP 設定

成功清除 DNS 解讀器快取。

dreamtails 發表在 痞客邦 留言(0) 人氣()

情境:大於2TB以上的硬碟,若要使用fdisk做分割partition的動作,可能會出現一些警語或是無法查看相關訊息,因此要使用parted指令來做切割partition(並使用GPT格式)。

 

step 1) 安裝parted套件

# yum install -y parted

dreamtails 發表在 痞客邦 留言(0) 人氣()

$ yum install -y rdesktop

$ rdesktop -a 16 192.168.1.1

   -a 16的意思是指畫面用16-bit 顯示

dreamtails 發表在 痞客邦 留言(0) 人氣()

一、安裝與設定VNC Server

Step 1) 安裝vnc-server package

(此為CentOS 5.5安裝package方式)
[root]$ yum install -y vnc-server

(此為CentOS 6.2安裝package方式)
[root]$ yum install -y tigervnc-server

dreamtails 發表在 痞客邦 留言(0) 人氣()

一、YUM Server環境建置:

Step 1) 下載mirrordir套件安裝

mirrordir:http://pkgs.repoforge.org/mirrordir/

 

Step 2) 下載yum-arch套件安裝(自動產生headers資料夾)

yum-arch:http://rpm.pbone.net/index.php3/stat/4/idpl/4852179/com/yum-arch-2.2.2-2.el5.noarch.rpm.html

 

Step3) 安裝createrepo套件(建立索引檔用)

$ yum install -y createrepo

 

Step 4) 安裝並啟動httpd套件

$ yum install -y httpd

 

dreamtails 發表在 痞客邦 留言(1) 人氣()

原本在用的一台Server有四張網卡,分別是eth0, eth1, eth2, and eth3

我們都是使用eth2來做PXE的CentOS deploy

結果因應工程師的需求,裝了一張兩個ports的10G網卡

想說就直接照著裝,因為我們還是要使用原本的eth2來作deploy,

結果一直不行,deploy時,OS會使用eth0去跟DHCP Server要IP,

怎麼會這樣呢? 東找找、西找找,才發現10G的一張網卡接上後,

OS把這張10G網卡的兩個ports認為是eth0 and eth1,

相對的我們原本的eth0, eth1, eth2, and eth3就往後順移兩個號碼,

也就是eth2, eth3, eth4, and eth5,

所以我們最後是tftpboot目錄裡的設定與kickstart file設定由原本eth2改為eth4後,

就成功deploy了。終於找了問題也順利解決。

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

dreamtails 發表在 痞客邦 留言(0) 人氣()

以下資料來源參考自:
(1) http://ssorc.tw/?p=198
(2) http://blog.yam.com/keynes0918/article/31351174

 

環境:
(1) Windows AD Server:
                                   Homename:AD.COM
                                   IP Address:10.100.99.99
(2) CentOS 6.2 x64:
                                   Homename:HH-AABBCCSS
                                   IP Address:10.100.1.1 (以下設定並未用到)

(3) 需要一組用來驗證AD Server的一般使用者帳號(A12345)/密碼(以下範例使用的非管理者administrator帳號/密碼,而是一般使用者)。

dreamtails 發表在 痞客邦 留言(0) 人氣()

使用檔案系統格式為Ext3, 預設OS會開啟ACL功能,但現在我們要mount一個新的磁區,就需要另外開啟ACL功能,方法如下:

(1) mount -t ext3 -o remount,acl /

(2) vim /etc/fstab

--------------------------------------------------------------
 /dev/sdb1    /mnt     ext3    defaults,acl    1    0
--------------------------------------------------------------

dreamtails 發表在 痞客邦 留言(0) 人氣()

step 1) $ yum install -y setuptool ntsysv system-config-*

dreamtails 發表在 痞客邦 留言(0) 人氣()