標題: Solaris FAQ v1.0 [打印本頁] 作者: ammy 時間: 2005-09-09 00:38 標題: Solaris FAQ v1.0 本文根據(jù)www.chinaunix.net Solaris版和其它網(wǎng)上資料整理而成,由于一些不可抗拒的原因和本人精力所限,不能將原作者一一列出,還請原作者見諒,在這里向那些熱心回答問題的版主和網(wǎng)友表示感謝,謝謝你們的無私奉獻,祝愿你們:身體健康、工作順利!
本人初學Solaris,在Sloaris版看見好多像我一樣的新手重復問著很多入門級的問題,這給Solaris版的管理和發(fā)展帶來了很多問題;就算再熱心的版主和網(wǎng)友每天回復著同樣的問題也會漸漸失去耐心的,所以我從本版2003年改版以來的舊帖子開始往前看,對常見的問題進行了總結(jié)。由于本人能力有限,同時也沒條件對所有的問題進行一一實驗,所以不保證本文的完全正確性,僅供參考之;有些問題可能沒有答案、有些可能有幾種解決方法,但最終目的是讓新手盡快的解決問題,并了解分析和解決問題的方法和相關知識。
最近聽說metor78版主病了,今夜匆忙對總結(jié)的問題進行了整理,雖然有一多半內(nèi)容我還沒仔細看呢,這么急的拿出來與大家共同探討,是希望當您看到本文并對您有所幫助的同時,您能為metor78版主送上您的祝福;雖然我和他也素不相識,但他的熱心和良好的人緣大家可以感覺到,讓我們一起祝福他:早日康復、好人一生平安!
本人是個新手,好多問題我也看不懂,難免本文之中有錯誤之處,還請熱心的高手指點。請不要給我回復郵箱地址,不然我頭會變大的,我只有晚上才可以上會兒網(wǎng),幾個月不上一次我的郵箱,讓我發(fā)郵件就是在迫害我!要回復就給個ftp吧,我會把word文件傳上去。
ammy
2005年9月9日凌晨作者: ammy 時間: 2005-09-09 00:40 標題: Solaris FAQ v1.0 001Q: 怎么學習Solaris 9?
A:
SA199、SA239、SA299、SA399,這些是新手需要看的基本的書吧!嘿嘿,我也只看了前2個,太多了,沒時間看,但是我知道有問題了去哪里去找相關資料去,所以你要學會自己學習、查資料。
002Q: 怎樣快速瀏覽到CU Solaris版以前頁面的問題
第1頁/共796頁 論壇時間為 北京時間 ,前往頁面 1, 2, 3 ... 794, 795, 796 下一個 ,我要是想去到300多或400多的話,是不是要一頁一頁的翻過去???
A:
呵呵,用如下的連接可以應付一下
http://72891.cn/forum/viewforum.php?f=6&show_type=&topicdays=&start=xxx
或者:
http://72891.cn/forum/viewforum.php?f=6&show_type=old&topicdays=&start=xxx
xxx=(page_you_want_go-1)*20
003Q: 用什么命令看到操作系統(tǒng)的版本號?
A:
#uname –a
SunOS SUN4 5.9 Generic_117171-05 sun4u sparc SUNW,Sun-Fire-480R
#uname -X
System = SunOS
Node = SUN4
Release = 5.9
KernelID = Generic_117171-05
Machine = sun4u
BusType = <unknown>;
Serial = <unknown>;
Users = <unknown>;
OEM# = 0
Origin# = 1
NumCPU = 2
004Q: Changing the System Host Name
A:
The host name of a system is contained in six files on the system. You must modify all of these files to successfully change a system’s host name. The files that contain the host name of a system are:
The /etc/node name
The /etc/hostname.xxn
The /etc/inet/hosts
The /etc/net/ticlts/hosts
The /etc/net/ticots/hosts
The /etc/net/ticotsord/hosts
/etc/inet/ipnodes (這個文件沒有的話就別動)
Note – The /etc/net/*/hosts files are referenced by the Transport layer interface (TLI).
To change the Ethernet address, perform the command:
# ifconfig hme1 ether 0a:0:20:f0:ac:61
This change of the Ethernet address is effective until you reboot the system. To make the change permanent, modify the /etc/rc2.d/S72inetsvc script by using the ifconfig command with the correct Ethernet address.
009Q: 網(wǎng)絡不通,顯示ether 0:0:0:0:0:0
一個舊的utral5,網(wǎng)絡連接有問題。hme0 ping不通網(wǎng)關。顯示ether 0:0:0:0:0:0,請問是什么問題?
A:
EPROM沒電了,更換新的。
010Q: 關于網(wǎng)卡的物理地址全為0
在系統(tǒng)啟動時能夠看到網(wǎng)卡的物理地址,但在進入系統(tǒng)后,用ifconfig -a命令卻看到網(wǎng)卡的物理地址全為0,而且網(wǎng)絡一直配不通。
A:
一、網(wǎng)卡壞了,硬件有問題,二、作了啟動腳本,將網(wǎng)卡的mac地址改了。
也可能是IDPROM有問題了,如機器太老電池不足了,或者那芯片有故障。
Solaris :
為/etc/defaultrouter ,只需要在里面填入網(wǎng)關。
015Q: 設置網(wǎng)關使用 /etc/defaultrouter文件,修改后無效
A:
那個需要重新啟動機器或修改defaultrouter后,你重新運行/etc/init.d/inetinit start,你得讓系統(tǒng)重新讀取/etc/defaultrouter中的數(shù)據(jù)。
可以臨時加,馬上生效:
route add default X.X.X.X
016Q: 在solaris中,用戶默認的Shell在什么文件中規(guī)定?
A: 可以查看/etc/passwd中,用戶默認的shell在這里設定。
017Q: 如果敲錯一個命令如何結(jié)束它呢?
A: solaris和SCO有少許不一樣,solaris可以采用ctrl+C來結(jié)束,而不是SCO的ctrl+Del
018Q: 怎么solaris8又是5.8,什么意思。
solaris 8 is the latest in a long line of operating environment releases that are based around the SunOS operating system which is currently in version 5.8
A:
兩者是不同的。注意SUN的稱呼:Solaris是 Operating Environment,SunOS是Operating System。也就是說,SunOS是核心,Solaris增加有外圍模塊。另外,Solairs是商標(trade mark)名稱,因此它是可賣的商品,而SunOS是copyright,不是單獨商品。
019Q: 終端和控制臺有什么區(qū)別?
A:
控制臺是終端之一,顧名思義是一個特殊終端,給系統(tǒng)管理員用的。系統(tǒng)的一些信息會送到上面。其他終端是一般用戶。
020Q: 用vi編輯,在插入模式后,有時系統(tǒng)會將一些系統(tǒng)反饋信息插入到當前正在編輯的文本中。
A:
vi 中出現(xiàn)一些輸出,是因為這個終端有一些后臺進程正在執(zhí)行,將輸出顯示到了當前終端,用 Ctrl+L 就恢復正常。作者: ammy 時間: 2005-09-09 00:41 標題: Solaris FAQ v1.0 021Q: /dev/dsk和/dev/rdsk到底有什么區(qū)別?
A:
通常情況下我們的數(shù)據(jù)都寫到文件系統(tǒng)里。這時使用的設備就是/dev/dsk,它是通過newfs /dev/rdsk 生成的。有時我們也使用裸設備寫數(shù)據(jù)。這時使用的設備就是/dev/rdsk,它也稱之為字符設備。
Displaying a Record of Login Activity
Use the last command to display a record of all logins and logouts with the most recent activity at the top of the output. The last command reads the binary file /var/adm/wtmpx, which records all logins, logouts, and reboots.
Displaying Users on the Local System
The who command displays a list of users currently logged in to the local
system. It displays each user’s login name, the login device (TTY port),
the login date and time. The command reads the binary file
/var/adm/utmpx to obtain this information and information about where
the users logged in from.
046Q: 關于顯卡的4個問題
1 在sparc下安裝顯卡,是不是不用裝driver? 還是說和顯卡的品牌有關?因為小弟在sunblade 100上直接插上PGX顯示卡就可以用。
2 Elite3D系列顯示卡的文件位置是/dev/fbs/ifb0 ;Creator和Creator 3D系列顯示卡的文件位置是/dev/fbs/ffb0 但是PGX顯示卡和PGX32顯示卡的文件是什么?
3 從哪里可以看到顯卡的類型和品牌?
4 另外小弟現(xiàn)在用的是sun blade 100,沒有外接顯卡,用的是板載,我看到/dev/fbs/下只有一個文件:m640,而且打不開,怎么回事?
A:
如果你安裝系統(tǒng)時選擇OEM安裝就不用裝驅(qū)動,也有例外,比如EXPRT 3D還得裝驅(qū)動。
prtdiag能看見顯示卡,其他的查硬件命令也可以。
/dev/fbs下面都是連接文件。
想知道更多的關于顯卡,可以去docs.sun.com查起詳細的安裝和配置資料。
047Q: 怎么配置雙顯卡,雙屏幕
A:
是要做雙屏幕嗎?
修改/usr/dt/config/Xservers在最后一行增加 :
-dev /dev/fb0 -dev /dev/fb1
呵呵,應該是注掉最后一行,打開倒數(shù)第二行,然后加上第二個顯示器的物理名。
048Q: 關于設置顯卡分辨率的問題
用m64config將顏色設為24位時,在g2界面下運行應用程序,出現(xiàn)提示探測不到顯卡,用m64config將顏色設為8位時,在g2界面下運行同樣應用程序,界面顏色變得很差,應用程序界面隨即關閉。
小妹是新手,不知道是不是顯卡的原因,問題出字哪里?
A:
The maximum resolution that is available with 24 bits per pixel depends on the amount of memory installed on the PGX card. For 2-MB PGX cards, the maximum available resolution is 800x600. For 4-MB cards, it is 1152x900. For 8-MB cards, it is 1920x1080. If there is not enough memory for the specified combination of resolution and depth, m64config displays an error message and exits.
make 一般在/usr/ccs/bin目錄下,root的path缺省設置中是沒有這個路徑的,需要在/.profile或/.cshrc中加上。 如果沒裝的話,安裝SUNWsprot 。另外,安裝SAMBA還需要GCC和CC,沒有的話下載安裝一個,也要把路徑加上喲。
要這么麻煩嗎,從http://www.sunfreeware.com/ 下載一安裝包就可以了嗎。下載完了之后上傳到 SUN ,解包,找到標準的配置文件,按照自己的實際環(huán)境配置好重起就可以用了,只是有關安全性的部分配置比較麻煩。
057Q: X86 下訪問WINDOWS下文件的大小寫問題
我的機器是win 98 + Solaris 8 X86 ,沒有安裝Wmware 和 X win32 等東西!
我在win98下有一個1.iso文件,我用rar將它解壓
然后在Solaris下用mount -f pcfs /dev/dsk/c0d0p1 /mnt 來訪問解壓后的文件都是大寫的目錄名稱,(Solaris 是對大小寫非常敏感) 除了刻光盤,我該怎么辦呢?
A:
先把iso文件的盤掛上去;
#lofiadm -a /PATHNAME/filename.iso;
#mount -F hsfs -o ro /dev/lofi1 /目標目錄 ;
你直接訪問目標目錄就行了;
lofiadm -a /path/to/your/iso /dev/lofi/1
mount -F hsfs /dev/lofi/1 /mnt
058Q: Solaris用X-Win32登陸如何保證斷線后程序繼續(xù)運行
A:
在運行軟件時加上nohup和&應該就可以了
比如需要給系統(tǒng)打patch,可以執(zhí)行:
# nohup /tmp/8/install_all_patches &
nohup是在退出帳戶后仍可以在后臺繼續(xù)執(zhí)行一個命令的命令。通常登錄退出時,UNIX殺死你在對話進程中啟動的所有進程。
這個命令的語法是:
nohup 命令 &
如果不把用nohup執(zhí)行的進程的輸出重定向,則標準輸出和標準錯誤都送到當前目錄中的文件nohup.out,如果你在當前目錄中沒有寫權限,則文件在你的主目錄中建立。
059Q: Solaris 8 啟動時的信息:unable to qualify my own domain name (student23)
Oct 29 14:52:12 student23 sendmail[204]: [ID 702911 mail.alert] unable to qualify my own domain name (student23) -- using short name
A:
檢查,/etc/hosts 可以看到
192.1.1.23 student23 logfile
這樣一行,我們注意到student23 這臺主機沒有對應的 domain ,所以,我們需要為他加上 domainname 。我們可以任意指定一個:
5 * * * * /usr/bin/ls /export/home >; /dev/sysmsg
/etc/console是你在命令行登陸中用的
/etc/pts/x是你在CDE中用的,或者是在telnet中用的。
你可以發(fā)到 console 口上,console 用/dev/sysmsg來表示。
062Q: 系統(tǒng)提示錯誤信息如下﹕ cron aborted: can't start cron; FIF0 exists
A:
Can't start cron - another cron may be running (/var/spool/cron/FIFO exists)
cron found that /var/spool/cron/FIFO already existed when it was started; this normally means that cron had already been started, but it may mean that an earlier cron terminated abnormally without removing /var/spool/cron/FIFO.
063Q: 我的鍵盤鎖了,用何方式解開?
A:
1.檢查硬件連接;
2.用“Ctrl+q”看看是否用了“Ctrl+s”鍵將屏幕鎖住了;
3.重啟系統(tǒng),
ok setenv input-device=keyboard
ok reset
064Q: sun服務器啟動需要輸入設備
服務器啟動時候需要連接一個輸入設備?今天做了實驗,發(fā)現(xiàn)對于280,啟動時候需要至少連接一個鍵盤,才能正常啟動,或者連接console端口?墒俏矣幸慌_ultra5可以沒有輸入設備就可以啟動。是否input-device可以設置成空?
A:
方法1:有一個設置修改一下就可以了, /etc/default/kbd,把那個keyboard的改掉就可以了
#KEYBOARD_ABORT=disable 句首的注釋號刪掉就可以了
方法2:It can run normal without keyboard. and you cann't set input-device with null, it support ttya , keyboard and diag-device
065Q: 運行的機器接上顯示器沒信號輸出
我的e250開機的時候,沒有連接顯示器!但是現(xiàn)在需要連接,但是連接之后顯示器沒有信號輸入!請問給為如何做?
A:
在 OK 狀態(tài)下用 printenv 看看現(xiàn)在的 output-device 是什么?如果不是 screen,用命令
OK setenv output-device screen
ok boot
The hostid will be reset to original one every time you reboot your server. So the best bet is to write a script and put it under /etc/rcS.d directory. To see your original hostid, init 0 and then type banner at ok prompt.
前提是你的OBP版本足夠的低
069Q: 如何修改機器hostid?
A:
其實是一個簡單的命令:
#adb -w -k
進入adb之后執(zhí)行如下命令,
hw_serial ?w '00' '01' '03' '04' '05' 0
其中,從01到05是新的hostid,不過要把數(shù)值從16進制轉(zhuǎn)成十進制,別告訴我你不會。另外,還有一種改法是改NVRAM的,能永久生效:
72 1 mkp
c0 c mkp
ff d mkp
ee e mkp
0 f 0 do i idprom@ xor loop f mkp
將hostid改為 72c0ffee ,不過,這種改法比較危險,需要小心
070Q: solaris 8 for sparc 安裝好了后沒有make指令?
A:
如果是默認安裝的話,pkgadd 一定會有的。
默認是沒有make命令的。如果你下載下來了?梢杂胮kgadd安裝的。要注意的是在下載時一定要選對你用的OS版本。作者: ammy 時間: 2005-09-09 00:45 標題: Solaris FAQ v1.0 071Q: 關于帶機問題,請問該如何設置,才能在第二次tar帶的時候不覆蓋第一次的東西
A:
1.使用n設備,比如:/dev/rmt/0mbn. 0n, 0bn........
2.使用mt命令,mt -f /dev/rmt/0mbn fsf 2..........
補充一點:磁帶的盒子上可得寫清楚了,是多個帶頭磁帶。
072Q: 開機時出現(xiàn)warning IP: … IP沖突?
開機時出現(xiàn):
warning IP:hardware address '00:01:6c:35:a6:49' trying to be our address 192.168.033.069!
是什么意思?
A:
IP沖突。有另一設備用的IP跟你相同。
把本機關閉,再ping一下192.168.033.069就知道了。
073Q: 發(fā)現(xiàn)有人非法登陸到系統(tǒng)以后,如何斷開該用戶的連接?
A:
用ps -ef | grep sh 看看用戶登陸的shell pid是什么,然后殺掉該用戶的shell。
who -u 會顯示用戶的pid, 然后kill掉就行了。
074Q: *.cpio文件,這是個什么類型的文件?怎么解?
A:
這是一個備份文件,是ssp的
cpio -idcmv < filename.cpio
075Q: Solaris 的系統(tǒng)配置文件一般在什么地方?
A: 可以查看/etc/system文件,里面有一些solaris啟動時默認加載的選項,包括共享內(nèi)存大小等的設置。
076Q: /etc/system文件中參數(shù)設定問題?
set shmsys:shminfo_shmmax=0x80000000
0x80000000是什么意思?
A:
那個是共享內(nèi)存的設置!內(nèi)存*1024*1000
0x80000000 有多大? 為2g
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use.
However, not all UNIX file systems (UFS) can be expanded this way. The concatenation is good only for small random I/O and for even I/O distribution. On the other hand, striping is advantageous for large sequential I/O and for uneven I/O distribution, because striping will increase performance by accessing data in parallel.
Note: If you wish to expand a file system to be a single striped metadevice, you can't do it on the fly. You have to dismount the file system, then copy or "move" over to a new partition.
How to Expand a File System With a Single Stripe, On the Fly
First, the file system has to be created and mounted as a one-way mirror metadevice; as in this example, with d80 mounted by /opt:
d81: Submirror of d80
State: Okay
Size: 10261520 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c1t12d0s0 0 No Okay
c1t13d0s0 1520 No Okay
c1t14d0s0 1520 No Okay
c1t15d0s0 1520 No Okay
Next, use the metattach command to dynamically concatenate a new slice, /dev/dsk/c0t1d0s1, to the end of the existing submirror of d80, d81:
d81: Submirror of d80
State: Okay
Size: 10261520 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c1t12d0s0 0 No Okay
c1t13d0s0 1520 No Okay
c1t14d0s0 1520 No Okay
c1t15d0s0 1520 No Okay
Stripe 1:
Device Start Block Dbase State Hot Spare
c0t1d0s1 0 No Okay
Then, use the growfs command to expand the mounted file system ( /opt) onto the raw metadevice /dev/md/rdsk/d80:
# growfs -M /opt /dev/md/rdsk/d80
/dev/md/rdsk/d80: 12336320 sectors in 8116 cylinders of 19 tracks,
80 sectors
6023.6MB in 129 cyl groups (63 c/g, 46.76MB/g, 5888 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 95872, 191712, 287552, 383392, 479232, 575072, 670912, 766752, 862592,
958432, 1054272, 1150112, 1245952, 1341792, 1437632, 1533472, 1629312,
1725152, 1820992, 1916832, 2012672, 2108512, 2204352, 2300192, 2396032,
2491872, 2587712, 2683552, 2779392, 2875232, 2971072, 3064352, 3160192,
3256032, 3351872, 3447712, 3543552, 3639392, 3735232, 3831072, 3926912,
4022752, 4118592, 4214432, 4310272, 4406112, 4501952, 4597792, 4693632,
4789472, 4885312, 4981152, 5076992, 5172832, 5268672, 5364512, 5460352,
5556192, 5652032, 5747872, 5843712, 5939552, 6035392, 6128672, 6224512,
6320352, 6416192, 6512032, 6607872, 6703712, 6799552, 6895392, 6991232,
7087072, 7182912, 7278752, 7374592, 7470432, 7566272, 7662112, 7757952,
7853792, 7949632, 8045472, 8141312, 8237152, 8332992, 8428832, 8524672,
8620512, 8716352, 8812192, 8908032, 9003872, 9099712, 9192992, 9288832,
9384672, 9480512, 9576352, 9672192, 9768032, 9863872, 9959712, 10055552,
10151392, 10247232, 10343072, 10438912, 10534752, 10630592, 10726432,
10822272, 10918112, 11013952, 11109792, 11205632, 11301472, 11397312,
11493152, 11588992, 11684832, 11780672, 11876512, 11972352, 12068192,
12164032, 12257312,
Now the file system (/opt) has been expanded dynamically, but it contains two stripes: stripe 0, which is the original one, and stripe 1, which is the expanded one.
The next step is to create a single stripe metadevice d82, which is the same size as the submirror d81.
In the following example, we create a stripe with three 2.1-Gbyte disks:
# metastat d82
d82: Concat/Stripe
Size: 12457920 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase
c0t11d0s2 0 No
c0t12d0s2 1520 No
c0t13d0s2 1520 No
Then, add the metadevice d82 as the second submirror to d80, and resync will automatically take place:
# metattach d80 d82
d80: submirror d82 is attached
# metastat d80
d80: Mirror
Submirror 0: d81
State: Okay
Submirror 1: d82
State: Resyncing
Resync in progress: 20 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 12336320 blocks
......
After the resync is complete, we have the following two-way mirrors:
d81: Submirror of d80
State: Okay
Size: 12336320 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c1t12d0s0 0 No Okay
c1t13d0s0 1520 No Okay
c1t14d0s0 1520 No Okay
c1t15d0s0 1520 No Okay
Stripe 1:
Device Start Block Dbase State Hot Spare
c0t1d0s1 0 No Okay
d82: Submirror of d80
State: Okay
Size: 12336320 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c0t11d0s2 0 No Okay
c0t12d0s2 1520 No Okay
c0t13d0s2 1520 No Okay
Finally, you can detach the submirror d81 from d80, and remove it completely:
d82: Submirror of d80
State: Okay
Size: 12336320 blocks
Stripe 0: (interlace: 32 blocks)
Device Start Block Dbase State Hot Spare
c0t11d0s2 0 No Okay
c0t12d0s2 1520 No Okay
c0t13d0s2 1520 No Okay
Now, you have dynamically expanded the file system (/opt) with a single stripe metadevice.
Please note: This procedure must be done during a quiet period, or the file system must be locked, in order to avoid possible changes to the file system during the sync. You can use the fuser -u command to check that no one is using the file system. If users are logged on overnight in their logging directory, the system admin could write-lock the file system if it is possible. In that case, users can still read files in the directory. As long as no one creates files during the sync, everything will be fine.
089Q: solaris的抓圖工具?
我需要編寫在solaris安裝sybase的說明書,最后能把安裝界面圖形放在說明書上,但是,如何才能像windows print screen一樣copysolaris的圖形界面呢? 有什么工具嗎?
A:
Solaris自帶呀!右鍵里面就有。
問題的解決:我改了我的ip地址,呵呵,我忘了10.4.64.16這個ip沒有在netscreen中開放出去,哈哈。!
094Q: 如何在solaris8中將dhcp的client端禁用?
A:
# pntadm -D -y X.X.X.X
095Q: Sun SPARC平臺的 Solaris8上Modem的撥號程序
A:
1. 在 http://www.columbia.edu/kermit/ckermit.html#download 下載cku206.tar.gz 文件
2.gzip -dc cku206.tar.gz|tar xvf -
3. make
4. make solaris8 (Solaris 8 with cc)
or
make solaris8g (Solaris 8 with gcc)
5. make install
6. ok, kermit的執(zhí)行文件被安裝在/usr/local/bin/下。
我曾用過kermit在linux和freebsd上撥號。
對于不同的操作系統(tǒng)只需在編譯的時候,選擇:
$ make linux (Linux, almost any version)
$ make freebsd44 (FreeBSD 4.4)
$ make solaris8 (Solaris 8 with cc)
$ make solaris8g (Solaris 8 with gcc)
$ make irix62 (IRIX 6.2)
即可。
096Q: 我怎樣才可以知道是誰正在或者曾經(jīng)使用過我的dns
A:
可以在你的named.conf文件中加入以下幾行:
---------------------------------------------------------------------------------
logging {
channel my_file
{
file "log.msgs";
severity dynamic;
};