
総ブロック数=総シリンダ数×総ヘッダ数×総セクタ数
例:1004608ブロック=1427シリンダ×11ヘッダ×64セクタ
1シリンダ=総ヘッダ×総セクタ=1シリンダあたりのブロック数
例:1シリンダ=11ヘッダ×64セクタ=704ブロック
1ブロック=512バイト
※だいたい、パーティーションをシリンダ単位で区切って割り振ったほうが扱いやすく無駄がない。
よって、だいたい以下のとおりに割り振る
formatコマンドでHDDをformatする。まず、HDDが複数ある場合は、選択する。
# format
Searching for disks...done
AVALIABLE DISK SELECTIONS:
0.sd1 at esp0 slave 8
sd1:
1.sd3 at esp0 slave 0
sd3:
Specify disk (enter its number): 1
selecting sd1:HDDをformatするので、formatと入力する。本当によいか聞いてくるので、yをいれる。その後formatが始まる。SparcStation ELC,500M SCSIで約40分。FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector show - translate a disk address label - write label to the disk analyze - surface analyze defect - defect list management backup - serch for backup labels quit format>
format> format
Ready to format. Formatting cannot be intarrupted.
and take 8 minutes (estimated). Continue? y
Beginning format. The current time is Tue Mar 3 07:35:42 1998
Formatting...done
Verifying media...
pass 0 - pattern = 0xc6dec6de
1426/10/54
pass 1 - pattern = 0x6db6db6d
1426/10/54
Total of 0 defective blocks pepaired
format>
終わったら、いよいよパーティーションを割り振る。pertitionと入れて、pertitionメニューに移る。
format> partition PARTITION MENU: a - change `a' partition b - change `b' partition c - change `c' partition d - change `d' partition e - change `e' partition f - change `f' partition g - change `g' partition h - change `h' partition select - select a predefind table name - name the current table print - display the current table label - write patition map and label to the disk quit partition>
partition> c partition c - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 0 Enter new # blocks [1004608, 1427/0/0]: 1004608 partition>
partition> a partition a - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 0 Enter new # blocks [30976, 44/0/0]: 61952 partition> b partition b - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 88 Enter new # blocks [0, 0/0/0]: 164032 partition> d partition d - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 321 Enter new # blocks [0, 0/0/0]: 164032 partition> e partition e - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 554 Enter new # blocks [0, 0/0/0]: 61952 partition> f partition f - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 642 Enter new # blocks [511808, 727/0/0]: 102784 partition>g partition g - starting cyl 0, # blocks 0 (0/0/0) Enter new starting cyl [0]: 788 Enter new # blocks [0, 0/0/0]: 449856 partition>
pertition> label Ready to label disk, continue? y pertition> quit format> quit
# halt syncing file systems...done Halted Program terminated ok boot -s
# newfs /dev/rsd1d
/dev/rsd1d: 164032 sectors in 233 cylinders of 11 tracs, 64 sectors
84.0MB in 15cyl groups (16 c/g, 5.77MB/g, 2624 i/g)
super-block backups (for fsck -b #) at:
32, 11360, 22688, 34016, 45344, 56672, 68000, 79328, 90656,
101984, 113312, 124640, 135968, 147296, 158624
# mkdir /nbsd
# mount /dev/sd1d /nbsd
# mkdir /cdrom # mount -t hsfs -o ro /dev/sr0 /cdrom # tar zxvfp /cdrom/OpenBSD/2.2/sparc/base22.tar.gz -C /nbsd # tar zxvfp /cdrom/OpenBSD/2.2/sparc/etc22.tar.gz -C /nbsd
# cd /nbsd/dev # vi MAKEDEV os=SunOS # sh MAKEDEV all
fstabの作成
# cd /nbsd/etc # cat > fstab /dev/sd0d / ffs rw 1 1 /dev/sd0b none swap sw 0 0 ^D #
# cp /cdrom/OpenBSD/2.2/sparc/bsd /nbsd
# cp /boot /mnt/boot # sync; sync # /usr/mdec/installboot -vlt /nbsd/boot /usr/mdec/bootsd /dev/rsd1d
# halt ok boot disk0:d bsd
# mkdir /nbsd
# newfs /dev/rsd0a # mount /dev/sd0a /nbsd # mkdir /nbsd/usr /nbsd/var # newfs /dev/rsd0f # mount /dev/sd0f /nbsd/var # newfs /dev/rsd0g # mount /dev/sd0g /nbsd/usr # newfs /dev/rsd0e # mount /dev/sd0e /tmp(2.0の場合、作業用tmpは /var/tmpになる。2.1,2.2は/tmp。)
各バイナリセットを展開する。
# mount -t cd9660 -o ro /dev/cd0a /mnt # cd /nbsd # tar zxvfp /mnt/OpenBSD/2.2/sparc/base22.tar.gz # tar zxvfp /mnt/OpenBSD/2.2/sparc/etc22.tar.gz # tar zxvfp /mnt/OpenBSD/2.2/sparc/comp22.tar.gz # tar zxvfp /mnt/OpenBSD/2.2/sparc/man22.tar.gz # tar zxvfp /mnt/OpenBSD/2.2/sparc/misc22.tar.gz # tar zxvfp /mnt/OpenBSD/2.2/sparc/text22.tar.gz # tar zxvfp /mnt/OpenBSD/2.2/sparc/games22.tar.gz
# cd /nbsd/etc # cat > fstab /dev/sd0a / ffs rw 1 1 /dev/sd0b none swap sw 0 0 /dev/sd0f /var ffs rw 1 2 /dev/sd0g /usr ffs rw 1 3 ^d # # cd /nbsd/dev # sh MAKEDEV all
# vi /usr/mdec/binstall PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/mdec # /usr/mdec/binstall ffs /nbsd 1399+1 records in 1399+1 records out 44794 bytes trnsferred in 1 secs (44794 bytes/sec) #
# cp /mnt/OpenBSD/2.2/sparc/bsd /nbsd/bsd # halt ok boot disk3 bsd
# passwd New passwd :
# cd /etc # rm /etc/localtime # ln -s /usr/share/zoneinfo/Japan localtime # date 9803191524
/etc/mynameに自分のdomainnameを記す。
# vi /etc/myname yggdrasil.cn.thu.ac.jp
# vi /etc/mygate 202.34.238.39
# vi /etc/resolv.conf domain cn.thu.ac.jp nameserver 202.34.238.2
# vi /etc/hosts 127.0.0.1 localhost localhost.my.domain 202.34.238.11 yggdrasil yggdrasil.cn.thu.ac.jp
# ifconfig -a lo0: flags=8009inet 127.0.0.1 netmask 0xff000000 le0: flags=8863 inet 202.34.238.11 netmask 0xffffff00 broadcast 202.34.238.255 # ifconfig le0 inet yggdrasil # ping www.cn.thu.ac.jp PING bbb.thu.ac.jp (202.34.238.62): 56 data bytes 64bytes from 202.34.238.62: icmp_seq=0 ttl=253 time=3.153 ms 64bytes from 202.34.238.62: icmp_seq=1 ttl=253 time=3.153 ms --- bbb.thu.ac.jp ping statistics --- 2 packets transmitted, 2 packets raceived, 0% packet loss round-trip min/avg/max = 2.290/2.721/3.152 ms # echo "inet yggdrasil" > /etc/hostname.le0
# set these to "NO" to turn them off. otherwise, they're used as flags routed_flags="-q" # for 'normal' use: routed_flags=-q mrouted_flags="" # for 'normal' use: mrouted_flags="" < multicust routeing rarpd_flags="-a" # for 'normal' use: rarpd_flags="-a" bootparamd_flags=NO # for 'normal' use: bootparamd_flags="" rbootd_flags=NO # for 'normal' use: rbootd_flags="" sendmail_flags="-bd -q30m" # for 'normal' use: sendmail_flags="-bd -q30m" named_flags="-b /etc/namedb/named.boot" # for 'normal' use: named_flags="" timed_flags=NO # for 'normal' use: timed_flags="" < time server photurisd_flags="" # for 'normal' use: photurisd_flags="" < security ??
# Start up the screenblank process
#
if[ -f /usr/sbin/screenblank ]; then
echo "Starting screenblank process."> /dev/console
/usr/sbin/screenblank
fi
# halt ok boot cdromSunOSのインストーラーが動くので、そのまま、sd0(ID 3)を選択して、HDDをformatに準じてパーティーションの割り当てを行う。今回は、以下の通り。
# newfs /dev/sd1g
newfs: /dev/sd1g: not a character-special device
/dev/sd1g: 942656 sectors in 1339 cylinders of 11 tracks, 64 sectors
460.3MB in 84 cyl groups (16 c/g, 5.50MB/g, 1344 i/g)
super-block backups (for fsck -b #) at:
32, 11360, 22688, 34016, 45344, 56672, 68000, 79328, 90656, 101984, 113312,
124640, 135968, 147296, 158624, 169952, 180256, 191584, 202912, 214240,
225568, 236896, 248224, 259552, 270880, 282208, 293536, 304864, 316192,
327520, 338848, 350176, 360480, 371808, 383136, 394464, 405792, 417120,
428448, 439776, 451104, 462432, 473760, 485088, 496416, 507744, 519072,
530400, 540704, 552032, 563360, 574688, 586016, 597344, 608672, 620000,
631328, 642656, 653984, 665312, 676640, 687968, 699296, 710624, 720928,
732256, 743584, 754912, 766240, 777568, 788896, 800224, 811552, 822880,
834208, 845536, 856864, 868192, 879520, 890848, 901152, 912480, 923808,
935136,
#
# mount /dev/sd1g /mnt # cp -R /home/* /mnt
# vi /etc/fstab /dev/sd0a / ffs rw 1 1 /dev/sd0b none swap sw 0 0 /dev/sd0f /var ffs rw 1 2 /dev/sd0g /usr ffs rw 1 3 /dev/sd1g /home ffs rw 1 4
# $OpenBSD: crontab,v 1.7 1997/08/18 06:12:51 deraadt Exp $ # # /var/cron/tabs/root - root's crontab # #minute hour mday month wday command # do daily/weekly/monthly maintenance 30 1 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/d aily.out | mail -s "`/bin/hostname` daily output" root 30 3 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/ weekly.out | mail -s "`/bin/hostname` weekly output" root 30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log /monthly.out | mail -s "`/bin/hostname` monthly output" root
sh /etc/security 2>&1 | mail -s "$host daily insecurity output" root
カーネルの再構築
SparcStation ELCにはフロッピードライブが付いていないので、不要と判断しカーネルから削るが、BSDではデバイスドライバが一緒になっているのでカーネルを再構築せねばならない。
雑誌付録のCDROMから、システムのソースファイル部分のみ入ったsrcsys.tar.gzを展開する。
% tar zxvf /mnt/OpenBSD/2.2/srcsys.tar.gz -C /usr/src
% cd /usr/src/sys/arch/sparc/conf % cp SUN4C HMX-13 % vi HMX-13 % config HMX-13 % cd ../compile/HMX-13 % make depend % make % cp /bsd /bsd.old % cp ./bsd /bsd総じて1時間ぐらいかかる。
% cd % mkdir X % cd X % cp /cdrom/OpenBSD/2.2/sparc/X11/* ./
まず、Xを入れるディレクトリを作成し、各ファイルを展開させるshを動かします。
% cd /usr % su # mkdir X11R6 # cd X11R6 # sh /home/arai/X11/preinst.sh # /home/arai/X11/extract /home/arai/X11/X331*.tgz # sh /home/arai/X11/postinst.sh
# ln -fs /usr/X11R6/bin/XsunMono /usr/X11R6/bin/X