對(duì)已安裝的舊版SCO Unix的大硬盤的充分利用
對(duì)已安裝的舊版SCO Unix的大硬盤的充分利用
-------------------------------------------------------------------------------- SCO Unix 3.2v4.2系統(tǒng)不支持大硬盤,為了使其能支持大硬盤,SCO公司提供了一張補(bǔ)丁盤Boot SLS for Unix/ODT,在安裝系統(tǒng)時(shí),用它來代替N1盤進(jìn)行安裝,可使系統(tǒng)支持大硬盤。但是,在金融系統(tǒng)的許多應(yīng)用的微機(jī)中,早已安裝了SCO Unix 3.2v4.2,并且許多機(jī)器中為大硬盤,在最初安裝時(shí),為了使其支持SCO Unix 3.2v4.2,不得不把硬盤的CMOS的柱面參數(shù)改為小于1024個(gè)柱面,致使硬盤大材少用。正是基于這個(gè)原因,本人把利用整個(gè)硬盤的心得體會(huì)奉獻(xiàn)給大家,在文中采用中英文對(duì)照方式,對(duì)一些命令進(jìn)行了較為詳細(xì)的說明,僅供參考,不當(dāng)之處敬請(qǐng)批評(píng)指正。
一、 環(huán)境介紹 本人所用機(jī)器為HP VL4 5/100(奔騰處理器),硬盤大小為3249M字節(jié)(16個(gè)磁頭,6296個(gè)柱面,每個(gè)磁道有63個(gè)扇區(qū)),已安裝了SCO Unix 3.2v4.2,為了使系統(tǒng)能支持該硬盤,在CMOS中早已把硬盤的參數(shù)改為1023個(gè)柱面,這樣3G多字節(jié)的硬盤實(shí)際上只用了527M字節(jié)。
二、 操作步驟 (一)安裝Boot SLS for Unix/ODT補(bǔ)丁盤 1.在超級(jí)用戶下,執(zhí)行命令#init 1(回車)進(jìn)入單用戶方式。 2.插入補(bǔ)丁盤Boot SLS for Unix/ODT。 3.執(zhí)行命令# custom -i(回車)安裝軟件包。在安裝時(shí)選擇安裝一個(gè)新產(chǎn)品,并安裝整個(gè)軟件包,安裝完時(shí)系統(tǒng)自動(dòng)重構(gòu)內(nèi)核,對(duì)一切問題回答y,然后敲回車退出custom。 (二)執(zhí)行reboot命令重啟機(jī)器,并在出現(xiàn)Ctrl+D提示時(shí)輸入超級(jí)用戶口令重新進(jìn)入單用戶 (三)執(zhí)行/etc/dkinit命令修改硬盤參數(shù)。具體情況如下 執(zhí)行#dkinit /dev/rhd00(回車)出現(xiàn)dkinit的主菜單: Hard Disk Drive 0 Configuration(第一硬盤配置) 1.Display current disk parameters(顯示當(dāng)前硬盤參數(shù)) 2.Modify current disk parameters(修改當(dāng)前硬盤參數(shù)) 3.Select default disk parameters(選擇缺省硬盤參數(shù)) Enter your choice or q to quit(敲入你的選擇或q退出):2 選擇2后顯示:Disk Parameters(硬盤參數(shù)) Values(參數(shù)值) ————————— 1.Cylinders(柱面數(shù)) 1023 2.Heads(磁頭數(shù))16 3.Write Reduce 0 4.Write Precomp 65535 5.Ecc 0 6.Control 8 7.Landing Zone(著陸區(qū)) 1023 8.Sectors/track(每道扇區(qū)數(shù)) 63 Enter a parameter to modify or q to return to the main menu: 對(duì)硬盤參數(shù)的第1、7項(xiàng)進(jìn)行修改,使其為硬盤的實(shí)際柱面數(shù),即6296,然后連續(xù)敲入兩個(gè)q退出dkinit。 (四)執(zhí)行reboot命令重新啟動(dòng)機(jī)器,并做以下兩項(xiàng) (1)在機(jī)器重啟時(shí),按F2進(jìn)入CMOS,修改硬盤參數(shù)使其柱面數(shù)為其實(shí)際大小(即6296),然后保存參數(shù)退出。 (2)機(jī)器啟動(dòng)在出現(xiàn)Ctrl+D提示時(shí)輸入超級(jí)用戶口令重新進(jìn)入單用戶。在啟動(dòng)時(shí),我們會(huì)發(fā)現(xiàn)硬盤參數(shù)已變?yōu)槠鋵?shí)際大?。? %disk 0x01F0-0x01F7 14-type=W0 unit=0cy1s=6296 hds=16 secs=63 (五)執(zhí)行/etc/fdisk命令在硬盤剩余空間創(chuàng)建新的UNIX分區(qū),注意每個(gè)分區(qū)大小不能超過2G字節(jié)。我的硬盤創(chuàng)建的分區(qū)為 Current Hard Disk Drive:/dev/rhd00 Partition Status Type Start End Size 1 Axtive UNIX 1 16351 16351 2 Inactive UNIX 16352 76351 60000 3 Inactive UNIX 76352 100719 24368
Total disk size:100736 tracks (17 reserved for masterboot and diagnostics) 硬盤分區(qū)與設(shè)備文件的對(duì)應(yīng)關(guān)系如下: /dev/rhd00/dev/hd00第一硬盤整個(gè)硬盤 /dev/rhd01/dev/hd01第一硬盤第一分區(qū) /dev/rhd02/dev/hd02第一硬盤第二分區(qū) /dev/rhd03/dev/hd03第一硬盤第三分區(qū) /dev/rhd0a/dev/hd0a第一硬盤活動(dòng)分區(qū) (六)用/etc/badtrk命令掃描新建立的分區(qū)是否有壞磁道。以對(duì)第三分區(qū)掃描為例,執(zhí)行命令(千萬不要用錯(cuò)設(shè)備文件名) #badtrk -f /dev/rhd03 顯示菜單: 1.Print Current Bad Track Table(顯示當(dāng)前壞道表) 2.Scan Disk(只讀方式和破壞性方式) 3.Add EntrIEs to Current Bad Track Table by Cylinder/Head Number(以柱面/頭方式向當(dāng)前壞道表中添加項(xiàng)) 4.Add Entries to Current Bad Track Table by Sector Number(以扇區(qū)號(hào)方式向當(dāng)前壞道表中添加項(xiàng)) 5.Delete Entries Individually from Current Bad Track Table(刪除當(dāng)前壞道表中的單個(gè)項(xiàng)) 6.Delete All Entries from Current Bad Track Table(刪除當(dāng)前壞道表中的所有項(xiàng))Enter your choice or q to quit:2 選擇2(掃描硬盤),出現(xiàn): 1.Scan entire UNIX partition(掃描整個(gè)UNIX分區(qū)) 2.Scan a specified range of tracks(掃描指定的磁道范圍) 3.Scan a specified filesystem(掃描指定的文件系統(tǒng))Enter your choice or q to quit:1 選擇1(掃描整個(gè)UNIX分區(qū)),出現(xiàn): 1.Quick scan(快速掃描,大約7M字節(jié)/每分鐘) 2.Thorough scan(全部徹底掃描,大約1M字節(jié)/每分鐘) Enter your choice or q to quit:1 選擇1(快速掃描),出現(xiàn): Do you want this to be a destructive scan?(y/n) y 輸入y進(jìn)行破壞性掃描(慎用!為安全起見,可輸入n進(jìn)行非破壞性掃描),出現(xiàn): This will destroy the present contents of the region you are scanning(這將破壞你正要掃描的硬盤區(qū)域的內(nèi)容)。 Do you wish to continue? (y/n) y 輸入y開始進(jìn)行破壞性掃描,并提示掃描進(jìn)度: Scanning in progress,type q to interrupt at any timeEnter your choice or q to quit:q掃描結(jié)束后,敲入q退出badtrk命令。 (七)執(zhí)行/etc/divvy命令對(duì)建立的分區(qū)進(jìn)行分片(以對(duì)硬盤的第二Unix分區(qū)進(jìn)行分片為例)divvy命令的-m選項(xiàng)用于創(chuàng)建可安裝的分片。執(zhí)行命令: # divvy -m /dev/rhd02顯示: There are 1889495 blocks in the UNIX area(顯示在該Unix分區(qū)中有1889495塊)。Please enter the number of file systems you want this areato be dividedinto,or press<Return>to get the default of 1 file system(s) 直接敲回車(在此可輸入要建立的文件系統(tǒng)的數(shù)目,或直接敲回車設(shè)為一個(gè)文件系統(tǒng)),顯示: The layout of the filesystems and swap area is now prepared。 Do you wish to make any manual adjustments to the sizes or names of the filesystems or swap area before they are created on the hard disk?(y/n) y(敲入y對(duì)文件系統(tǒng)或交換區(qū)的名字或大小進(jìn)行手工調(diào)整,手工調(diào)整后還需要安裝分片) 我的硬盤第二分區(qū)的分片表為: Name(名字) Type(類型) New FS(新文件系統(tǒng)?) # First Block Last Block home EAFS Yes 0 0 1889494 NOT USED no 1 - - NOT USED no 2 - - NOT USED no 3 - - NOT USED no 4 - - NOT USED no 5 - - NOT USED no 6 - - d1027all EHOLE DISK no 7 0 1889999
1889495 1K blocks for divisions,504 1k blocks reserved for the system 注意:如果不在劃分的分片上創(chuàng)建文件系統(tǒng),則divvy創(chuàng)建的分片的設(shè)備文件可直接被數(shù)據(jù)庫系統(tǒng)所用。 (八)安裝新創(chuàng)建的文件系統(tǒng) 執(zhí)行# mkdev fs 顯示 Filesystem Initialization Program(文件系統(tǒng)初始化程序) This program performs maintenance tasks required to add or delete an existing filesystem(這個(gè)程序執(zhí)行對(duì)現(xiàn)有的文件系統(tǒng)的增加和刪除的維護(hù)任務(wù))。Would you like to(你可以進(jìn)行): 1.Add a new filesystem to system。(給系統(tǒng)增加一個(gè)新的文件系統(tǒng)) 2.Remove a filesystem。(刪除一個(gè)文件系統(tǒng)) Select an option or enter q to quit:1(選擇1進(jìn)行添加) Enter a device name and press <Return> or q to quit(可在此輸入用divvy創(chuàng)建的要安裝的文件系統(tǒng)的設(shè)備文件名):/dev/home Enter a Directory name and press <Return> or q to quit(在此輸入安裝點(diǎn)目錄):/home Reserving slots in lost+found directory…(在lost+found目錄中預(yù)留空間) When entering multiuser mode(在進(jìn)入多用戶方式時(shí)是否安裝文件系統(tǒng)): 1.Always mount /dev/home(總是安裝/dev/home) 2.Never mount /dev/home(從不安裝/dev/home) 3.Prompt before mounting /dev/home(在安裝/dev/home之前給出提示)。 Select an option:1(選擇1,使在進(jìn)入多用戶時(shí)自動(dòng)安裝) Do you want to allow users to mount this file system?(y/n) y (可根據(jù)需要選擇是否允許用戶自己安裝,在此選擇n) Updating system files…(修改系統(tǒng)文件) Filesystem has been successfully added(文件系統(tǒng)被成功修改) 顯示完以上兩行信息,回到shell提示符時(shí),文件系統(tǒng)就添加完畢了。 執(zhí)行完以上步驟,在已安裝有SCO Unix 3.2v4.2的大硬盤上對(duì)硬盤的充分利用的處理工作就可以畫個(gè)句號(hào)了。
