2009年7月31日(金) やっとこ金曜日 [同日]
● [DocoMomo] インストール後再起動前の状態を観察してみる
DocoMomoは起動するたびにハードウェアの検出と設定をしたいのだけれど、 Momonga 5になってからうまい方法をみつけられない。 Momonga 6をインストールした機会に、 これがどのようにハードウェアを設定していくのか見てみたい。
インストーラのXが起動してから再起動後のXが起動するまでの間に、 常用するためのXの設定をやっていることになる。 まず、インストーラはVGAの解像度のXを起動する。 USB接続のキーボードやマウスは使える。 インストール後再起動するとモニタに合った解像度になっている。
…ということに気づいたので、 このシステムのルートファイルシステムを他のOSでマウントして眺めて みるのが良さそうだ。 再起動後のXが起動した時点で電源を切った。
まず探すのはfirstbootという名前のファイル。 ルートファイルシステムは/mnt/tmpにマウントした。
$ find /mnt/tmp/etc -name firstboot 2>/dev/null /mnt/tmp/etc/init.d/firstboot
あれ。ありませんよ。/etc/init.d/firstbootを見てみると /etc/sysconfigにあるはずなのですが。 いや、このファイルが無い場合はスクリプトの中身が走るのか。
$ find /mnt/tmp/etc -name S*firstboot 2>/dev/null /mnt/tmp/etc/rc5.d/S99firstboot /mnt/tmp/etc/rc3.d/S99firstboot
ちゃんとrunlevel 3と5で走るようになってます。
それじゃあ/etc/init.d/firstbootを読んでいこう。
48行目。カーネルオプションに「reconfig」が与えられているか、 /etc/reconfigSysというファイルがあれば、 以下で実行する/usr/sbin/firstbootコマンドに--reconfigというオプションを加える。
57行目と62行目。 /usr/bin/plymouthをそれぞれ--hide-splashと--show-splash付きで実行する。 Developer at Momonga ProjectのWikiページ によると、これは「RHGB を置き換える物らしい」。 ハードウェアの設定をしてるわけじゃないんだな。
そして、2回のplymouthの実行の間に、/usr/sbin/firstbootが実行されます。 やっぱりこのプログラムがハードウェアの設定を担ってるんだろうな。 このコマンドはPythonスクリプトで何をやっているのか勉強できそうです …がおなかが空いてきたので今はここまで。
そうそう、/etc/X11/xorg.confはありませんでした。これは作られるのかな?
● [DocoMomo] インストール後に再起動してから設定される項目
上で見たfirstbootがいろいろやってくれるみたい。
ユーザーに見えるのは、まず、常用ユーザーの追加、次に時刻の設定。 で、設定が終わると…/etc/X11/xorg.confはできてませんでした。
更新されたファイルを記録しておこう。
# find /etc -type f | xargs ls -lt | head -30 -rw-r--r--. 1 root root 6 Jul 31 18:45 /etc/sysconfig/xinit-session -rwxr-xr-x. 1 root root 44 Jul 31 18:45 /etc/adjtime -rw-r--r--. 1 root root 312 Jul 31 18:45 /etc/localtime -rw-r--r--. 1 root root 199 Jul 31 18:45 /etc/sysconfig/clock -rw-r--r--. 1 root root 17 Jul 31 18:45 /etc/sysconfig/firstboot -rw-r--r--. 1 root root 1716 Jul 31 18:45 /etc/ntp.conf -rw-r--r--. 1 root root 52 Jul 31 18:45 /etc/ntp/step-tickers -rw-r--r--. 1 root root 1769 Jul 31 18:43 /etc/passwd -rw-r--r--. 1 root root 1769 Jul 31 18:43 /etc/passwd- -r--------. 1 root root 1111 Jul 31 18:43 /etc/shadow -r--------. 1 root root 1111 Jul 31 18:43 /etc/shadow- -rw-r--r--. 1 root root 853 Jul 31 18:43 /etc/group -rw-r--r--. 1 root root 839 Jul 31 18:43 /etc/group- -r--------. 1 root root 706 Jul 31 18:43 /etc/gshadow -r--------. 1 root root 694 Jul 31 18:43 /etc/gshadow- -rw-r--r--. 1 root root 56 Jul 31 18:42 /etc/resolv.conf -rw-r--r--. 1 root root 206 Jul 31 18:42 /etc/mtab -rw-r--r--. 1 root root 1454 Jul 31 18:42 /etc/blkid/blkid.tab -rw-r--r--. 1 root root 1454 Jul 31 18:42 /etc/blkid/blkid.tab.old -rw-r--r--. 1 root root 1520 Jul 31 18:33 /etc/asound.state -rw-------. 1 root root 672 Jul 28 11:58 /etc/ssh/ssh_host_dsa_key -rw-r--r--. 1 root root 590 Jul 28 11:58 /etc/ssh/ssh_host_dsa_key.pub -rw-------. 1 root root 1675 Jul 28 11:58 /etc/ssh/ssh_host_rsa_key -rw-r--r--. 1 root root 382 Jul 28 11:58 /etc/ssh/ssh_host_rsa_key.pub -rw-------. 1 root root 963 Jul 28 11:58 /etc/ssh/ssh_host_key -rw-r--r--. 1 root root 627 Jul 28 11:58 /etc/ssh/ssh_host_key.pub -rwxr-xr-x. 1 root root 853 Jul 28 11:56 /etc/inittab -rw-r--r--. 1 root root 9122 Jul 28 11:56 /etc/ldap.conf -rw-r--r--. 1 root root 2293 Jul 28 11:56 /etc/libuser.conf -rw-r--r--. 1 root root 1524 Jul 28 11:56 /etc/login.defs xargs: ls: terminated by signal 13
うーん。X関係は見えてないな。もう少し遡る。
# find /etc -type f | xargs ls -lt | head -60 | tail -30 -rw-r--r--. 1 root root 326 Jul 28 11:56 /etc/openldap/ldap.conf -rw-r--r--. 1 root root 659 Jul 28 11:56 /etc/pam.d/fingerprint-auth-ac -rw-r--r--. 1 root root 890 Jul 28 11:56 /etc/pam.d/password-auth-ac -rw-r--r--. 1 root root 701 Jul 28 11:56 /etc/pam.d/smartcard-auth-ac -rw-r--r--. 1 root root 931 Jul 28 11:56 /etc/pam.d/system-auth-ac -rw-r--r--. 1 root root 305 Jul 28 11:56 /etc/sysconfig/authconfig -rw-------. 1 root root 481 Jul 28 11:56 /etc/sysconfig/ip6tables -rw-------. 1 root root 481 Jul 28 11:56 /etc/sysconfig/ip6tables.old -rw-------. 1 root root 476 Jul 28 11:56 /etc/sysconfig/iptables -rw-------. 1 root root 476 Jul 28 11:56 /etc/sysconfig/iptables.old -rw-------. 1 root root 73 Jul 28 11:56 /etc/sysconfig/system-config-firewall -rw-------. 1 root root 73 Jul 28 11:56 /etc/sysconfig/system-config-firewall.old -rw-r--r--. 1 root root 76 Jul 28 11:56 /etc/sysconfig/system-config-securitylevel -rw-r--r--. 1 root root 312 Jul 28 11:56 /etc/avahi/etc/localtime -rw-r--r--. 1 root root 85 Jul 28 11:56 /etc/sysconfig/keyboard -rw-r--r--. 1 root root 619174 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-bn_IN.xml -rw-r--r--. 1 root root 423861 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-ca.xml -rw-r--r--. 1 root root 333858 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-en_GB.xml -rw-r--r--. 1 root root 464381 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-fr.xml -rw-r--r--. 1 root root 512038 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-hi.xml -rw-r--r--. 1 root root 451232 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-hu.xml -rw-r--r--. 1 root root 423762 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-nl.xml -rw-r--r--. 1 root root 432359 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-pl.xml -rw-r--r--. 1 root root 447180 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-pt.xml -rw-r--r--. 1 root root 407787 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-ro.xml -rw-r--r--. 1 root root 581388 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-ru.xml -rw-r--r--. 1 root root 519868 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-te.xml -rw-r--r--. 1 root root 418479 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-tr.xml -rw-r--r--. 1 root root 451059 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-uk.xml -rw-r--r--. 1 root root 340860 Jul 28 11:55 /etc/gconf/gconf.xml.defaults/%gconf-tree-zh_HK.xml xargs: ls: terminated by signal 13
うーむ。
# find /etc -type f | grep X11 | xargs ls -lt | head -rw-r--r--. 1 root root 1094 Jul 28 11:43 /etc/X11/fs/config -rw-r--r--. 1 root root 1064 Jul 28 11:38 /etc/X11/fs/config.chkfontpath -rw-r--r--. 1 root root 129 Jul 22 22:27 /etc/X11/applnk/.directory -rw-r--r--. 1 root root 170 Jul 22 22:13 /etc/X11/xinit/session.d/kde -rw-r--r--. 1 root root 120 Jul 22 20:14 /etc/X11/xinit/lang.d/ja_JP.EUC-JP -rw-r--r--. 1 root root 70 Jul 22 20:14 /etc/X11/xinit/lang.d/ko_KR.EUC-KR -rw-r--r--. 1 root root 62 Jul 22 20:14 /etc/X11/xinit/lang.d/tl_PH -rw-r--r--. 1 root root 57 Jul 22 20:14 /etc/X11/xinit/lang.d/tr_TR -rw-r--r--. 1 root root 58 Jul 22 20:14 /etc/X11/xinit/lang.d/tr_TR.UTF-8 -rw-r--r--. 1 root root 44 Jul 22 20:14 /etc/X11/xinit/lang.d/uk_UA xargs: ls: terminated by signal 13
これは新しいxorgについて勉強しなくちゃいけないってことだね。
● Eagle Tech ET-CSMDSU2-BKを使ってみる
家のファイルサーバ用に、SATAハードディスクが2台入るUSBの外付けハードディスクを amacon.comから買ってみた。 メーカーのページ を見るとLinuxに対応すると明記してあるのが決め手になったのだが、 付属の説明書には、Softwareとして、Windows 2000 Pro/Server 2000/Serever 2003/XP/Vista、 Mac OSX v.10.2+とあり、Linuxの記述は無い。
まあ気にせす進める。まずはハードディスクを入れないで、Momonga 6のマシンにつないで電源を入れてみる。 Dual/JBOD SwitchはDual。…青いLEDは点灯するが、ファンは回転しないしマシンも何も検出しない。 こんなもの?
それじゃあハードディスクを入れてみる。
A側に、Hitachi HDT721010SLA360 (Made in China by Hitachi Global Storage Products (SHenzhen) Co., Ltd. CN)、 B側に、Western Digital WD10EADS (Product of Thailand)、 電源を入れてしばらくすると、下記のように認識された。シリアル番号は伏せてある。
usb 1-7: new high speed USB device using ehci_hcd and address 5 usb 1-7: New USB device found, idVendor=152d, idProduct=2336 usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=5 usb 1-7: Product: JM20336 SATA, USB Combo usb 1-7: Manufacturer: JMicron usb 1-7: SerialNumber: F6042748**** usb 1-7: configuration #1 chosen from 1 choice Initializing USB Mass Storage driver... scsi9 : SCSI emulation for USB Mass Storage devices usb-storage: device found at 5 usb-storage: waiting for device to settle before scanning usbcore: registered new interface driver usb-storage USB Mass Storage support registered. usb-storage: device scan complete scsi 9:0:0:0: Direct-Access WDC WD10 EADS-00M2B0 PQ: 0 ANSI: 2 CCS scsi 9:0:0:1: Direct-Access Hitachi HDT721010SLA360 PQ: 0 ANSI: 2 CCS sd 9:0:0:0: [sdd] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB) sd 9:0:0:0: [sdd] Write Protect is off sd 9:0:0:0: [sdd] Mode Sense: 00 38 00 00 sd 9:0:0:0: [sdd] Assuming drive cache: write through sd 9:0:0:0: [sdd] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB) sd 9:0:0:0: [sdd] Write Protect is off sd 9:0:0:0: [sdd] Mode Sense: 00 38 00 00 sd 9:0:0:0: [sdd] Assuming drive cache: write through sdd: unknown partition table sd 9:0:0:0: [sdd] Attached SCSI disk sd 9:0:0:0: Attached scsi generic sg4 type 0 sd 9:0:0:1: [sde] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB) sd 9:0:0:1: [sde] Write Protect is off sd 9:0:0:1: [sde] Mode Sense: 00 38 00 00 sd 9:0:0:1: [sde] Assuming drive cache: write through sd 9:0:0:1: [sde] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB) sd 9:0:0:1: [sde] Write Protect is off sd 9:0:0:1: [sde] Mode Sense: 00 38 00 00 sd 9:0:0:1: [sde] Assuming drive cache: write through sde: unknown partition table sd 9:0:0:1: [sde] Attached SCSI disk sd 9:0:0:1: Attached scsi generic sg5 type 0
ここでは、/dev/sddがB側、/dev/sdeがA側のように見える。
パーティションを切る。ファイルサーバ分はext3で良いだろう。 最初に10GBくらい汎用の領域を持たせておこうか。/dev/sdeのパーティションテーブルは、
Disk /dev/sde: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x1eb95640 Device Boot Start End Blocks Id System /dev/sde1 1 1306 10490413+ 83 Linux /dev/sde2 1307 121601 966269587+ 83 Linux
/dev/sddは、
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xe49c59b3 Device Boot Start End Blocks Id System /dev/sdd1 1 1306 10490413+ 83 Linux /dev/sdd2 1307 121601 966269587+ 83 Linux
とした。カーネルからはどちらも同一に見える。
次に、/sbin/mkfs.ext3。アクセスランプを見ると、 左側(B側)が/dev/sdd、右側(A側)が/dev/sdeのようだ。
ラベルも付けておく。
/sbin/e2label /dev/sdd1 wd1
一度電源を切り、SATAインターフェースに直接付けて認識されるのを確認する。 上で付けたラベルが読めること、また、マウントできることを確認した。
今日はここまで。
(追記) 10GBのパーティションを細かく区切ることができるように、 残りのファイルサーバ分のパーティション番号を4に移動させた。
Command (m for help): p Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 1306 10490413+ 83 Linux /dev/sdc2 1307 121601 966269587+ 83 Linux Command (m for help): d Partition number (1-4): 2 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 4 First cylinder (1307-121601, default 1307): Using default value 1307 Last cylinder or +size or +sizeM or +sizeK (1307-121601, default 121601): Using default value 121601 Command (m for help): p Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 1306 10490413+ 83 Linux /dev/sdc4 1307 121601 966269587+ 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
この操作の直後に/dev/sdc4をマウントできる。ラベルも適宜変更した。
最近のツッコまれどころ