root@debian:~# apt-cache search kuro avr-evtd - AVR watchdog daemon for Linkstation/Kuroboxes micro-evtd - Daemon for Linkstation/Kuro micro controller |
このデバイスはファン、各種 LED、指定時刻での電源オン、2 つのボタンを制御・監視します。このデーモンはこのデバイスに必要な初期化を行い、また、さまざまな障害の状況に応じて LED を点灯させます。さらに、電源ボタン (前面) とリセットボタン (背面) を監視します。
micro-evtd (Linkstation/Kuro マイクロコントローラーデーモン)
http://packages.debian.org/squeeze/micro-evtd
マイクロ イベントデーモン は、ARM シリーズ NAS デバイスに取り付けられている、Linkstation/KURO マイクロ コント ローラーは、シンプルで小型のユーザー スペース インターフェイスです。マイクロ イベントデーモン は、モニターのファン、さまざまな Led、システムの温度、2 つのボタンの制御になります。
結局のところ、どちらが現状必要なのか?
よく分からないので、上記の情報から情報を推測すると、
avr-evtd - AVR (Linkstation・玄箱用 AVR 監視デーモン)の方のジャンルは、アドレスから見る限り、
miscとあり、これを辞書で調べれば、
miscellaneous: 種々雑多ないろいろの多方面にわたる
もしくは
miscellany: 寄せ集めや、ごった混ぜ
と言った意味合いで、玄箱PRO に繋がった1つのAVRパーツとして色々操作したい時に用いる雰囲気
対する
micro-evtd (Linkstation/Kuro マイクロコントローラーデーモン)は、
どうもBIOSでいう電源管理の振る舞いとして使いたいのではないかと推測。
またアドレスに含まれる言葉もsqueeze とあり、
こちらから考えると、Debian 標準で管理しようと考えている様にも伺える。
でもまった!
何か色々調べていると分かった・・・・・・・・・・・・・・・・・・
玄箱PRO のDebian squeeze って・・・・・・・・・・・・・・・・・・・・・・・
shutdown コマンドでなくて、halt コマンドでシャットダウンできるんですね^^;
ただしshutdown もhalt もスーパーユーザーのコマンドなので、
スーパーユーザーとして実行しなければコマンドが存在しないと言われてしまいます。
- - - - - - - - - - - - - - -
調べたのは何だったのかは、さて置いて、とりあえず何かLinkstation/玄箱 特有の
ハード依存について調べたとして、メモを残しておきます。
また、Debian のパッケージをオンラインで調べる場合は、
このページから調べられるんですね!
http://www.debian.org/distrib/packages#search_contents
ちなみにmicro-evtd は
http://packages.debian.org/search?keywords=micro-evtd
の様な感じでした。
以上メモでした。
パッケージの確認とインストール の基本操作、apache2 を例にメモ。
<追伸で書いた部分>------
結局の所、locale 設定をインストール(apt-get install locales)し、
日本語に表示できる様に設定すれば、
こんなメモは要らないのかもしれないです。
その場合は、ちゃんと指定した文字コードが表示できるコンソールだのターミナルを使って下さいね、
文字化けしますから。
そうすれば基本的にapkg でdebパッケージをインストールするのであろうと、
aptitude を使おうと、どちらも--help という引数を与えれば、ある程度日本語化された
ヘルプが見られますね^^;
-----追伸以上。-----
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
指定した言葉を含む、パッケージの一覧を表示する。(dpkg)
dpkg -l | grep apache
長い場合で少しづつ見たい場合はmore にパイプする。
dpkg -l | grep apa | more
長い場合で前後しながら見られる様にしたい場合はless にパイプする。
(終了は[q]キー、移動は、1行[e][i][y][k]、n行[nz][nx]、先頭[g]、最終[G])
dpkg -l | grep apa | less
追伸:
後でも説明が出てきますが、
aptitude show apache2
がとても便利でした・・・
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
インストールされている場合は、最新にアップデートする。
まず、最新の更新リストの設定にする。
apt-get update
次にリストにある全てのapt-get で管理できるパッケージをアップデートする。
apt-get upgrade
インストールされていない場合は、欲しいパッケージ名を検索してみる。
apt-cache search apache2
長い場合で少しずつ見たい場合はmore もしくはless にパイプする。
apt-cache search apache2 | more
apt-cache search apache2 | less
apache2 で検索した場合、いっぱい出てくる中で以下の当りを注目する。
・・・ (略) ・・・ apache2 - Apache HTTP Server metapackage apache2-utils - utility programs for webservers apache2.2-bin - Apache HTTP Server common binary files apache2.2-common - Apache HTTP Server common files ・・・ (略) ・・・ |
実は、パッケージの名前が明確になった場合は以下のコマンドの方が簡単にリスト化できる。
ただしこちらは、パッケージについて説明が無い。
apt-cache pkgnames apache2
結果はこうなる。
apache2-suexec-custom apache2-utils apache2-mpm-itk apache2.2-bin apache2-mpm-prefork apache2 apache2-threaded-dev apache2.2-common apache2-suexec apache2-dbg apache2-doc apache2-mpm-worker apache2-mpm-event apache2-prefork-dev |
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
依存関係を確認し、インストールしたいパッケージ内容を明確にする。
apt-cache depends apache2
この様に表示される
apache2 |Depends: apache2-mpm-worker |Depends: apache2-mpm-prefork |Depends: apache2-mpm-event Depends: apache2-mpm-itk Depends: apache2.2-common |
しかし、apache2 の場合、大本を指定しないとこうなる様だ。
例えばapache2.2-common だと
apt-cache depends apache2.2-common
この様に、インストールするとどうなるかが表示される。
apache2.2-common Depends: apache2.2-bin Depends: apache2-utils Depends: libmagic1 Depends: mime-support Depends: lsb-base Depends: procps Depends: perl Suggests: <www-browser> conkeror edbrowse elinks-lite elvis-console lynx-cur uzbl chimera2 chromium-browser elinks elvis epiphany-browser galeon iceape-browser iceweasel kazehakase konqueror links links2 midori netrik rekonq xemacs21-mule xemacs21-mule-canna-wnn xemacs21-nomule w3m Suggests: apache2-doc |Suggests: apache2-suexec apache2-suexec-custom Suggests: apache2-suexec-custom Recommends: ssl-cert Conflicts: <apache> Conflicts: <apache2-common> Replaces: <apache2-common> |
Depends: 同時にインストールされる他のパッケージ。
つまり同時に導入される、他の依存パッケージ。
Suggests: インストールした方が利便性がよい他の薦めパッケージ。
Recommends: インストールを推奨するパッケージ。
Conflicts: 競合するのでインストールすると消されるパッケージ。
Replaces: 競合など、何らかの理由で再配置、
再インストールされるパッケージ。
他のパッケージも含むパッケージは、Depends: でインストールされるが、
Suggests: Recommends: は表示されるだけで任意である。
Conflicts: はインストールすると強制的に消され、依存関係を再構成し、
再びインストールされるのがReplaces: である。
もうひとつ、自身のパッケージ内で他の
パッケージ名として依存関係も確認出来る様だ。
apt-cache rdepends apache2
こちらの方は、どの機能が何を使っているのかを知る為には良い、
しかし単純にパッケージとしてみるには情報量が多い。
以下はphp関連で目にとまった一例。
・・・ (略) ・・・ |phpsysinfo apache2-mpm-itk apache2-mpm-event apache2-mpm-prefork apache2-mpm-worker |phppgadmin apache2-mpm-itk apache2-mpm-event apache2-mpm-prefork apache2-mpm-worker |phpmyadmin apache2-mpm-itk apache2-mpm-event apache2-mpm-prefork apache2-mpm-worker |phpldapadmin apache2-mpm-itk apache2-mpm-event apache2-mpm-prefork apache2-mpm-worker |phpbb3 apache2-mpm-itk apache2-mpm-event apache2-mpm-prefork apache2-mpm-worker ・・・ (略) ・・・ |htcheck-php apache2-mpm-itk apache2-mpm-event apache2-mpm-prefork apache2-mpm-worker ・・・ (略) ・・・ |
結局、apache2 という物をインストールすると
それに関連する依存しているパッケージもインストールされることが分かる。
また、関連しているパッケージが、また他に関係しているパッケージがあるか、
一応見てみた。
apt-cache depends phpsysinfo
一つ例として、phpsysinfo について見てみた、php5 本体と関係があるのがわかる。
phpsysinfo |
最後に、もし個別にインストールしても良いだろうが、
面倒であったり、使いたい機能が無い場合もあるだろうし、
もし機能から全て把握してカスタマイズしたいならば、
自分でコンパイルする方が無難な場合も。
今回のメモはapache2 をapt-get コマンドを用いて、
Debian パッケージのレポジトリから調べて、最新のパッケージを
丸々依存ファイルごとインストールする例でした。
追伸:aptitude コマンドで、パッケージ情報を確認することも出来る様だ。
こっちのコマンドは説明も追加されて理解しやすかった。
aptitude show apache2
Package: apache2
It features support for HTTPS, virtual hosting, CGI, SSI, IPv6, easy scripting |
このコマンドについては、後日追伸として書いたのでApache2 については、
インストールしたのでステータスが
State: installed |
State: not installed
5.3.3-7+squeeze8)
least one of the three server-side versions of the PHP5 interpreter installed. other packages that depend on this one.
PHP5 is a widely-used general-purpose scripting language that is especially |
State: not installed |
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
インストールしたいパッケージ内容が明確にわかったら、インストールしてみる。
apt-get install apache2
するとこんな感じになる。
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert Suggested packages: apache2-doc apache2-suexec apache2-suexec-custom openssl-blacklist The following NEW packages will be installed: apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert 0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Need to get 2079 kB of archives. After this operation, 6918 kB of additional disk space will be used. Do you want to continue [Y/n]? |
The following extra packages will be installed: 拡張パッケージ
Suggested packages: お勧め提案パッケージ
The following NEW packages will be installed:
インストールされる新しいパッケージ
インストールを継続していいか聞いてくるので継続する(Y)
Get:1 http://security.debian.org/ squeeze/updates/main apache2.2-bin armel 2.2.16-6+squeeze7 [1357 kB] Get:2 http://ftp.jp.debian.org/debian/ squeeze/main libapr1 armel 1.4.2-6+squeeze3 [90.2 kB] Get:3 http://ftp.jp.debian.org/debian/ squeeze/main libaprutil1 armel 1.3.9+dfsg-5 [83.9 kB] Get:4 http://ftp.jp.debian.org/debian/ squeeze/main libaprutil1-dbd-sqlite3 armel 1.3.9+dfsg-5 [27.5 kB] Get:5 http://ftp.jp.debian.org/debian/ squeeze/main libaprutil1-ldap armel 1.3.9+dfsg-5 [25.4 kB] Get:6 http://ftp.jp.debian.org/debian/ squeeze/main ssl-cert all 1.0.28 [14.8 kB] Get:7 http://security.debian.org/ squeeze/updates/main apache2-utils armel 2.2.16-6+squeeze7 [170 kB] Get:8 http://security.debian.org/ squeeze/updates/main apache2.2-common armel 2.2.16-6+squeeze7 [307 kB] Get:9 http://security.debian.org/ squeeze/updates/main apache2-mpm-worker armel 2.2.16-6+squeeze7 [2246 B] Get:10 http://security.debian.org/ squeeze/updates/main apache2 armel 2.2.16-6+squeeze7 [1396 B] Fetched 2079 kB in 10s (196 kB/s) Preconfiguring packages ... Selecting previously deselected package libapr1. (Reading database ... 19480 files and directories currently installed.) Unpacking libapr1 (from .../libapr1_1.4.2-6+squeeze3_armel.deb) ... Selecting previously deselected package libaprutil1. Unpacking libaprutil1 (from .../libaprutil1_1.3.9+dfsg-5_armel.deb) ... Selecting previously deselected package libaprutil1-dbd-sqlite3. Unpacking libaprutil1-dbd-sqlite3 (from .../libaprutil1-dbd-sqlite3_1.3.9+dfsg-5_armel.deb) ... Selecting previously deselected package libaprutil1-ldap. Unpacking libaprutil1-ldap (from .../libaprutil1-ldap_1.3.9+dfsg-5_armel.deb) ... Selecting previously deselected package apache2.2-bin. Unpacking apache2.2-bin (from .../apache2.2-bin_2.2.16-6+squeeze7_armel.deb) ... Selecting previously deselected package apache2-utils. Unpacking apache2-utils (from .../apache2-utils_2.2.16-6+squeeze7_armel.deb) ... Selecting previously deselected package apache2.2-common. Unpacking apache2.2-common (from .../apache2.2-common_2.2.16-6+squeeze7_armel.deb) ... Selecting previously deselected package apache2-mpm-worker. Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.16-6+squeeze7_armel.deb) ... Selecting previously deselected package apache2. Unpacking apache2 (from .../apache2_2.2.16-6+squeeze7_armel.deb) ... Selecting previously deselected package ssl-cert. Unpacking ssl-cert (from .../ssl-cert_1.0.28_all.deb) ... Processing triggers for man-db ... Setting up libapr1 (1.4.2-6+squeeze3) ... Setting up libaprutil1 (1.3.9+dfsg-5) ... Setting up libaprutil1-dbd-sqlite3 (1.3.9+dfsg-5) ... Setting up libaprutil1-ldap (1.3.9+dfsg-5) ... Setting up apache2.2-bin (2.2.16-6+squeeze7) ... Setting up apache2-utils (2.2.16-6+squeeze7) ... Setting up apache2.2-common (2.2.16-6+squeeze7) ... Enabling site default. Enabling module alias. Enabling module autoindex. Enabling module dir. Enabling module env. Enabling module mime. Enabling module negotiation. Enabling module setenvif. Enabling module status. Enabling module auth_basic. Enabling module deflate. Enabling module authz_default. Enabling module authz_user. Enabling module authz_groupfile. Enabling module authn_file. Enabling module authz_host. Enabling module reqtimeout. Setting up apache2-mpm-worker (2.2.16-6+squeeze7) ... Starting web server: apache2. Setting up apache2 (2.2.16-6+squeeze7) ... Setting up ssl-cert (1.0.28) ... |
これでインストール終了。
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
一番初めに書いたメモと同様のコマンドで、インストールされたか確認してみる。
dpkg -l | grep apache | more
するとインストールされているのが分かる。(文が長いので折り返しています)
ii というのは、インストールされた印の様だ。
ii apache2 2.2.16-6+squeeze7 Apache HTTP Server metapackage ii apache2-mpm-worker 2.2.16-6+squeeze7 Apache HTTP Server - high speed threaded model ii apache2-utils 2.2.16-6+squeeze7 utility programs for webservers ii apache2.2-bin 2.2.16-6+squeeze7 Apache HTTP Server common binary files ii apache2.2-common 2.2.16-6+squeeze7 Apache HTTP Server common files |
指定したパッケージと、その依存に当たるパッケージがインストールされた。
これでインストールは終わり。
次回はDebian でのApache2 の設定に移る・・・と思ったが、ことにします。
・・・その前にPHP5 も同様にインストールして設定という
(後日にこのページを編集したので、ほとんど説明になっているので
インストールの説明メモは残さないかもしれません。)
メモ終わり。 お粗末<_ _>
玄箱PRO にDebian をインストールするのは今となってはよくある話なのだが、
私はなんとなU-BOOT を少し前のブログで調べた結果、
U-BOOT を使えばWget や共有フォルダを使わなくても、
玄箱PRO のNANDブートエリアの初期化手段と同様のTFTPプロトコルによる
ファイルのメモリ展開で、インストールが可能なのが分かった。
①下調べ
U-BOOT を調べてみた過去のブログ記事は[玄箱 (KUROBOX-PRO) のU-BOOT の仕組みを調べてみた]を。
玄箱PROのTFTPboot コマンドによる初期化の手順は[玄箱 PRO(KUROBOX-PRO)のtftpboot による初期化]を。
追伸:
ハードディスクのパーティションの区切り方が、私の場合はインストーラー任せでは、
パフォーマンスに影響が出る区切り方、具体的にはシリンダ単位での計算で、
シリンダを共有する形でパーティションを区切ってしまったので、
パーティションをまたがない様に、手動でパーティションだけは区切り、
フォーマットはインストーラーに任せる方法を取った、
またまた長いですが参考は[fdisk コマンドのdoes not end on cylinder boundary. って何なの?] を。
かなり具体的で細かく自分で見直せるように書いているので、独り言も含め長いです^^;
その辺は私の何時ものブログなので勘弁してください><;
②環境に適合したDebian インストーラーイメージのダウンロード
TFTPboot によるDebian squeeze のインストールファイルは、
config-debian 27-Mar-2012 15:59 1.5K
initrd.buffalo 22-Jan-2012 21:38 3.9M
uImage.buffalo 22-Jan-2012 21:38 1.3M
と今回している。
主に手動で色々操作してU-BOOT のsetenv をセットするなら、
config-debian のスクリプトは必要ないのは、私のブログ、
[玄箱PRO(KUROBOX-PRO)の tftpboot による初期化]にも説明があったと思う。
具体的に、これらのダウンロード元は、本家USや
http://http.us.debian.org/debian/dists/squeeze/main/installer-armel/current/images/orion5x/network-console/buffalo/kuroboxpro/
や、ミラーサイト
http://ftp.ne.jp/000/Linux/packages/Debian/debian/dists/squeeze/main/installer-armel/current/images/orion5x/network-console/buffalo/kuroboxpro/
などである。
③TFTPサーバーにダウンロードしたファイルをセットしておく
では、tftpboot によるDebian squeeze の初期化は、基本的に
これまた何度も出てくるが[玄箱 PRO(KUROBOX-PRO)のtftpboot による初期化]の初期化ファイルとと、
同様にinitrd.buffalo とuImage.buffalo を tftpサーバの公開フォルダに入れておく。
後はU-BOOT の設定、つまり玄箱PRO のNORフラッシュの設定を書き換えて、
U-BOOT 上から実行するか、reset 命令で設定後に再起動するだけなのである。
④U-BOOT の設定を変更
その設定とは、以下なのだが、少々問題がある。
問題のある環境変数>>-- -- -- -- -- -- -- ---- -- -- -- -- -- -- ---- -- -- -- --
setenv bootargs_root 'root=/dev/sda1 rw panic=5'
setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver)
setenv bootcmd 'ide reset; ext2load ide 0:1 $(default_kernel_addr) /$(kernel); ext2load ide 0:1 $(default_initrd_addr) /$(initrd); setenv bootargs $(bootargs_base); bootm $(default_kernel_addr) $(default_initrd_addr)'
setenv nand_boot no
saveenv
-- -- -- -- -- -- -- ---- -- -- -- -- -- -- ---- -- -- -- --<<
実は上記だと、
setenv bootcmd 'ide reset; ext2load ide 0:1 $(default_kernel_addr) /$(kernel); ext2load ide 0:1 $(default_initrd_addr) /$(initrd); setenv bootargs $(bootargs_base); bootm $(default_kernel_addr) $(default_initrd_addr)'
は引数が長すぎて受け付けないという落ちがある・・・
setenv コマンドは、最大は16ブロックまでらしい。
なので、新たに適当な環境変数を作り分割した修正をしてみる。
分割して修正した環境変数>>-- -- -- -- -- -- -- ---- -- -- -- -- -- -- ---- -- -- -- --
setenv bootargs_root 'root=/dev/sda1 rw panic=5'
setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver)
setenv ext2_load_kernel ext2load ide 0:1 $(default_kernel_addr) /$(kernel)
setenv ext2_load_initrd ext2load ide 0:1 $(default_initrd_addr) /$(initrd)
setenv bootcmd 'ide reset; $(ext2_load_kernel); $(ext2_load_initrd); setenv bootargs $(bootargs_base); bootm $(default_kernel_addr) $(default_initrd_addr)'
setenv nand_boot no
saveenv
-- -- -- -- -- -- -- ---- -- -- -- -- -- -- ---- -- -- -- --<<
上記の部分が新たに環境変数として分割した部分と、その環境変数を埋め込んで短くした物。
⑤インストーラーの起動
つまり、U-BOOT を立ち上げ、またまた何度も述べてしまうが、前のブログ玄箱 PRO(KUROBOX-PRO)のtftpboot による初期化]で初期化の方法を知ったら、
同様な条件を作り出して、分割して修正した環境変数を入力 するかWindows のハイパーターミナルなら
ホストに貼り付けをするだけで済む。
その後は、またまたまた何度も述べるが、前のブログ玄箱PRO(KUROBOX-PRO)の tftpboot による初期化]にある様に
config-debianの シェルスクリプトを
手動で環境変数化と解析すると、結果的に以下
U-BOOTで手動で行う場合の実行コマンド>>-- -- -- -- -- -- -- ---- -- -- -- -- -- -- ---- -- -- -- --
tftpboot 0x00100000 uImage.buffalo
tftpboot 0x02000000 initrd.buffalo
bootm 0x00100000 0x02000000
-- -- -- -- -- -- -- ---- -- -- -- -- -- -- ---- -- -- -- --<<
を実行しているだけである。
ただし、Windows (XP)標準のハイパーターミナルでのホストに貼り付けでは、連続実行は出来ないので、1行づつ実行して下さい。
つまり、玄箱PRO のNORフラッシュから起動し、U-BOOT を立ち上げ、
分割して修正した環境変数 を打ち込んだついで に、
U-BOOTで手動で行う場合の実行コマンド を入力するかWindows のハイパーターミナルなら
ホストに貼り付けをすると、EABI ARM 用のDebian インストーラーが実行ができてしまうのである。
もしくは、正常に環境変数が動いているのならば、
reset コマンドで玄箱PRO を再起動してもEABI ARM 用のDebian インストーラーが始まるはずだ!?
因みに元のNANDブートに戻し保存するには
※----------
setenv bootargs_root root=/dev/mtdblock2 rw panic=5
setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver)
setenv bootcmd 'nboot $(default_kernel_addr) 0 $(nand_uImage_offset) ;setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver); bootm $(default_kernel_addr)'
setenv nand_boot yes
saveenv
--------- これで戻ります。
以上で基本的な内容は終わりです。
また余談ですが、Tera Term などのターミナルソフトを使った方が、文字化けは少ないと思えた。
都合によっては他のターミナルソフトの方が良い場合もあるので、他のソフトを使うことも良いと思える。
状況に分けて使うと良い。
途中でターミナルソフトを終了して他のターミナルソフトに切り替えることも出来るが、
その時にしっかりCOMポートを開放していないと、他のターミナルソフトから使えない。
その点だけを気をつければ、何時でも好きな他のターミナルソフトから接続することが可能だった。
では以下はインストーラーが動き出してからの経緯を一応、少しの解説と共に載せておきます。
⑥インストーラーの起動と経緯
<<Debian squeeze インストーラーの起動!>>
<<stop_sound>>
## Booting image at 00100000 ...
Image Name: Debian kernel
Created: 2012-01-22 21:38:15 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1315840 Bytes = 1.3 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02000000 ...
Image Name: debian-installer ramdisk
Created: 2012-01-22 21:38:15 UTC
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 4076444 Bytes = 3.9 MB
Load Address: 02000000
Entry Point: 02000000
Verifying Checksum ... OK
Starting kernel ...
arg:console=ttyS0,115200 root=/dev/mtdblock2 rw panic=5 BOOTVER=1.091
Uncompressing Linux... done, booting the kernel.
・・・
(略)
・・・
Starting system log daemon: syslogd, klogd.
mount: mounting /dev/mtdblock2 on /tmp/oldsys-preseed/rootfs failed: Input/outpu
t error
umount: can't umount /tmp/oldsys-preseed/rootfs: Invalid argument
※~~~ 静まり返っ た様に沈黙を続けるが8~9分くらい待つ ~~~※
ターミナルソフトによっては
⊂^v^;⊃空欄が出来るのは仕様ですw
・・・
(略)
・・・
/usr/sbin/micro_evtd.command: line 57: disown: not found
774
(何か無いとか言ってくるが、このままで良い様だ!)
余りにも空欄がひどいので・・・・やっぱり・・・
・・・
(略)
・・・
------------------------------- とりあえず一番初めのメニュー から -------------------------------------------
この画面はSSHを用いた接続の場合の話です、
コンソールのまま行うので特にメモなどはしませんでした。
<Continue>をして進めます。(エンターキー)
lqqqqqqqqqqqu [!!] Continue installation remotely using SSH tqqqqqqqqqqqk
x x
x Start SSH x
x To continue the installation, please use an SSH client to connect to x
x the IP address 192.168.123.22 and log in as the "installer" user. For x
x example: x
x x
x ssh installer@192.168.○.× x
x x
x The fingerprint of this SSH server's host key is: x
x 0?:e?:1?:c?:2?:3?:7?:b?:c?:4?:b?:f?:e?:2?:8?:a? x
x x
x Please check this carefully against the fingerprint reported by your x
x SSH client. x
x x
x <Continue> x
x x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
-(うまく行ったケースです、ダメなら読み飛ばしてxxxxxメ ニューxxxxxから見てもらっても良いと思う)--
ミラーサイトで日本を選んでみた
[!] Choose a mirror of the Debian archive
k x
x The goal is to find a mirror of the Debian archive that is close to
x you on the network -- be aware that nearby countries, or even your
x own, may not be the best choice.
x
x Debian archive mirror country:
x
x Hong Kong
x Hungary
x Iceland
x Ireland
x taly
x Japan
x Kazakhstan
x Korea, Republic of
x Latvia
x x
x <Go Back>
-(ダメだったケース、読み飛ばしてxxxxxメニューxxxxxから見てもらっても良いと思 う)---------------------------
具体的な日本のFTPのミラーを適当に指定
[!] Choose a mirror of the Debian archive
k x
x Please select a Debian archive mirror. You should use a mirror in
x your country or region if you do not know which mirror has the best
x Internet connection to you.
x
x Usually, ftp.<your country code>.debian.org is a good choice.
x
x Debian archive mirror:
x
x ftp.jp.debian.org
x x ftp.nara.wide.ad.jp
x ftp2.jp.debian.org
x dennou-k.gfd-dennou.org
x dennou-q.gfd-dennou.org
x dennou-h.gfd-dennou.org
x cdn.debian.net
x
x <Go Back>
-----------------------------------
適当なFTPサーバを選ぶ
[!] Choose a mirror of the Debian archive
x
x If you need to use a HTTP proxy to access the outside world, enter
x the proxy information here. Otherwise, leave this blank
x
x The proxy information should be given in the standard form of
x "http://[[user][:pass]@]host[:port]/".
x
x HTTP proxy information (blank for none):
x
x ___________________________________________________________________ x
x
x <Go Back> <Continue>
xxxxxx※色々やってダメな場合※は、<Go Back>を繰り返して ウィザードからの質問度合いを変えるxxxxxxx
なぜか、Choose a mirror of the Debian archiveee で引っかかり、アップデートというか、
ダウンロードのサイト(apt リポジトリ http://www.debian.or.jp/using/mirror.html) の
指定がうまくいかなかった場合は、<Go Back> を繰り返して、
「Debian installer main menu」メニューの中の
「Configure the network」を再び実行したり、繰り返してもうまくいく場合もある?
この辺はうまくいかないときは、項目をやり直したり質問を変えて詳細に尋ねてくるウィザードの設定にしてみるには、
「Change debconf priority」 という項目を選び、
その中で一番上の選択肢が以下の様にあるが、
critical
high
medium
low
「critical」として、詳しく色々質問してくるモードを選びなおし、再び開始したりしてみた。
するとうまくいく場合もあった。
実際は、何が原因で止まってしまっているか分からない場合があるが、
何度か繰り返していると、同様な設定なのにうまく行ってしまったこともある。
FTPサーバに繋がらない状況などで変化した可能性もある。
[!] Debian installer main menu
x
x Choose the next step in the install process:
x
x Detect network hardware
x Configure the network
x Choose a mirror of the Debian archiveee
x Download installer components
x Change debconf priority
x Save debug logs
x Execute a shell
x Abort the installation
xxxxxxxx--------------------------------------------------------------------------xxxxxxxx
設定を「critical」に変えると、こんな感じに滅茶苦茶色々聞いてくる。
普通にインストールしてもパッケージに何を選ぶか聞いてくる場合と聞いてこない場合があったのは、
なぜか未だに分からないが、聞いてこない場合は最小限のパッケージだと考えてもいいのだと・・は・・思う・・・
足らないものは、後からdebian のパッケージ管理コマンドでインストール(追伸:して設定)すればいいだけの話だ。
(追伸:また、squeeze の日本語化について、公式的なやり方はこちら)
[!!] Debian installer main menu
x
x Choose the next step in the install process:
x
x Choose language
x Detect network hardware
x Configure the network
x Choose a mirror of the Debian archive
x Download installer components
x Set up users and passwords
x Configure the clock
x Detect disks
x Partition disks
x Install the base system
x Configure the package manager
x Select and install software
x Make the system bootable
x Continue without boot loader
x Finish the installation
------------------------------
デフォルトのウィザードの質問量、「high」を選んだ場合、使うランゲージを聞いてくる。
英語以外なので「C」を選ぶ。
[!!] Select a language
k x
x Choose the language to be used for the installation process. The
x selected language will also be the default language for the installed
x system.
x
x Language:
x
x C
x English
x x
x <Go Back>
-------------------------
日本はアジア圏なので、「Asia」を選ぶ。
[!!] Select your location
k x
x The selected location will be used to set your time zone and also for
x example to help select the system locale. Normally this should be the
x country where you live.
x
x Select the continent or region to which your location belongs.
x
x Continent or region:
x
x Africa
x x Antarctica
x Asia
x Atlantic Ocean
x Caribbean
x Central America
x Europe
x
x <Go Back>
<Tab> moves; <Space> selects; <Enter> activates buttons
-------------------------
上下でスクロールして、中から日本である「Japan」を見つけて選ぶ。
[!!] Select your location
k x
x The selected location will be used to set your time zone and also for
x example to help select the system locale. Normally this should be the
x country where you live.
x
x Listed are locations for: Asia. Use the <Go Back> option to select a
x different continent or region if your location is not listed.
x
x Country, territory or area:
x
x Iran, Islamic Repub
x x Iraq lic of
x Israel
x x Japan
x Jordan
x Kazakhstan
x
x <Go Back>
-------------------------
ルートのパスワードを入力する。
[!!] Set up users and passwords
k x
x You need to set a password for 'root', the system administrative
x account. A malicious or unqualified user with root access can have
x disastrous results, so you should take care to choose a root password
x that is not easy to guess. It should not be a word found in
x dictionaries, or a word that could be easily associated with you.
x
x A good password will contain a mixture of letters, numbers and
x punctuation and should be changed at regular intervals.
x
x The root user should not have an empty password. If you leave this
x empty, the root account will be disabled and the system's initial
x user account will be given the power to become root using the "sudo"
x command.
x
x _____________________________________________________________________ x
x
x <Go Back> <Continue>
-------------------------
ルートパスワードを確認の為、再度入力する。
[!!] Set up users and passwords
x
x Please enter the same root password again to verify that you have
x typed it correctly.
x
x Re-enter password to verify:
x
x __________________________________________________________________ x
x
x <Go Back> <Continue>
-------------------------
このOS の管理主をユーザーとして入力する。
(私の場合は適当にフルネームにせず、ユーザーアカウントを入力した。)
[!!] Set up users and passwords
x
x A user account will be created for you to use instead of the root
x account for non-administrative activities.
x
x Please enter the real name of this user. This information will be
x used for instance as default origin for emails sent by this user as
x well as any program which displays or uses the user's real name. Your
x full name is a reasonable choice.
x
x Full name for the new user:
x
x _____________________________________________________________________ x
x
x <Go Back> <Continue>
-----------------------------------
今入れた管理人のアカウントを入力する。
(前回の管理人の名前などが既に入っていると思う)
[!!] Set up users and passwords
x
x Select a username for the new account. Your first name is a
x reasonable choice. The username should start with a lower-case
x letter, which can be followed by any combination of numbers and more
x lower-case letters.
x
x Username for your account:
x
x xxxxxxxxx____________________________________________________________ x
x
x <Go Back> <Continue>
-----------------------------------
今作ったユーザーアカウントのパスワードを入力する。
[!!] Set up users and passwords
x
x A good password will contain a mixture of letters, numbers and
x punctuation and should be changed at regular intervals.
x
x Choose a password for the new user:
x
x _______________________________________________________________ x
x
x <Go Back> <Continue>
-----------------------------------
今入力したユーザーアカウントのパスワードを確認の為、再度入力する。
[!!] Set up users and passwords
x
x Please enter the same user password again to verify you have typed it
x correctly.
x
x Re-enter password to verify:
x
x _____________________________________________________________________ x
x
x <Go Back> <Continue>
-----------------------------------
色々ローディングとかセットアップの進行状況が流れる・・・
(毎度のことだけど、%の値は同じ場所に対しての描画で文字化けしているけど気にせずに)
Loading additional components
k x
x 160%
x x
x Retrievinpartman-auto-lvm
x
-----------------------------------
Partition disks でディスクをどうするか!ここで選ぶ。
私が何度もこのDebian squeeze のインストーラーを試しても、インストール後に、
fdisk -l コマンドで、does not end on cylinder boundary.と言ってきたので、
これを読んでいる人も同様ならば、私の前のブログ、
「fdisk コマンドのdoes not end on cylinder boundary. って何なの? 」の様に、
NANDフラッシュのブートより、ハードディスクをfdisk コマンドによってパーティション分けを手動で行い、
このウィザードでは「Manual」を選び、マウントの方法やファイルシステムだけを選択する方法を選ぶと良い。
[!!] Partition disks
k x
x If you choose guided partitioning for an entire disk, you will next
x be asked which disk should be used.
x
x Partitioning method:
x
x Guided - use entire disk
x x Guided - use entire disk and set up LVM
x Guided - use entire disk and set up encrypted LVM
x Manual
x
x <Go Back>
xxxxxxx※ 私の前のブログの方法でパーティションを区切った場合 ※xxxxxxxxxxx
パーティションをNANDフラッシュからブートしてfdisk を使って区切ったと思う、その場合は、
ブートの指定や、マウントする場所、などをここで選ぶ。
ブートの指定はパーティションを区切ったときにも設定できたが、こちらでも行える。
勿論、ファイルシステムもここで選ぶので注意して行うこと。
#1 primary 256.9 MB B
を選び、
x Use as: do not use
x x
x Bootable flag: on
こうなっているだろうから、「Use as」より「Ext2 file system」 を選ぶ。
次に「Mount point」より「/boot - static files of the boot loader」を選ぶ。
x Use as: Ext2 file system
x
x Mount point: /boot
x x Mount options: defaults
x Label: none
x Reserved blocks: 5%
x Typical usage: standard
x Bootable flag: on
するとこうなるので、選択項目から、「one setting up the partition」を選ぶ。
続いて
#2 primary 39.4 GB
を選び、
x Use as: do not use
x
x Bootable flag: off
こうなっているだろうから、「Use as」より「Ext2 file system」 を選ぶ。
しかし、ジャーナリングの機能を使いたい場合には、「Ext3 journaling file system」を選んでも良い。
しかしNANDフラッシュからディスクチェックをする場合に、本当にジャーナリングの意味がるのかを考えると、
ジャーナリングに対応しているかどうか分からないので、私は一応カットした、ジャーナルの機能がついたExt3は
Ext2としてマウントできるらしいが、古いカーネルは対応していないと聞くので、なんとなく私の場合は
「Use as」より「Ext2 file system」を選んだが、好みの選択で選んで下さい。
次に「Mount point」より「/ - the root file system」を選ぶ。
x Use as: Ext2 file system
x x
x Mount point: none
x Mount options: defaults
x Label: none
x Reserved blocks: 5%
x Typical usage: standard
x Bootable flag: off
するとファイルシステムは任意ですが、それ以外はこうなるので、確認後、選択項目から、「one setting up the partition」を選ぶ。
続いて
#5 logical 400.5 MB
を選び、
x Use as: do not use
x
x Bootable flag: off
こうなっているだろうから、「Use as」より「swap area」を選ぶ。
x Use as: swap area
x x
x Bootable flag: off
するとこうなったと思う。確認後、選択項目から、「Done setting up the partition」を選ぶ。
最後に、
[!!] Partition disks
のメニューが
x SCSI1 (0,0,0) (sda) - 40.0 GB ATA INTEL SSDSA2M040
x > #1 primary 256.9 MB B f ext2 /boot
x > #2 primary 39.4 GB f ext2 /
x > #5 logical 400.5 MB f swap swap
こうなっているのを確認する。
そしてこれでよければ、上下キーより「Finish partitioning and write changes to disk 」を選んで、
x Write the changes to disks?
x
x <Yes> <No>
次の画面では、上記の様に書き込んでよいか聞いてくるので<Yes>を選ぶとファイルシステムをパーティション上に
設定してOSのインストールも続行される。
-------------------------------
また、もし私の前のブログを用いない場合は、例えばこんな風になります。
空にしてあるディスクが1つしかないので、選択肢も1つしかない為、これを選ぶ。
[!!] Partition disks
k x
x Note that all data on the disk you select will be erased, but not
x before you have confirmed that you really want to make the changes.
x
x Select disk to partition:
x
x SCSI1 (0,0,0) (sda) - 40.0 GB ATA INTEL SSDSA2M040
x x
x <Go Back>
x
--------------------------------
例えば、 Finish partitioning and write changes to disk を選んで進んでみた!
[!!] Partition disks
k x
x This is an overview of your currently configured partitions and mount
x points. Select a partition to modify its settings (file system, mount
x point, etc.), a free space to create partitions, or a device to
x initialize its partition table.
x
x Configure the Logical Volume Manager
x Configure encrypted volumes
x
x SCSI1 (0,0,0) (sda) - 40.0 GB ATA INTEL SSDSA2M040
x > #1 primary 254.8 MB B f ext2 /boot
x > #2 primary 39.4 GB f ext3 /
x > #5 logical 377.5 MB f swap swap
x
x Undo changes to partitions
x Finish partitioning and write changes to disk
x x
x <Go Back>
----------------------------
これでいいか?と聞いてくる、<No>になっているので、<Yes>を選んでパーティションを区切ってみる。
これは私の前のブログでも聞いてきた確認です。
[!!] Partition disks
x
x If you continue, the changes listed below will be written to the
x disks. Otherwise, you will be able to make further changes manually.
x
x The partition tables of the following devices are changed:
x SCSI1 (0,0,0) (sda)
x
x The following partitions are going to be formatted:
x partition #1 of SCSI1 (0,0,0) (sda) as ext2
x partition #2 of SCSI1 (0,0,0) (sda) as ext3
x partition #5 of SCSI1 (0,0,0) (sda) as swap
x
x Write the changes to disks?
x
x <Yes> <No>
--------------------------
面白いほどWindows 標準のターミナルソフトだと、文字が化けて変だけですが、パーティションやフォーマット処理も、
こんな感じに処理が表示されます。
Partitions formatting
k x
x 330%
x x
x Creating ext3 file system for / in partition #2 of SCSI1 (0,0,0)
x (sda)...
---------------------------
続けてパッケージもインストールしだしてくれました。31%のとき。
Installing the base system
k x
x 31%
x x
x Resolving dependencies ofbase packages...
x
-----------------
こっちは、65%のとき。CUIでも変わっていくのはとても面白い。なんせ玄箱でしかもメモリ上からのブート。
Installing the base system
k x
x 65%
x x
x Configuring man-db...
x
------------------------
ベースシステムのインストール状況でカーネルもインストールしているのがわかる。いろいろしている。
Installing the base system
k x
x 79%
x x
x Installing the kernel - retrieving and installing initramfs-tools...
x
--------------------------
ミラーさいともこの前にスキャンしていたけど、キャプチャしそびれた^^;
aptコマンドでインストールしたい物でも探す準備をしていたみたいです。
Configuring apt
k x
x 16%
x x
x Scanning the mirror...
x
x <Cancel>l>
x
--------------------------
ここに書き込めないほど早く終わってしまうメニューもあれば、ちょくちょく切り替わって出てきたりする
メニューもある。勿論キャプチャーし忘れもあると思う、余りにも長い時間だし。
Select and install software
k x
x 1 0%
x x
x Upgrading software...
x
--------------------------
簡単に言うと、レポート提出に参加するか?みたいな内容だと思う。
ウィークリーどうとかあるので、パケットを送出するのだと思う。
都合が悪い人は<No>を選ぶ、パッケージの出来具合に貢献したければ<Yes>です。
[!] Configuring popularity-contest
x
x The system may anonymously supply the distribution developers with
x statistics about the most used packages on this system. This
x information influences decisions such as which packages should go on
x the first distribution CD.
x
x If you choose to participate, the automatic submission script will
x run once every week, sending statistics to the distribution
x developers. The collected statistics can be viewed on
x http://popcon.debian.org/.
x
mx This choice can be later modified by running "dpkg-reconfigure
x popularity-contest".
x
x Participate in the package usage survey?
x
x <Go Back> <Yes> <No>
---------------------
これこれ! これ毎回ディストリービューションによって迷う私は初心者ですw
やっぱり何がインストールされるか分からないので、出来るだけ何も選ばずに、
ウィザードが終わったら自分でカスタマイズするべきなんでしょう。
たとえばSQL database を選ぶと、PostgreSQL(ぽすとぐれすきゅーえる)がインストールされちゃいます・・・
MySQL がいいんですが・・・・
なので出来るだけ選ばないと、デフォルトで選ばれている、
「Standard system utilities」だけになると思います。
あとX Window 関係だと思う、「Graphical desktop environment」とかもあり、
とても興味がありますが、リモートデスクトップ接続オンリーの画面環境をコマンドのみで構築する方法とか、
やってみたいですが、それも今回の目的ではないので、後回しにしたいと思います。
[!] Software selection
k x
x At the moment, only the core of the system is installed. To tune the
x system to your needs, you can choose to install one or more of the
x following predefined collections of software.
x
x Choose software to install:
k
x Graphical desktop environment
x [ ] Web server
xx [ Print server
] DNS server
] File server
x ] Mail server
x ] SQL database
x ] SSH server
x [ ] Laptop stem utilities
x
x <Go Back> <Continue>
---------------------------------
ソフトウェアをインストールしだした。
Select and install software
k x
x 1 0%
x x
x Upgrading software...
x
--------------------------------
インストール終わったので、CDとか取るとかしとくといいよって教えてくれている。
PCならBIOSの設定を戻すとかするのだろうけど、インストーラーはU-BOOTの仕組みを使って
玄箱PROのメモリ上にtftpから持ってきたイメージを置いた物だから、
再び参照しなければ、特に再び参照するような環境変数を触ったりしていないので、
そのままでよいかと思う。
<Continue>を選ぶ。
[!!] Finish the installation
x
x Installation complete
x Installation is complete, so it is time to boot into your new system.
x Make sure to remove the installation media (CD-ROM, floppies), so
x that you boot into the new system rather than restarting the
x installation.
x
mx <Go Back> <Continue>
----------------------------------
リブートされる。
Finishing the installation
k
84%
x
Gathering information for installation report...
x [12103.662308] Restarting system.
----------------------------------
ここで、玄箱PRO のNANDフラッシュメモリから起動をまだしてしまうので、
起動前のU-BOOTによって、Debian をインストールしたディスクから起動出来る様に、
U-BOOTの環境変数を変えておく必要がある。
--------------------------------
Debian が立ち上がるまで
Orion1 CPU = Low
=== KURO U-Boot. ===
** LOADER **
** KUROBOX BOARD: KURO_BOX LE (CFG_ENV_ADDR=fffff000)
U-Boot 1.1.1 (Apr 10 2007 - 18:10:08) Marvell version: 1.12.1 - TINY
・・・
(略)
・・・
<<stop_sound>>
## Booting image at 00100000 ...
Image Name: Debian kernel
Created: 2012-04-18 3:04:21 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1316220 Bytes = 1.3 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02000000 ...
Image Name: Debian ramdisk
Created: 2012-04-18 3:04:21 UTC
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2344021 Bytes = 2.2 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Starting kernel ...
・・・
(略)
・・・
Debian GNU/Linux 6.0 debian ttyS0
debian login:
-----------------------------------------------------------------// これでDebian のインストールが完了したことが分かる。
いつもの様に前置きが長いので先に概要を述べておきます。
今回の最終的なテーマ概要
「Linux のfdisk コマンド先生がdoes not end on cylinder boundary.とおっしゃいますが
先生、もっと具体的に教えて下さいよ! え? 調べろって事ですか???」
と言うことです^w^;
具体性を持たせて軽く説明すれば、fdisk コマンド先生は言ってくるんです!w
(黒箱PRO にDebian squeeze のインストーラーによるパーティショニングの例です)
root@debian:/# fdisk -l
Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000ac41
Device Boot Start End Blocks Id System
/dev/sda1 * 1 32 248832 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 32 4820 38462464 83 Linux
/dev/sda3 4820 4866 368641 5 Extended
/dev/sda5 4820 4866 368640 82 Linux swap / Solaris
多分・・・シリンダでStart とEndの合致した所がマズイ!のだと思いますので、
上記について調べます^w^;
では長ぁーーーい前置き
ちょっとまった! その前に断っておきます。
前回のブログで黒箱PRO のTFTPブートによるインストールが成功したので次回のブログで述べます!って
書きましたが、こっちが気になってしょうがないので、こっちの話題からにします^^;
では長い前置きをどうぞ>w<;
超、常識的な技術っては、知らない間に使っていて、誰かに尋ねるのが恥ずかしいくらいではあるが、
その技術に依存して色々な物事に使っている場合があると思う。(独り言だと思って流してくれてもいい^^;)
例えば、オペレーティングシステム(OS)で平気な顔をしてハードディスクやSSDを使っているが、
それがうまく動かなくて困ると言うことは、なかなか無くて、いやむしろ、なかなか無いのではなく、
オペレーションとしてOSがエラー様の処理をしてくれるので、あまり気にしなくて良いことが多い。
だから複雑な作りをしているハズのハードディスクの技術的な事柄で躓くことなんて、
これまで少なかった、いやWindows という名のOS を使っている分に、
常日頃気にしなかった、多分、超効率を求めたりしなければ、気にしなくて良いのが
Windows というOSの設計なんだろうと思う。
しかしLinux を使い出すと、その複雑だという事柄すら、出来るだけ自分で噛み砕いて、
その複雑であろう根本から自由に指定して使おう!と言うのがLinux というOSだと思う。(UNIXね)
最近はPC上にLinux を入れたりしても、何も気にせずに使っていたが、
いざCUI環境だけで動かしたい!と思って黒箱RPO(ARMプロセッサ)に、
Linux を入れだして、些細な警告に悩んで思った。
今まで当たり前として使っていた事柄が、やはり凄い技術の上で動いていたと、
実感されることはとても多い。
しかし、考えているということは、そんなに前向きなことばかりでもないが、
やはり気になるか気にならないかで戻ってみたりして、結局考えたりして、
調べてみたりしている。
つまり、知ったからってどうってことでもないかもしれない、
しかし知ることを選んだなら知るべきだし、何度も考えるなら知る術を避けて通れないなら、
またもしくは、知らなければいけない何かを感じたり、
はたまた、知ることが苦でないならやってみたいと思ったり、
やっっぱり面倒だな・・・・ とか考えたり気苦労もして、色々人生観が決まるのが人間か?w
とかまで考えていることもあるだろう・・・・?(何の話だっけ・・・w)
そこでやっぱり忘れない程度にブログにでもその事柄を残そうと思った。
(結構複雑に単純な事を追求した、もしくは、単純なことを複雑に考えた?)
今回、なんだかやはり、考えないといけないと思ったことは、
Linux のコマンド、fdisk だった。その経緯を述べる。
単純に一言で言えば「Linux コマンドの fdisk のパーティションの状態出力の警告が気になって仕方ない!」
だけなんですが、突っ込みは如何様にでもどうぞ!?w
では具体的に、黒箱PRO へarmel Debian であるsquuze(Debian6系)をウィザードで入れると、
少々気がかりな現象がどうしても起こる、これは何度インストールし直しても、
やはり起こる、結局4度は色々やってみたが、どうしても起こるんです。(そんなに連続して入れ直すな!って?w)
それは、fdisk でマウントしているディスクを見ると、
「does not end on cylinder boundary.」と出て、パーティションとパーティション間で、
シリンダーをまたいだ読み書きが発生していると警告される。
つまりこれはどういう警告なのか? 気にするべきことなのか???
結局はハードディスクの作りの理解をどうしても必要とし、
物事を噛み砕くのを目的としてブログに載せようと思ったので、
基本的なハードディスクの説明を調べて述べてみる。
何か他のサイトでは、書き込みの仕組みと、書き込みの単位の事柄、
説明の順序が一緒で分かりにくく思えたので、自分で極力分けて
くどいくらい噛み砕いて書いてみた。
○○○ハードディスクの機械的な機構表現○○○
1.円盤があり、これをプラッタと言う。
2.プラッタは両面に記憶領域を物理的にもっている、つまり両面が記録面である。
3.記憶領域を読み書きする為にヘッダという読み書き装置がついている。
4.ヘッダはプラッタの面に対して水平に往復移動運動をして記録領域を決める、
この移動動作をシークという。
5.ハードディスク内部のプラッタは1枚とは限らず、プラッタは複数枚あるのが一般的。
6.プラッタは同じ回転するプラッタの軸に固定されている為、同一回転角、同一回転数で回っている。
7.プラッタの両面それぞれ記録面を持つ為、プラッタの両面にヘッダがある。
8.複数のプラッタがあれば、複数のヘッダがあるが、全てプラッタ上のヘッダは、
同一の1つのヘッダの軸を元に固定され全て同じ動きをする。
9.プラッタはプラッタごと連動、ヘッダはヘッダごと連動して動く事から、
一回のシークで読み書きできる記録面は、ヘッドの数だけ増える事になる。
10. 9.の同時に記録できる場所の数を、プラッタに対するヘッダの往復連動を、
エンジンのシリンダに見立てた意味合いで、シリンダと言う単位を用いて表現する。
○○○ハードディスクの論理的な記録表現○○○
11.ヘッダがプラッタに対して書き込む1つの領域は、セクタと呼ばれる、
1セクタは512バイトとされるのがセオリーだ。
12.ヘッダはプラッタに対して移動するが、プラッタは回転しているので、
円盤を円を描く様に読み書きすることになる、この部分は一直線の円となり、
トラックと呼ばれる、陸上系の競技場のトラックと同一な意味合いで考えれば分かり易い。
13.一度トラックにシークした後、わざわざ再度シークさせて他のトラックに
分散させて再度シークするのには時間の無駄がある、一度シークすれば、そのトラックに
連続して書き込めば書き込みスピードも速く、整列したデータが取り扱える。
14.13.でいう連続したトラックに書き込む大きさをクラスタと呼び、
そのクラスタの大きさはファイルシステムの形式などで選べたり依存する。
○○○ハードディスクの総合的な書き込みの時間と書き込みの効率化○○○
15.複数のプラッタに対して1度のシークで、それぞれのプラッタに、
同一の1つまとまった情報を、ヘッダの数だけ分散して情報を書き込めば、
高速化に繋がる。
16.逆に言えば、シリンダーとして見立てているのに、個々のプラッタ上の
ヘッダが、別々の情報に対して読み書きをしていると、1つの情報に対して読み込む為に
シークをしても、他の場所にまたシークして続きを読み込まなければいけない事が増える、
つまり1度に書き込める量が増える使い方をするのならば、同じ情報に対して書き込むべきだ。
17.クラスタの大きさが変えられる場合、クラスタのサイズを大きくして、
クラスタのサイズよりも小さな情報を沢山扱うとディスクの無駄が大きい。
18.クラスタの大きさが変えられる場合、クラスタのサイズを小さくすると、
記憶領域を純粋に読み書きしたい領域以外に、プラッタの管理領域として
記憶領域を使ってしまうので効率が悪い。
前置き終わりかな・・・
さて、やっと・・・・・・・・話は戻り、黒箱PRO(でなくてもいいかもしれないけど)のLinux で
fdisk がとやかく警告を言ってくる件は、多分、
「インストールウィザードのパーティションの区切り方が、シリンダ単位でなく、要領単位で区切ってしまう」
という厄介な方法を取っているからだと予想します(と先に述べる)。
つまり、上記のハードディスクの仕組みから読み解けば、
同一シリンダの読み書きの最中に、他のパーティションをまたぐと、効率が悪くなると、
それが多分fdisk コマンド先生はおっしゃっているんだと思う(と先に述べる)。
一応、パーティショニングを黒箱PRO のNAND(256M)のBusyBoxのfdisk コマンドによって、
手動で区切りなおした。インストールはまだだから、そのパーティショニングをLinux が
使ってくれる?のかは分からないけど、多分大丈夫??だと思う。
もしかすると、インストーラーに向けた設定も必要になるのかまでは、調べていない。
~ # fdisk /dev/sda
The number of cylinders for this disk is set to 38166.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-38166, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-38166, default 38166): 245
Command (m for help): a
Partition number (1-4): 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (246-38166, default 246):
Using default value 246
Last cylinder or +size or +sizeM or +sizeK (246-38166, default 38166): 37784
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 3
First cylinder (37785-38166, default 37785):
Using default value 37785
Last cylinder or +size or +sizeM or +sizeK (37785-38166, default 38166):
Using default value 38166
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (37785-38166, default 37785):
Using default value 37785
Last cylinder or +size or +sizeM or +sizeK (37785-38166, default 38166):
Using default value 38166
Command (m for help): t
Partition number (1-5): 5
Hex code (type L to list codes): 82
Changed system type of partition 5 to 82 (Linux swap)
Command (m for help): p
Disk /dev/sda: 40.0 GB, 40020664320 bytes
64 heads, 32 sectors/track, 38166 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 245 250864 83 Linux
/dev/sda2 246 37784 38439936 83 Linux
/dev/sda3 37785 38166 391168 5 Extended
/dev/sda5 37785 38166 391152 82 Linux swap
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
SCSI device sda: 78165360 512-byte hdwr sectors (40021 MB)
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 < sda5 >
SCSI device sda: 78165360 512-byte hdwr sectors (40021 MB)
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 < sda5 >
Syncing disks.
~ #
結局、赤色で表示した、シリンダのEND とSTART の合致を
手動で値をずらして回避してみた。 これがやってみた回避策でした・・・
ちょっと余談
念のために述べておくが、これは私のハードディスク(SSDだけど)を元に計算した値を使っているので、
自身のハードディスクの値は、
自分のディスクの1つのシリンダの値 x 指定したスタートとエンドのシリンダの大きさ x 512バイトで出せるので、
例えば私のSSDは、1つのシリンダの値が2048と私のブログにある通り表示されるので、
400Mバイト付近のスワップファイルを作ろうと思った場合、
400,000,000 ÷ 2048 ÷ 512 とすれば、381.1469・・・みたいになる。
(私は100円電卓を使って計算したので、100円電卓だと 表示が8ケタなので^^;
40,000,000 ÷ 2048 ÷ 512 として出た値、38.11469・・・を10倍している)
計算してみると、スタートとエンドのシリンダの差が381付近が400Mあることが分かると思う。
私の場合、なんとなく容量が大きいディスクだし、表示で400Mを切っているのはなんだかなぁ?って思ったので
切り上げて382にして計算しました。
さてここで問題、私の場合の400M以上にしたい場合の実際にパーティションの値は、
数値の都合上、エンドのシリンダー - スタートのシリンダー +1 = 382 である。
なぜかって?
それはスタートの値が0 で計算した場合、1がエンドだと、1シリンダー使った計算になる・・・?
ハズレ!!!
0がスタートで1で終わりは、0と1の2シリンダー分、つまり2シリンダー使った計算になるから。
数のマジックなので、引き算をするとスタート地点のシリンダーは排除してしまうので+1した値が実際の値です!!!
気をつけて。
またまた、かなり話は変わります。
fdisk で赤字に下線で書いた部分、なぜか当初はヘッドの数が255でしたが、
後から64になっているのです・・・
これじゃ全く別物のSSDじゃないですか・・・・
私が意としていないのに、SSDがなのか、OSがなのか、
勝手に仮想化した内部構造を変えてしまっています!!!
計算も確かに合ってそうですが、だけどなんか・・・変な気分です。
結構問題あるんじゃないかと思います、パーティション区切った後のログとか、
他のソフトウェアが記憶して値を流用していたとすれば、
途中で値が変わると、ファイルシステム情報が崩壊している様に見えるかもしれないです・・・よね?!
理由が分からないですが、SSDの扱いが内部的に変わることなんてあるのでしょうか???
LBAで仮想化されているし、私の場合はSSDなのでヘッドの数とかそういう問題はむしろ無いはずですが、
かなり気持ちが悪いです。
SSDの構造をハードディスクと見立てた時に、メーカー独自にメモリアクセスを
並列化させて高速化していたりすると、実際には話しは変わるでしょうが、
レガシーな規格に対して逆行までして物理的に同一にわざわざ見せなくても
十分に電気的な溶媒に置き換わっただけでシリンダの考えは問題視しなくても
良い気もします・・・
正直、パーティションとパーティション間で、シリンダがかぶっている様に見えているのは、
SSD ではどうでもいいことかもしれない。
けど思ったのは、良く考えたら、クラスタの大きさはファイルシステム形式で依存しているから、
ファイルシステムがディスクの作りを考慮して読み書きの単位をシリンダや、クラスタ単位を
意識している読み書きならば、シリンダをまたぐパーティションは、ディスクIOの同時アクセスの手数や、
ディスクアクセスによるロックや、シークタイムのウェイトなどで、
何処かで微妙に良いことが無いんじゃないかな?って思えた。
SSDだからといって、ファイルシステムにアクセス方法がゆだねられている以上、
シリンダをまたぐファイルシステムは余り宜しくないと思えて仕方ない。
つまり、少し言い換えると、きっちりとファイルシステムとクラスタは依存していると言えるので、
SSDだからシリンダとは関係しないよ、だからシリンダ内でパーティションを
またぐ使い方をしていても大丈夫だよ?なんていうのはどうも
嘘になることもあるんじゃないかなって予想した。
やっぱり出来れば、きれいにシリンダーをまたがないパーティションを切るべきだと思った。
Linux の設定でいつも困らないのは、本当の意味の解決を探したいからこそ、
その答えは、どのLinux 環境でも依存しない共通設定方法を
見つけることかもしれないと思った。
Linux は奥深い。
やっぱりまだ、本当の結論には達していないが、これで超長い考えたときのメモを終わろうと思う。
超お粗末でした<_ _>