Aug 9, 2003
onlsbc1, コンパクトフラッシュ上のLinuxシステム復旧
--- インストール #10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(http://www-online.kek.jp/~inoue/para-CAMAC/
Work/SBC-Linux14.html)
高エネルギー加速器研究機構
素粒子原子核研究所
物理、オンライングループ
井上 栄二
目的
Red Hat Linux 最終版の復旧用 KNOPPIXシステムを作る。
(1). コンパクトフラッシュのtarファイルを作成
(2). KNOPPIXシステムの再構築
--------------------------------------------------------------------
(1). コンパクトフラッシュのtarファイルを作成
(1-1). 前準備
やったのは以下の点です。
・ 電源onからシステムが立ち上がるまでの間にRedHatの文字が
コンソール上に表示されないようにした。
・ toyoのアカウントを作った。 toyo と root のパスワードを
ccnet2003 にした。
・ harada、yasu、inoueのアカウントを削除した。 ホーム
ディレクトリも削除した。
・ setupユティリティでネットワーク設定ができるようにした。
・ /etc/fstabを修正。 onlpara:/home2/onlpara-wrkを
マウントしないようにした。
・ /home/toyoの下にCC/NETで必要なファイルを置いた。
/home/toyo/camac <-- 8月4日現在の
onlpara:/home2/onlpara-wrk/yasu/camac
をコピーした。
/home/toyo/remote-camac <-- 同上。 remote-camac
をコピーした。
/home/toyo/public_html <-- Webアプリケーションの
ファイル一式を置いた。
/home/toyo/bin <-- ~/camac の実行イメージの
シンボリックリンク
注.
~/camac と ~/remote-camacには同じファイル名の
実行イメージが在るので、~/camacの実行イメージ
だけを~/binにシンボリックリンクしました。
(1-2). KNOPPIXのCD作成
最新版のKNOPPIXをベースにして、CC/NETの復旧用CDを作成する。
(1-2-1). KNOPPIXの入手
産総研から isoファイルをダウンロードする。
knoppix_20030606-20030717.iso
(1-2-2). CDの作成
Windows XP 上で Easy CD creator を使って上記の isoファイルをCDに書き込
んだ。
(1-3). KNOPPIX上で tarファイルを作成
開発用のPCのUSBコネクタに、USB-コンパクトフラッシュ・リーダ/ライタを接続
する。 リーダ/ライタには onlsbc2で構築したLinuxシステムが入っているコン
パクトフラッシュを装着する。 その後、上記の項目(1-2-2)で作成した knoppix
システムのCDをセットし knoppixシステムを立ち上げる。
(1-3-1). KNOPPIXシステム上にコンパクトフラッシュのシステムをセーブ
root@ttyp0[knoppix]# mkdir /mnt1
root@ttyp0[knoppix]# mkdir /mnt2
root@ttyp0[knoppix]# mount -t ext3 /dev/sdb1 /mnt1
mount: /dev/sdb1 は マウント済か /mnt1 が使用中です
mount: mtab によると、/dev/sdb1 は /mnt/sdb1 にマウントされています
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1661 310 85% /
/dev/cdrom 704772 704772 0 100% /cdrom
/dev/cloop 1864688 1864688 0 100% /KNOPPIX
/ramdisk 408980 5520 403460 2% /ramdisk
/dev/sdb1 500176 105568 394608 22% /mnt/sdb1
/dev/sda1 5044156 4328148 459776 91% /mnt/sda1
/dev/sda3 9621880 5385860 3747244 59% /mnt/sda3
/dev/sda5 10231392 2597520 7633872 26% /mnt/sda5
root@ttyp0[knoppix]# ls -l /mnt/sdb1
合計 0
root@ttyp0[knoppix]# umount /mnt/sdb1
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# mount -t ext3 /dev/sdb1 /mnt1
root@ttyp0[knoppix]# ls -l /mnt1
合計 148
drwxr-xr-x 2 root root 2048 2000-01-16 10:48 bin
drwxr-xr-x 3 root root 1024 2003-08-01 10:06 boot
drwxr-xr-x 20 root root 116736 2003-08-05 08:22 dev
drwxr-xr-x 25 root root 3072 2003-08-05 08:22 etc
drwxr-xr-x 3 root root 1024 2003-08-04 13:44 home
drwxr-xr-x 2 root root 1024 2001-06-22 03:32 initrd
drwxr-xr-x 5 root root 3072 2000-01-16 10:49 lib
drwx------ 2 root root 12288 2000-01-16 10:34 lost+found
drwxr-xr-x 2 root root 1024 2003-04-11 08:45 mnt
drwxr-xr-x 2 root root 1024 2003-04-08 16:52 mnt1
drwxr-xr-x 2 root root 1024 1999-08-24 01:03 opt
drwxr-xr-x 2 root root 1024 2000-01-16 10:35 proc
drwxr-xr-x 4 root root 1024 2000-04-03 15:18 ramfs
drwxr-x--- 3 root root 1024 2003-08-01 09:30 root
drwxr-xr-x 2 root root 3072 2000-01-16 10:48 sbin
lrwxrwxrwx 1 root root 9 2000-04-03 15:18 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 2003-04-10 14:54 usr
lrwxrwxrwx 1 root root 9 2000-04-03 15:18 var -> ramfs/var
root@ttyp0[knoppix]#
knoppix の自動マウントは腐っているようだ。
root@ttyp0[knoppix]# mount onlpara.kek.jp:/home2/onlpara-wrk /mnt2
root@ttyp0[knoppix]# ls -l /mnt2
合計 16
drwxr-xr-x 5 502 502 4096 2003-07-18 12:54 harada
drwxrwxrwx 22 500 500 4096 2003-08-04 13:27 inoue
drwxrwxrwx 8 root root 4096 2003-08-04 14:52 root
drwxr-xr-x 22 501 501 4096 2003-07-30 20:05 yasu
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# cd /mnt1
root@ttyp0[mnt1]# ls -l
合計 148
drwxr-xr-x 2 root root 2048 2000-01-16 10:48 bin
drwxr-xr-x 3 root root 1024 2003-08-01 10:06 boot
drwxr-xr-x 20 root root 116736 2003-08-05 08:22 dev
drwxr-xr-x 25 root root 3072 2003-08-05 08:22 etc
drwxr-xr-x 3 root root 1024 2003-08-04 13:44 home
drwxr-xr-x 2 root root 1024 2001-06-22 03:32 initrd
drwxr-xr-x 5 root root 3072 2000-01-16 10:49 lib
drwx------ 2 root root 12288 2000-01-16 10:34 lost+found
drwxr-xr-x 2 root root 1024 2003-04-11 08:45 mnt
drwxr-xr-x 2 root root 1024 2003-04-08 16:52 mnt1
drwxr-xr-x 2 root root 1024 1999-08-24 01:03 opt
drwxr-xr-x 2 root root 1024 2000-01-16 10:35 proc
drwxr-xr-x 4 root root 1024 2000-04-03 15:18 ramfs
drwxr-x--- 3 root root 1024 2003-08-01 09:30 root
drwxr-xr-x 2 root root 3072 2000-01-16 10:48 sbin
lrwxrwxrwx 1 root root 9 2000-04-03 15:18 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 2003-04-10 14:54 usr
lrwxrwxrwx 1 root root 9 2000-04-03 15:18 var -> ramfs/var
root@ttyp0[mnt1]#
root@ttyp0[mnt1]# pwd
/mnt1
root@ttyp0[mnt1]# ls -l /mnt2/root/knoppix
合計 149420
-rw-r--r-- 1 nobody nogroup 152848889 2003-05-29 14:00 compact.tar.gz
root@ttyp0[mnt1]#
root@ttyp0[mnt1]# tar cf /mnt2/root/knoppix/compact-aug052003.tar .
root@ttyp0[mnt1]# cd /mnt2/root/knoppix
root@ttyp0[knoppix]# ls -l
合計 583780
-rw-r--r-- 1 nobody nogroup 444344320 2003-08-05 14:43 compact-aug052003.tar
-rw-r--r-- 1 nobody nogroup 152848889 2003-05-29 14:00 compact.tar.gz
root@ttyp0[knoppix]# gzip compact-aug052003.tar
root@ttyp0[knoppix]# ls -l
合計 299088
-rw-r--r-- 1 nobody nogroup 153102602 2003-08-05 14:43 compact-aug052003.tar.gz
-rw-r--r-- 1 nobody nogroup 152848889 2003-05-29 14:00 compact.tar.gz
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# cd
root@ttyp0[knoppix]# umount /mnt1
root@ttyp0[knoppix]# umount /mnt2
root@ttyp0[knoppix]#
ここで knoppixシステムをシャットダウンして、リーダライタから onlsbc2の
コンパクトフラッシュを外す。 代わりに復旧用のコンパクトフラッシュの
メディアを装着して knoppixシステムを立ち上げる。
(1-3-2). セーブしたコンパクトフラッシュのシステムからの再構築
CDの knoppixシステムの中にンパクトフラッシュ上のシステムのtarファイルを
組み込む前に tarファイルからコンパクトフラッシュ上にシステムを構築して
起動可能なシステムを作れることを確認する。
(1-3-2A). コンパクトフラッシュ上にファイルシステムを作成
root@ttyp1[knoppix]# fdisk /dev/sdb
コマンド (m でヘルプ): m
コマンドの動作
a ブート可能フラグをつける
b bsd ディスクラベルを編集する
c dos 互換フラグをつける
d 領域を削除する
l 既知の領域タイプをリスト表示する
m このメニューを表示する
n 新たに領域を作成する
o 新たに空の DOS 領域テーブルを作成する
p 領域テーブルを表示する
q 変更を保存せずに終了する
s 空の Sun ディスクラベルを作成する
t 領域のシステム ID を変更する
u 表示/項目ユニットを変更する
v 領域テーブルを照合する
w テーブルをディスクに書き込み、終了する
x 特別な機能 (エキスパート専用)
コマンド (m でヘルプ): p
Disk /dev/sdb: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = シリンダ数 of 1008 * 512 = 516096 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sdb1 * 1 993 500440+ 6 FAT16
コマンド (m でヘルプ): d
Selected partition 1
コマンド (m でヘルプ): p
Disk /dev/sdb: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = シリンダ数 of 1008 * 512 = 516096 bytes
デバイス ブート 始点 終点 ブロック ID システム
コマンド (m でヘルプ): n
コマンドアクション
e 拡張
p 基本領域 (1-4)
p
領域番号 (1-4): 1
最初 シリンダ (1-993, 初期値 1):
初期値 1 を使いま
終点 シリンダ または +サイズ または +サイズM または +サイズK (1-993, 初期値 993):
初期値 993 を使いま
コマンド (m でヘルプ): p
Disk /dev/sdb: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = シリンダ数 of 1008 * 512 = 516096 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sdb1 1 993 500440+ 83 Linux
コマンド (m でヘルプ): w
領域テーブルは交換されました!
ioctl() を呼び出して領域テーブルを再読込みしま
ディスクを同期させま
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# mke2fs -j /dev/sdb1
mke2fs 1.34-WIP (21-May-2003)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
125488 inodes, 500440 blocks
25022 blocks (5.00%) reserved for the super user
First data block=1
62 block groups
8192 blocks per group, 8192 fragments per group
2024 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@ttyp1[knoppix]#
(1-3-2B). tarファイルからのシステムの再構築
root@ttyp1[knoppix]# mkdir /mnt1
root@ttyp1[knoppix]# mkdir /mnt2
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# mount -t ext3 /dev/sdb1 /mnt1
root@ttyp1[knoppix]# mount onlpara.kek.jp:/home2/onlpara-wrk /mnt2
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1661 310 85% /
/dev/cdrom 704772 704772 0 100% /cdrom
/dev/cloop 1864688 1864688 0 100% /KNOPPIX
/ramdisk 408980 5420 403560 2% /ramdisk
/dev/sdb1 484602 8239 451341 2% /mnt1
onlpara.kek.jp:/home2/onlpara-wrk
22659864 1349224 20159584 7% /mnt2
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# cd /mnt1
root@ttyp1[mnt1]# ls -l
合計 12
drwx------ 2 root root 12288 2003-08-05 15:34 lost+found
root@ttyp1[mnt1]# ls -l /mnt2/root/knoppix
合計 299088
-rw-r--r-- 1 nobody nogroup 153102602 2003-08-05 14:43 compact-aug052003.tar.gz
-rw-r--r-- 1 nobody nogroup 152848889 2003-05-29 14:00 compact.tar.gz
root@ttyp1[mnt1]# tar xzf /mnt2/root/knoppix/compact-aug052003.tar.gz
root@ttyp1[mnt1]# ls -l
合計 136
drwxr-xr-x 2 root root 2048 2000-01-16 10:48 bin
drwxr-xr-x 3 root root 1024 2003-08-01 10:06 boot
drwxr-xr-x 20 root root 116736 2003-08-05 08:22 dev
drwxr-xr-x 25 root root 2048 2003-08-05 08:22 etc
drwxr-xr-x 3 root root 1024 2003-08-04 13:44 home
drwxr-xr-x 2 root root 1024 2001-06-22 03:32 initrd
drwxr-xr-x 5 root root 3072 2000-01-16 10:49 lib
drwx------ 2 root root 1024 2000-01-16 10:34 lost+found
drwxr-xr-x 2 root root 1024 2003-04-11 08:45 mnt
drwxr-xr-x 2 root root 1024 2003-04-08 16:52 mnt1
drwxr-xr-x 2 root root 1024 1999-08-24 01:03 opt
drwxr-xr-x 2 root root 1024 2000-01-16 10:35 proc
drwxr-xr-x 4 root root 1024 2000-04-03 15:18 ramfs
drwxr-x--- 3 root root 1024 2003-08-01 09:30 root
drwxr-xr-x 2 root root 3072 2000-01-16 10:48 sbin
lrwxrwxrwx 1 root root 9 2003-08-05 15:45 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 2003-04-10 14:54 usr
lrwxrwxrwx 1 root root 9 2003-08-05 15:45 var -> ramfs/var
root@ttyp1[mnt1]
root@ttyp1[mnt1]# pwd
/mnt1
root@ttyp1[mnt1]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1661 310 85% /
/dev/cdrom 704772 704772 0 100% /cdrom
/dev/cloop 1864688 1864688 0 100% /KNOPPIX
/ramdisk 408980 5420 403560 2% /ramdisk
/dev/sdb1 484602 434066 25514 95% /mnt1
onlpara.kek.jp:/home2/onlpara-wrk
22659864 1349224 20159584 7% /mnt2
root@ttyp1[mnt1]#
ok. tarファイルを展開するのに、私のPCでは約30分かかった。
(1-3-2C). コンパクトフラッシュにラベルを付ける
root@ttyp1[mnt1]# e2label /dev/sdb1
root@ttyp1[mnt1]# e2label /dev/sdb1 /
root@ttyp1[mnt1]# e2label /dev/sdb1
/
root@ttyp1[mnt1]#
(1-3-2D). ブートブロックのセットアップ
root@ttyp1[sbin]# pwd
/mnt1/sbin
root@ttyp1[sbin]# ls -l grub
-rwxr-xr-x 1 root root 248416 2002-09-06 05:59 grub
root@ttyp1[sbin]# ./grub
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.92 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd2,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd2)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd2)"... 22 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd2) (hd2)1+22 p (hd2,0)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.
grub> quit
root@ttyp1[sbin]#
root@ttyp1[sbin]# cd /
root@ttyp1[/]# umount /mnt1
root@ttyp1[/]#
注.
私のPC環境は以下のとおり。
/dev/hda1 (hd0,0) <-- 内蔵IDEハードディスク
/dev/hda2 (hd0,1) <-- 内蔵IDEハードディスク
/dev/sda1 (hd1,0) <-- 外付けUSBハードディスク
/dev/sda2 (hd1,1) <-- 外付けUSBハードディスク
/dev/sda3 (hd1,2) <-- 外付けUSBハードディスク
/dev/sda5 (hd1,3) <-- 外付けUSBハードディスク
/dev/sdb1 (hd2,0) <-- これがコンパクトフラッシュ
^ ^
| |
デバイス名 パーティション番号
デバイス名およびパーティション番号は、ユーザのPC環境によって変わる
ので注意すること。
(1-3-3). 再構築したコンパクトフラッシュのシステムの起動テスト
ここで knoppixシステムをシャットダウンして、記の項目(1-3-2)で作成した
コンパクトフラッシュのシステムをCC/NETに装着し、起動してみる。
onlsun1[126]% ssh -l toyo onlsbc2.kek.jp
toyo@onlsbc2.kek.jp's password:
[toyo@onlsbc2 toyo]$ ls -l /
total 135
drwxr-xr-x 2 root root 2048 Jan 16 2000 bin
drwxr-xr-x 3 root root 1024 Aug 1 10:06 boot
drwxr-xr-x 20 root root 116736 Aug 6 08:01 dev
drwxr-xr-x 25 root root 2048 Aug 6 08:00 etc
drwxr-xr-x 3 root root 1024 Aug 4 13:44 home
drwxr-xr-x 2 root root 1024 Jun 22 2001 initrd
drwxr-xr-x 5 root root 3072 Jan 16 2000 lib
drwx------ 2 root root 1024 Jan 16 2000 lost+found
drwxr-xr-x 2 root root 1024 Apr 11 08:45 mnt
drwxr-xr-x 2 root root 1024 Apr 8 16:52 mnt1
drwxr-xr-x 2 root root 1024 Aug 24 1999 opt
dr-xr-xr-x 37 root root 0 Aug 6 2003 proc
drwxr-xr-x 5 root root 1024 Aug 6 08:00 ramfs
drwxr-x--- 3 root root 1024 Aug 1 09:30 root
drwxr-xr-x 2 root root 3072 Jan 16 2000 sbin
lrwxrwxrwx 1 root root 9 Aug 5 15:45 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 Apr 10 14:54 usr
lrwxrwxrwx 1 root root 9 Aug 5 15:45 var -> ramfs/var
[toyo@onlsbc2 toyo]$
ok. システムは正常に立ち上がった。
(2). KNOPPIXシステムの再構築
上記の項目(1-3-1)で作成したtarファイル、compact-aug052003.tar.gzを
KNOPPIXシステムのCDの中に組み込む。
(2-1-1). CD上のKNOPPIXシステムをハードディスク上に展開
作業用に用意したUSBハードディスク上に、CD上のKNOPPIXシステムを展開する。
(2-1-1A). ハードディスク上に作業領域を確保
root@ttyp0[knoppix]# fdisk /dev/sda
このディスクのシリンダ数は 3648 に設定されています。
間違いではないのですが、1024 を超えているため、以下の場合
に問題を生じうる事を確認しましょう:
1) ブート時に実行するソフトウェア (例. バージョンが古い LILO)
2) 別の OS のブートやパーティション作成ソフ
(例. DOS FDISK, OS/2 FDISK)
コマンド (m でヘルプ): p
Disk /dev/sda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sda1 1 638 5124703+ 83 Linux
/dev/sda2 639 1913 10241437+ f Win95 拡張領域 (LBA)
/dev/sda3 1914 3130 9775552+ 83 Linux
/dev/sda4 3131 3648 4160835 82 Linux スワップ
/dev/sda5 639 1913 10241406 b Win95 FAT32
コマンド (m でヘルプ): q
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# mke2fs /dev/sda3
mke2fs 1.34-WIP (21-May-2003)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1224000 inodes, 2443888 blocks
122194 blocks (5.00%) reserved for the super user
First data block=0
75 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# mkswap /dev/sda4
Setting up swapspace version 1, size = 4260687 kB
root@ttyp0[knoppix]#
注.
ここでswapoff, swaponを実行するかシステムをリブートしないと
スワップ領域が切り替わらない
root@ttyp0[knoppix]# reboot
(2-1-1B). CD-ROM上のファイルをハードディスク上に展開
root@ttyp2[knoppix]# mount /dev/sda3 /mnt/sda3
root@ttyp2[knoppix]# ls -l /mnt/sda3
合計 16
drwx------ 2 root root 16384 2003-08-06 11:06 lost+found
root@ttyp2[knoppix]#
root@ttyp2[knoppix]# mkdir -p /mnt/sda3/source/KNOPPIX
root@ttyp2[knoppix]# mkdir -p /mnt/sda3/master/KNOPPIX/KNOPPIX
root@ttyp2[knoppix]#
root@ttyp2[knoppix]# cp -Rpv /KNOPPIX/* /mnt/sda3/source/KNOPPIX
:
`/KNOPPIX/var/tmp' -> `/mnt/sda3/source/KNOPPIX/var/tmp'
`/KNOPPIX/var/www' -> `/mnt/sda3/source/KNOPPIX/var/www'
`/KNOPPIX/var/www/index.html' -> `/mnt/sda3/source/KNOPPIX/var/www/index.html'
`/KNOPPIX/var/www/search.html' -> `/mnt/sda3/source/KNOPPIX/var/www/search.html'
`/KNOPPIX/var/www/users' -> `/mnt/sda3/source/KNOPPIX/var/www/users'
`/KNOPPIX/var/www/wordtrans' -> `/mnt/sda3/source/KNOPPIX/var/www/wordtrans'
`/KNOPPIX/var/yp' -> `/mnt/sda3/source/KNOPPIX/var/yp'
`/KNOPPIX/var/yp/binding' -> `/mnt/sda3/source/KNOPPIX/var/yp/binding'
`/KNOPPIX/var/yp/Makefile' -> `/mnt/sda3/source/KNOPPIX/var/yp/Makefile'
`/KNOPPIX/var/yp/nicknames' -> `/mnt/sda3/source/KNOPPIX/var/yp/nicknames'
`/KNOPPIX/vmlinuz' -> `/mnt/sda3/source/KNOPPIX/vmlinuz'
root@ttyp2[knoppix]#
root@ttyp2[knoppix]# cp -p /cdrom/KNOPPIX/*.* /mnt/sda3/master/KNOPPIX/KNOPPIX
root@ttyp2[knoppix]#
root@ttyp2[knoppix]# cp /cdrom/*.* /mnt/sda3/master/KNOPPIX/
root@ttyp2[knoppix]#
(2-1-2). ハードディスクに展開したファイルを編集して tarファイルを追加
root@ttyp2[knoppix]# chroot /mnt/sda3/source/KNOPPIX/
root@ttyp2[/]# mount -t proc /proc proc
root@ttyp2[/]#
root@ttyp2[/]# cd /etc/dhcpc
root@ttyp2[dhcpc]# ls -l
合計 8
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root knoppix 49 2003-03-27 00:53 resolv.conf
root@ttyp2[dhcpc]#
root@ttyp2[dhcpc]# mv resolv.conf resolv.conf-org
root@ttyp2[dhcpc]# cp resolv.conf-org resolv.conf
root@ttyp2[dhcpc]# vi resolv.conf
# Insert nameservers here
# nameserver 127.0.0.1
search
nameserver 130.87.152.1
nameserver 130.87.34.2
nameserver 130.87.34.3
~
"resolv.conf" 6L, 126C 書込み
E138: viminfoファイル /home/knoppix/.viminfo を保存できません!
続けるにはENTERを押すかコマンドを入力してください
root@ttyp2[dhcpc]# cat resolv.conf
# Insert nameservers here
# nameserver 127.0.0.1
search
nameserver 130.87.152.1
nameserver 130.87.34.2
nameserver 130.87.34.3
root@ttyp2[dhcpc]#
root@ttyp2[dhcpc]# cd /usr/share
root@ttyp2[share]# du -k
:
56 ./zoneinfo/SystemV
52 ./zoneinfo/US
6712 ./zoneinfo
719712 .
root@ttyp2[share]#
root@ttyp2[share]# ls
WINGs doc knoppix sgml
WindowMaker doc-base knoppix-terminalserver sitar
XaoS dpkg language-env slrn
a2ps emacs ldap sndconfig
aclocal emacs21 lftp sodipodi
aclocal-1.7 enscript libgda sounds
adduser et libgnomeprint squid
alien ethereal libgphoto2 tabset
alsa ettercap libtool tasksel
amanda fluxbox lilo tct
anthy fonts linda templates
apache foomatic lintian terminfo
apmd ftape-tools locale tetex-base
application-registry games lyx tetex-bin
applications gettext mailx texinfo
applnk ghostscript man texmf
apps gimp man-db themes
arpwatch glib-2.0 mc tix8.1
aspell gnome menu tk8.3
audacity gnomemeeting mime-info tk8.4
aumix-gtk gnumeric mimelnk trans
autoconf gnupg mindi unidata
automake-1.7 gpa misc usbutils
autostart gpsdrive modconf util-linux
awk grace mondo vgabios
base-config groff mpage videolan
base-files gs-esp mysql videomodes
base-passwd gs-ja nmap vim
bb gtk-doc ogonkify vncserver
binfmts gtkam perl w3c-libwww
bison hwdata perl5 w3m
bochs i18n pfaedit wallpapers
bug icewm pilot-link widestudio
calendar icons pixmaps wine
cdrdao idl pnm2ppa wmakerconf
common-licenses ifupdown pnp.ids wnn
config images po-debconf wordtrans
configlets info ppp wprint
console initrd-tools prime wx
consolefonts ircII qcad xawtv
consoletrans isdn qt3 xfce
control-center isdn-config qtparted xfig
cups isdnvboxserver rdesktop xine
curl java reportbug xml
debconf jpilot rosegarden xmms
debhelper kbackup samba xpdf
defoma kdoc sane xviddetect
devscripts kernel-package screen zile
dict keymaps services zoneinfo
dlint kismet servicetypes
root@ttyp2[share]#
root@ttyp2[share]# rm -rf doc
root@ttyp2[share]# rm -rf games
root@ttyp2[share]# rm -rf texmf
root@ttyp2[share]# du -k
:
2228 ./zoneinfo/right
56 ./zoneinfo/SystemV
52 ./zoneinfo/US
6712 ./zoneinfo
440628 .
root@ttyp2[share]#
これで約280MBの空領域ができた。 compact-aug052003.tar.gzファイルを
組み込む。
root@ttyp2[/]# pwd
/
root@ttyp2[/]# ls -l
合計 104
drwxr-xr-x 2 root root 4096 2003-06-06 23:49 bin
drwxr-xr-x 2 root root 4096 2003-03-27 00:05 boot
drwxr-xr-x 2 root root 4096 2001-04-15 09:45 cdrom
drwxr-xr-x 10 root root 32768 2003-07-17 14:07 dev
drwxr-xr-x 149 root root 8192 2003-07-17 14:18 etc
drwxr-xr-x 2 root root 4096 2001-04-15 09:45 floppy
drwxrwsr-x 2 root staff 4096 2003-06-25 16:35 home
drwxr-xr-x 2 root root 4096 2001-04-15 09:45 initrd
drwxr-xr-x 7 root root 4096 2003-06-03 07:18 lib
drwx------ 2 root root 4096 2003-06-11 22:50 lost+found
drwxr-xr-x 6 root root 4096 2003-07-17 14:18 mnt
drwxr-xr-x 2 root root 4096 2003-06-11 17:16 none
drwxr-xr-x 3 root root 4096 2003-06-11 17:48 opt
dr-xr-xr-x 60 root root 0 2003-08-06 23:24 proc
drwx------ 2 root root 4096 2003-07-17 14:18 root
drwxr-xr-x 2 root root 8192 2003-06-06 23:49 sbin
lrwxrwxrwx 1 root root 8 2003-08-06 14:47 tmp -> /var/tmp
drwxr-xr-x 14 root root 4096 2003-04-07 05:15 usr
drwxr-xr-x 16 root root 4096 2003-07-17 14:18 var
lrwxrwxrwx 1 root root 23 2003-08-06 15:26 vmlinuz -> boot/vmlinuz-2.4.20-xfs
root@ttyp2[/]#
root@ttyp2[/]# mkdir TOYO
root@ttyp2[/]# mount 130.87.153.9:/home2/onlpara-wrk /mnt
root@ttyp2[/]# ls -l /mnt/root/knoppix
合計 299088
-rw-r--r-- 1 nobody nogroup 153102602 2003-08-05 14:43 compact-aug052003.tar.gz
-rw-r--r-- 1 nobody nogroup 152848889 2003-05-29 14:00 compact.tar.gz
root@ttyp2[/]# cp /mnt/root/knoppix/compact-aug052003.tar.gz TOYO
root@ttyp2[/]# ls -l TOYO
合計 149668
-rw-r--r-- 1 root root 153102602 2003-08-06 16:13 compact-aug052003.tar.gz
root@ttyp2[/]#
root@ttyp2[/]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
rootfs 9621880 1910480 7222624 21% /
/dev/root.old 9621880 1910480 7222624 21% /
none 9621880 1910480 7222624 21% /dev/pts
/dev/scd0 9621880 1910480 7222624 21% /cdrom
df: `/KNOPPIX': そのようなファイルやディレクトリはありません
df: `/ramdisk': そのようなファイルやディレクトリはありません
df: `/mnt/sda3': そのようなファイルやディレクトリはありません
130.87.153.9:/home2/onlpara-wrk
22659864 1349224 20159584 7% /mnt
root@ttyp2[/]#
root@ttyp2[/]# umount /mnt
root@ttyp2[/]#
root@ttyp2[/]# cd etc/dhcpc
root@ttyp2[dhcpc]# ls -l
合計 12
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root root 126 2003-08-06 15:49 resolv.conf
-rw-r--r-- 1 root knoppix 49 2003-03-27 00:53 resolv.conf-org
root@ttyp2[dhcpc]# rm resolv.conf
rm: remove 通常ファイル `resolv.conf'? y
root@ttyp2[dhcpc]# mv resolv.conf-org resolv.conf
root@ttyp2[dhcpc]# ls -l
合計 8
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root knoppix 49 2003-03-27 00:53 resolv.conf
root@ttyp2[dhcpc]#
root@ttyp2[dhcpc]# updatedb
root@ttyp2[dhcpc]# umount /proc
root@ttyp2[dhcpc]# exit
exit
root@ttyp2[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1659 312 85% /
/dev/cdrom 704772 704772 0 100% /cdrom
/dev/cloop 1864688 1864688 0 100% /KNOPPIX
/ramdisk 408980 5508 403472 2% /ramdisk
/dev/sda3 9621880 1910028 7223076 21% /mnt/sda3
root@ttyp2[knoppix]#
root@ttyp2[knoppix]# touch /mnt/sda3/master/KNOPPIX/KNOPPIX/ ToyoKNOPPIX-Aug6-2003
root@ttyp2[knoppix]#
(2-1-3). 圧縮ルートイメージの作成
ここで一度マシンをシャットダウンしたので、USBディスクのワークエリアを
再マウントする。
knoppix@ttyp1[knoppix]$ sudo -s
root@ttyp1[knoppix]# mount /dev/sda3 /mnt/sda3
root@ttyp1[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1659 312 85% /
/dev/cdrom 704772 704772 0 100% /cdrom
/dev/cloop 1864688 1864688 0 100% /KNOPPIX
/ramdisk 408980 5396 403584 2% /ramdisk
/dev/sda3 9621880 1910028 7223076 21% /mnt/sda3
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# mkisofs -R -l -V "Toyo KNOPPIX iso9660 filesystem" -hide-rr-moved -v /mnt/sda3/source/KNOPPIX | create_compressed_fs - 65536 > /mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX
:
:
Block# 27650 size 65536 -> 65562 [compression ratio 100%, overall: 40%]
Block# 27651 size 65536 -> 65091 [compression ratio 99%, overall: 40%]
Block# 27652 size 65536 -> 65152 [compression ratio 99%, overall: 40%]
Block# 27653 size 65536 -> 63668 [compression ratio 97%, overall: 40%]
Total translation table size: 0
Total rockridge attributes bytes: 9277826
Total directory bytes: 23695360
Path table size(bytes): 93332
Done with: The File(s) Block(s) 873214
Writing: Ending Padblock Start Block 884928
Block# 27654 size 65536 -> 84 [compression ratio 0%, overall: 40%]
Block# 27655 size 65536 -> 84 [compression ratio 0%, overall: 40%]
Block# 27656 size 65536 -> 84 [compression ratio 0%, overall: 40%]
Block# 27657 size 65536 -> 84 [compression ratio 0%, overall: 40%]
Done with: Ending Padblock Block(s) 150
Max brk space used 46ce2a4
885078 extents written (1728 Mb)
Partial read (45056 bytes of 65536), padding with zeros.
Block# 27658 size 45056 -> 84 [compression ratio 0%, overall: 40%]
Block size 65536, number of blocks 27659.
Done.
root@ttyp1[knoppix]#
私のPC環境で約2時間かかった。
(2-1-4). 独自KNOPPIX isoファイルの作成
root@ttyp1[KNOPPIX]# pwd
/mnt/sda3/master/KNOPPIX
root@ttyp1[KNOPPIX]# ls -l
合計 24
drwxr-xr-x 2 root root 4096 2003-08-07 09:13 KNOPPIX
-r-xr-xr-x 1 root root 54 2003-08-06 15:40 autorun.bat
-r--r--r-- 1 root root 45 2003-08-06 15:40 autorun.inf
-r--r--r-- 1 root root 3262 2003-08-06 15:40 cdrom.ico
-r-xr-xr-x 1 root root 3433 2003-08-06 15:40 index.html
-r--r--r-- 1 root root 1083 2003-08-06 15:40 index.html.orig.gz
root@ttyp1[KNOPPIX]#
root@ttyp1[KNOPPIX]# mkisofs -l -r -J -V "Toyo-KNOPPIX" -hide-rr-moved -v -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o ../toyo-knoppix.iso /mnt/sda3/master/KNOPPIX
mkisofs 2.01a12 (i686-pc-linux-gnu)
Scanning /mnt/sda3/master/KNOPPIX
Scanning /mnt/sda3/master/KNOPPIX/KNOPPIX
Excluded by match: /mnt/sda3/master/KNOPPIX/KNOPPIX/boot.cat
Writing: Initial Padbock Start Block 0
Done with: Initial Padbock Block(s) 16
Writing: Primary Volume Descriptor Start Block 16
Done with: Primary Volume Descriptor Block(s) 1
Writing: Eltorito Volume Descriptor Start Block 17
Size of boot image is 2880 sectors -> Emulating a 1440 kB floppy
Done with: Eltorito Volume Descriptor Block(s) 1
Writing: Joliet Volume Descriptor Start Block 18
Done with: Joliet Volume Descriptor Block(s) 1
Writing: End Volume Descriptor Start Block 19
Done with: End Volume Descriptor Block(s) 1
Writing: Version block Start Block 20
Done with: Version block Block(s) 1
Writing: Path table Start Block 21
Done with: Path table Block(s) 4
Writing: Joliet path table Start Block 25
Done with: Joliet path table Block(s) 4
Writing: Directory tree Start Block 29
Done with: Directory tree Block(s) 4
Writing: Joliet directory tree Start Block 33
Done with: Joliet directory tree Block(s) 2
Writing: Directory tree cleanup Start Block 35
Done with: Directory tree cleanup Block(s) 0
Writing: Extension record Start Block 35
Done with: Extension record Block(s) 1
Writing: The File(s) Start Block 36
1.38% done, estimate finish Thu Aug 7 11:46:50 2003
2.75% done, estimate finish Thu Aug 7 11:46:13 2003
4.12% done, estimate finish Thu Aug 7 11:59:46 2003
5.50% done, estimate finish Thu Aug 7 11:56:32 2003
6.87% done, estimate finish Thu Aug 7 11:54:50 2003
8.25% done, estimate finish Thu Aug 7 11:59:58 2003
9.62% done, estimate finish Thu Aug 7 11:58:06 2003
11.00% done, estimate finish Thu Aug 7 11:59:34 2003
12.37% done, estimate finish Thu Aug 7 12:00:03 2003
13.74% done, estimate finish Thu Aug 7 11:58:43 2003
15.12% done, estimate finish Thu Aug 7 12:01:10 2003
16.49% done, estimate finish Thu Aug 7 12:00:04 2003
17.87% done, estimate finish Thu Aug 7 11:59:15 2003
19.24% done, estimate finish Thu Aug 7 12:00:57 2003
20.61% done, estimate finish Thu Aug 7 12:00:06 2003
21.99% done, estimate finish Thu Aug 7 12:00:38 2003
23.36% done, estimate finish Thu Aug 7 12:00:49 2003
24.74% done, estimate finish Thu Aug 7 12:00:11 2003
26.11% done, estimate finish Thu Aug 7 12:01:20 2003
27.49% done, estimate finish Thu Aug 7 12:00:47 2003
28.86% done, estimate finish Thu Aug 7 12:00:14 2003
30.24% done, estimate finish Thu Aug 7 12:01:13 2003
31.61% done, estimate finish Thu Aug 7 12:00:42 2003
32.98% done, estimate finish Thu Aug 7 12:00:59 2003
34.36% done, estimate finish Thu Aug 7 12:01:06 2003
35.73% done, estimate finish Thu Aug 7 12:00:41 2003
37.10% done, estimate finish Thu Aug 7 12:01:23 2003
38.48% done, estimate finish Thu Aug 7 12:01:03 2003
39.85% done, estimate finish Thu Aug 7 12:01:01 2003
41.23% done, estimate finish Thu Aug 7 12:01:21 2003
42.60% done, estimate finish Thu Aug 7 12:01:00 2003
43.98% done, estimate finish Thu Aug 7 12:01:19 2003
45.35% done, estimate finish Thu Aug 7 12:01:17 2003
46.73% done, estimate finish Thu Aug 7 12:01:02 2003
48.10% done, estimate finish Thu Aug 7 12:01:26 2003
49.47% done, estimate finish Thu Aug 7 12:01:11 2003
50.85% done, estimate finish Thu Aug 7 12:01:12 2003
52.22% done, estimate finish Thu Aug 7 12:01:23 2003
53.59% done, estimate finish Thu Aug 7 12:01:12 2003
54.97% done, estimate finish Thu Aug 7 12:01:23 2003
56.34% done, estimate finish Thu Aug 7 12:01:22 2003
57.72% done, estimate finish Thu Aug 7 12:01:10 2003
59.09% done, estimate finish Thu Aug 7 12:01:29 2003
60.47% done, estimate finish Thu Aug 7 12:01:18 2003
61.84% done, estimate finish Thu Aug 7 12:01:17 2003
63.22% done, estimate finish Thu Aug 7 12:01:28 2003
64.59% done, estimate finish Thu Aug 7 12:01:19 2003
65.96% done, estimate finish Thu Aug 7 12:01:26 2003
67.34% done, estimate finish Thu Aug 7 12:01:25 2003
68.71% done, estimate finish Thu Aug 7 12:01:16 2003
70.08% done, estimate finish Thu Aug 7 12:01:31 2003
71.46% done, estimate finish Thu Aug 7 12:01:22 2003
72.83% done, estimate finish Thu Aug 7 12:01:26 2003
74.21% done, estimate finish Thu Aug 7 12:01:30 2003
75.58% done, estimate finish Thu Aug 7 12:01:22 2003
76.96% done, estimate finish Thu Aug 7 12:01:29 2003
78.33% done, estimate finish Thu Aug 7 12:01:27 2003
79.71% done, estimate finish Thu Aug 7 12:01:21 2003
81.08% done, estimate finish Thu Aug 7 12:01:32 2003
82.45% done, estimate finish Thu Aug 7 12:01:27 2003
83.83% done, estimate finish Thu Aug 7 12:01:28 2003
85.20% done, estimate finish Thu Aug 7 12:01:32 2003
86.58% done, estimate finish Thu Aug 7 12:01:26 2003
87.95% done, estimate finish Thu Aug 7 12:01:31 2003
89.32% done, estimate finish Thu Aug 7 12:01:29 2003
90.70% done, estimate finish Thu Aug 7 12:01:28 2003
92.07% done, estimate finish Thu Aug 7 12:01:33 2003
93.45% done, estimate finish Thu Aug 7 12:01:30 2003
94.82% done, estimate finish Thu Aug 7 12:01:31 2003
96.20% done, estimate finish Thu Aug 7 12:01:33 2003
97.57% done, estimate finish Thu Aug 7 12:01:29 2003
98.95% done, estimate finish Thu Aug 7 12:01:33 2003
Total translation table size: 2048
Total rockridge attributes bytes: 3299
Total directory bytes: 6144
Path table size(bytes): 26
Done with: The File(s) Block(s) 363663
Writing: Ending Padblock Start Block 363699
Done with: Ending Padblock Block(s) 150
Max brk space used b000
363849 extents written (710 Mb)
root@ttyp1[KNOPPIX]#
約数十分かかった。
root@ttyp1[KNOPPIX]# ls -l /mnt/sda3/master
合計 728420
drwxr-xr-x 3 root root 4096 2003-08-06 15:40 KNOPPIX
-rw-r--r-- 1 root root 745162752 2003-08-07 12:01 toyo-knoppix.iso
root@ttyp1[KNOPPIX]#
knoppix@ttyp1[master]$ scp toyo-knoppix.iso inoue@onlgw.kek.jp:/home/inoue/public_html/para-CAMAC/Work/onlsbc2
inoue@onlgw.kek.jp's password:
toyo-knoppix.iso 100% 710MB 715.4KB/s 16:57
knoppix@ttyp1[master]$
(2-1-5). 独自KNOPPIX isoファイルをCDに書き込む
700MBのCDに書き込もうとしたが入りきらないといって中断されてしまった。
isoファイルを作り直す。
mount /dev/sda3 /mntsda3
chroot /mnt/sda3/source/KNOPPIX
mount -t proc /proc proc
cd /etc/dhcpc
vi resolv.conf
:
# Insert nameservers here
# nameserver 127.0.0.1
search
nameserver 130.87.152.1
nameserver 130.87.34.2
nameserver 130.87.34.3
cd /usr/share
du -k
:
52 ./zoneinfo/US
6712 ./zoneinfo
440628 .
root@ttyp0[share]#
cd /usr/games
du -k
root@ttyp0[usr]# cd /usr/games
root@ttyp0[games]# du -k
5632 .
root@ttyp0[games]# cd ..
root@ttyp0[usr]# rm -rf games
root@ttyp0[src]# pwd
/usr/src
root@ttyp0[src]#
20392 ./linux-2.4.20-xfs/include
26820 ./linux-2.4.20-xfs
4 ./modules
26864 .
root@ttyp0[src]#
root@ttyp0[usr]# pwd
/usr
root@ttyp0[usr]# rm -rf src
root@ttyp0[usr]#
root@ttyp0[/]# dpkg -l | grep wine
ii libwine 0.0.20030508-2 Windows Emulator (Library)
ii libwine-print 0.0.20030508-2 Windows Emulator (Printing Module)
ii libwine-twain 0.0.20030508-2 Windows Emulator (Scanner Module)
ii wine 0.0.20030508-2 Windows Emulator (Binary Emulator)
ii wine-utils 0.0.20030508-2 Windows Emulator (Utilities)
ii winesetuptk 0.6.0b-1.1 Windows Emulator (Configuration and Setup To
root@ttyp0[/]#
root@ttyp0[/]# apt-get -s remove --purge libwine libwine-print libwine-twain wine wine-utils winesetuptk
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
libwine* libwine-print* libwine-twain* wine* wine-utils* winesetuptk*
0 packages upgraded, 0 newly installed, 6 to remove and 172 not upgraded.
Purg wine-utils (0.0.20030508-2 Debian:testing)
Purg wine (0.0.20030508-2 Debian:testing)
Purg libwine-twain (0.0.20030508-2 Debian:testing)
Purg libwine-print (0.0.20030508-2 Debian:testing)
Purg libwine (0.0.20030508-2 Debian:testing)
Purg winesetuptk (0.6.0b-1.1 Debian:testing)
root@ttyp0[/]#
root@ttyp0[/]# rm -rf /var/lib/wine
root@ttyp0[/]#
root@ttyp0[/]# cd /etc/dhcpc
root@ttyp0[dhcpc]# ls -l
合計 8
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root knoppix 126 2003-08-07 14:48 resolv.conf
root@ttyp0[dhcpc]# vi resolv.conf
root@ttyp0[dhcpc]# cat resolv.conf
# Insert nameservers here
# nameserver 127.0.0.1
root@ttyp0[dhcpc]#
root@ttyp0[dhcpc]# ls -l
合計 8
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root knoppix 49 2003-08-07 15:21 resolv.conf
root@ttyp0[dhcpc]#
root@ttyp0[dhcpc]# updatedb
root@ttyp0[dhcpc]# exit
exit
root@ttyp0[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1659 312 85% /
/dev/cdrom 704772 704772 0 100% /cdrom
/dev/cloop 1864688 1864688 0 100% /KNOPPIX
/ramdisk 408980 5388 403592 2% /ramdisk
/dev/sda3 9621880 3329164 5803940 37% /mnt/sda3
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# touch /mnt/sda3/master/KNOPPIX/KNOPPIX/ ToyoKNOPPIX-Aug6a-2003
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# rm /mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX
rm: remove 通常ファイル `/mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX'? y
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# mkisofs -R -l -V "Toyo KNOPPIX iso9660 filesystem" -hide-rr-moved -v /mnt/sda3/source/KNOPPIX | create_compressed_fs - 65536 > /mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX
:
Block# 35463 size 65536 -> 65562 [compression ratio 100%, overall: 45%]
Block# 35464 size 65536 -> 65093 [compression ratio 99%, overall: 45%]
Block# 35465 size 65536 -> 65147 [compression ratio 99%, overall: 45%]
Block# 35466 size 65536 -> 65527 [compression ratio 99%, overall: 45%]
Total translation table size: 0
Total rockridge attributes bytes: 8848038
Total directory bytes: 21204992
Path table size(bytes): 78492
Done with: The File(s) Block(s) 1124465
Writing: Ending Padblock Start Block 1134952
Block# 35467 size 65536 -> 14750 [compression ratio 22%, overall: 45%]
Block# 35468 size 65536 -> 84 [compression ratio 0%, overall: 45%]
Block# 35469 size 65536 -> 84 [compression ratio 0%, overall: 45%]
Block# 35470 size 65536 -> 84 [compression ratio 0%, overall: 45%]
Done with: Ending Padblock Block(s) 150
Max brk space used 42d62a4
1135102 extents written (2216 Mb)
Partial read (61440 bytes of 65536), padding with zeros.
Block# 35471 size 61440 -> 84 [compression ratio 0%, overall: 45%]
Block size 65536, number of blocks 35472.
Done.
root@ttyp0[knoppix]#
約4時間かかった。
この後、約1時間かけて mkisofsを実行して isoファイルを作ったところ1000Mb
サイズのisoファイルが作られてしまった。
/mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX/KNOPPIX ファイルと
/mnt/sda3/master/toyo-knoppix.iso ファイルを削除した後、再度、圧縮ルート
イメージ作成をやってみる。
root@ttyp1[knoppix]# mkisofs -R -l -V "Toyo KNOPPIX iso9660 filesystem" -hide-rr-moved -v /mnt/sda3/source/KNOPPIX | create_compressed_fs - 65536 > /mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX
:
:
Block# 27273 size 65536 -> 65082 [compression ratio 99%, overall: 41%]
Block# 27274 size 65536 -> 65486 [compression ratio 99%, overall: 41%]
Block# 27275 size 65536 -> 65226 [compression ratio 99%, overall: 41%]
Total translation table size: 0
Total rockridge attributes bytes: 8701897
Total directory bytes: 20817920
Path table size(bytes): 76616
Done with: The File(s) Block(s) 862561
Writing: Ending Padblock Start Block 872854
Block# 27276 size 65536 -> 43270 [compression ratio 66%, overall: 41%]
Block# 27277 size 65536 -> 84 [compression ratio 0%, overall: 41%]
Block# 27278 size 65536 -> 84 [compression ratio 0%, overall: 41%]
Block# 27279 size 65536 -> 84 [compression ratio 0%, overall: 41%]
Block# 27280 size 65536 -> 84 [compression ratio 0%, overall: 41%]
Done with: Ending Padblock Block(s) 150
Max brk space used 41e82a4
873004 extents written (1705 Mb)
Partial read (24576 bytes of 65536), padding with zeros.
Block# 27281 size 24576 -> 84 [compression ratio 0%, overall: 41%]
Block size 65536, number of blocks 27282.
Done.
root@ttyp0[KNOPPIX]#
約3時間20分かかった。
root@ttyp0[KNOPPIX]# pwd
/mnt/sda3/master/KNOPPIX
root@ttyp0[KNOPPIX]# ls -l
合計 24
drwxr-xr-x 2 root root 4096 2003-08-08 13:27 KNOPPIX
-r-xr-xr-x 1 root root 54 2003-08-06 15:40 autorun.bat
-r--r--r-- 1 root root 45 2003-08-06 15:40 autorun.inf
-r--r--r-- 1 root root 3262 2003-08-06 15:40 cdrom.ico
-r-xr-xr-x 1 root root 3433 2003-08-06 15:40 index.html
-r--r--r-- 1 root root 1083 2003-08-06 15:40 index.html.orig.gz
root@ttyp0[KNOPPIX]# mkisofs -l -r -J -V "Toyo-KNOPPIX" -hide-rr-moved -v -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o ../toyo-knoppix.iso /mnt/sda3/master/KNOPPIX
mkisofs 2.01a12 (i686-pc-linux-gnu)
Scanning /mnt/sda3/master/KNOPPIX
Scanning /mnt/sda3/master/KNOPPIX/KNOPPIX
Excluded by match: /mnt/sda3/master/KNOPPIX/KNOPPIX/boot.cat
Writing: Initial Padbock Start Block 0
Done with: Initial Padbock Block(s) 16
Writing: Primary Volume Descriptor Start Block 16
Done with: Primary Volume Descriptor Block(s) 1
Writing: Eltorito Volume Descriptor Start Block 17
Size of boot image is 2880 sectors -> Emulating a 1440 kB floppy
Done with: Eltorito Volume Descriptor Block(s) 1
Writing: Joliet Volume Descriptor Start Block 18
Done with: Joliet Volume Descriptor Block(s) 1
Writing: End Volume Descriptor Start Block 19
Done with: End Volume Descriptor Block(s) 1
Writing: Version block Start Block 20
Done with: Version block Block(s) 1
Writing: Path table Start Block 21
Done with: Path table Block(s) 4
Writing: Joliet path table Start Block 25
Done with: Joliet path table Block(s) 4
Writing: Directory tree Start Block 29
Done with: Directory tree Block(s) 4
Writing: Joliet directory tree Start Block 33
Done with: Joliet directory tree Block(s) 2
Writing: Directory tree cleanup Start Block 35
Done with: Directory tree cleanup Block(s) 0
Writing: Extension record Start Block 35
Done with: Extension record Block(s) 1
Writing: The File(s) Start Block 36
1.39% done, estimate finish Fri Aug 8 16:00:14 2003
2.77% done, estimate finish Fri Aug 8 15:59:37 2003
4.15% done, estimate finish Fri Aug 8 16:13:29 2003
5.54% done, estimate finish Fri Aug 8 16:10:10 2003
6.92% done, estimate finish Fri Aug 8 16:08:11 2003
8.31% done, estimate finish Fri Aug 8 16:13:16 2003
9.69% done, estimate finish Fri Aug 8 16:11:36 2003
11.08% done, estimate finish Fri Aug 8 16:13:29 2003
12.46% done, estimate finish Fri Aug 8 16:13:21 2003
13.85% done, estimate finish Fri Aug 8 16:12:09 2003
15.23% done, estimate finish Fri Aug 8 16:14:28 2003
16.62% done, estimate finish Fri Aug 8 16:13:23 2003
18.00% done, estimate finish Fri Aug 8 16:12:34 2003
19.39% done, estimate finish Fri Aug 8 16:14:15 2003
20.77% done, estimate finish Fri Aug 8 16:13:29 2003
22.16% done, estimate finish Fri Aug 8 16:14:14 2003
23.54% done, estimate finish Fri Aug 8 16:14:07 2003
24.92% done, estimate finish Fri Aug 8 16:13:29 2003
26.31% done, estimate finish Fri Aug 8 16:14:38 2003
27.69% done, estimate finish Fri Aug 8 16:14:05 2003
29.08% done, estimate finish Fri Aug 8 16:13:46 2003
30.46% done, estimate finish Fri Aug 8 16:14:31 2003
31.85% done, estimate finish Fri Aug 8 16:14:01 2003
33.23% done, estimate finish Fri Aug 8 16:14:29 2003
34.61% done, estimate finish Fri Aug 8 16:14:24 2003
36.00% done, estimate finish Fri Aug 8 16:14:02 2003
37.38% done, estimate finish Fri Aug 8 16:14:44 2003
38.77% done, estimate finish Fri Aug 8 16:14:21 2003
40.15% done, estimate finish Fri Aug 8 16:14:09 2003
41.54% done, estimate finish Fri Aug 8 16:14:39 2003
42.92% done, estimate finish Fri Aug 8 16:14:23 2003
44.31% done, estimate finish Fri Aug 8 16:14:37 2003
45.69% done, estimate finish Fri Aug 8 16:14:35 2003
47.08% done, estimate finish Fri Aug 8 16:14:20 2003
48.46% done, estimate finish Fri Aug 8 16:14:48 2003
49.85% done, estimate finish Fri Aug 8 16:14:31 2003
51.23% done, estimate finish Fri Aug 8 16:14:28 2003
52.62% done, estimate finish Fri Aug 8 16:14:43 2003
54.00% done, estimate finish Fri Aug 8 16:14:32 2003
55.38% done, estimate finish Fri Aug 8 16:14:41 2003
56.77% done, estimate finish Fri Aug 8 16:14:40 2003
58.15% done, estimate finish Fri Aug 8 16:14:28 2003
59.54% done, estimate finish Fri Aug 8 16:14:50 2003
60.92% done, estimate finish Fri Aug 8 16:14:40 2003
62.30% done, estimate finish Fri Aug 8 16:14:33 2003
63.69% done, estimate finish Fri Aug 8 16:14:48 2003
65.07% done, estimate finish Fri Aug 8 16:14:38 2003
66.46% done, estimate finish Fri Aug 8 16:14:44 2003
67.84% done, estimate finish Fri Aug 8 16:14:43 2003
69.23% done, estimate finish Fri Aug 8 16:14:36 2003
70.61% done, estimate finish Fri Aug 8 16:14:48 2003
72.00% done, estimate finish Fri Aug 8 16:14:43 2003
73.38% done, estimate finish Fri Aug 8 16:14:44 2003
74.77% done, estimate finish Fri Aug 8 16:14:49 2003
76.15% done, estimate finish Fri Aug 8 16:14:41 2003
77.54% done, estimate finish Fri Aug 8 16:14:48 2003
78.92% done, estimate finish Fri Aug 8 16:14:46 2003
80.31% done, estimate finish Fri Aug 8 16:14:43 2003
81.69% done, estimate finish Fri Aug 8 16:14:52 2003
83.07% done, estimate finish Fri Aug 8 16:14:46 2003
84.46% done, estimate finish Fri Aug 8 16:14:46 2003
85.84% done, estimate finish Fri Aug 8 16:14:51 2003
87.23% done, estimate finish Fri Aug 8 16:14:45 2003
88.61% done, estimate finish Fri Aug 8 16:14:49 2003
90.00% done, estimate finish Fri Aug 8 16:14:48 2003
91.38% done, estimate finish Fri Aug 8 16:14:46 2003
92.76% done, estimate finish Fri Aug 8 16:14:51 2003
94.15% done, estimate finish Fri Aug 8 16:14:48 2003
95.53% done, estimate finish Fri Aug 8 16:14:49 2003
96.92% done, estimate finish Fri Aug 8 16:14:52 2003
98.30% done, estimate finish Fri Aug 8 16:14:50 2003
99.69% done, estimate finish Fri Aug 8 16:14:53 2003
Total translation table size: 2048
Total rockridge attributes bytes: 3392
Total directory bytes: 6144
Path table size(bytes): 26
Done with: The File(s) Block(s) 360947
Writing: Ending Padblock Start Block 360983
Done with: Ending Padblock Block(s) 150
Max brk space used c000
361133 extents written (705 Mb)
root@ttyp0[KNOPPIX]#
Easy CD Creator で書き込もうとしたが、入り切らないといって中断された。
再度パッケージを削除する。
root@ttyp1[knoppix]# mount /dev/sda3 /mnt/sda3
root@ttyp1[/]# dpkg -l | grep office
ii openoffice-ja- 0.2-1 OpenOffice support for Japanese.
ii openoffice.org 1.0.1-0.1 OpenOffice.org 1.0.1 office suite help (Japa
ii ttf-openoffice 1.0-2 OpenOffice TrueType Fonts
root@ttyp1[/]#
OpenOffice のパッケージを削除した。 この後 isoファイルを作り直したとこ
ろ、620MBくらいで作ることができた。
---xxxx
(3). KNOPPIXシステムからの復旧
---xxxx
(2-2). KNOPPIXシステムの再構築(その2)
(2-1-1). CD上にインストールされたKNOPPIXをハードディスク上に展開
(2-1-1A). ハードディスク上に作業領域を確保
root@ttyp1[knoppix]# fdisk /dev/sda
このディスクのシリンダ数は 3648 に設定されています。
間違いではないのですが、1024 を超えているため、以下の場合
に問題を生じうる事を確認しましょう:
1) ブート時に実行するソフトウェア (例. バージョンが古い LILO)
2) 別の OS のブートやパーティション作成ソフ
(例. DOS FDISK, OS/2 FDISK)
コマンド (m でヘルプ): p
Disk /dev/sda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sda1 1 638 5124703+ b Win95 FAT32
/dev/sda2 639 1913 10241437+ f Win95 拡張領域 (LBA)
/dev/sda3 1914 3130 9775552+ 83 Linux
/dev/sda4 3131 3648 4160835 82 Linux スワップ
/dev/sda5 639 1913 10241406 b Win95 FAT32
コマンド (m でヘルプ): q
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# mke2fs /dev/sda3
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1224000 inodes, 2443888 blocks
122194 blocks (5.00%) reserved for the super user
First data block=0
75 block groups
32768 blocks per group, 32768 fragments per group
16320 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# mkswap /dev/sda4
Setting up swapspace version 1, size = 4260687 kB
root@ttyp1[knoppix]#
注.
ここでswapoff, swaponを実行するかシステムをリブートしないと
スワップ領域が切り替わらない
(2-1-1B). CD-ROM上のファイルをハードディスク上に展開
root@ttyp1[knoppix]# mount /dev/sda3 /mnt/sda3
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# mkdir -p /mnt/sda3/source/KNOPPIX
root@ttyp1[knoppix]# mkdir -p /mnt/sda3/master/KNOPPIX/KNOPPIX
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# cp -Rpv /KNOPPIX/* /mnt/sda3/source/KNOPPIX
:
`/KNOPPIX/var/tmp' -> `/mnt/sda3/source/KNOPPIX/var/tmp'
`/KNOPPIX/var/www' -> `/mnt/sda3/source/KNOPPIX/var/www'
`/KNOPPIX/var/www/index.html' -> `/mnt/sda3/source/KNOPPIX/var/www/index.html'
`/KNOPPIX/var/www/search.html' -> `/mnt/sda3/source/KNOPPIX/var/www/search.html'
`/KNOPPIX/var/www/users' -> `/mnt/sda3/source/KNOPPIX/var/www/users'
`/KNOPPIX/var/www/wordtrans' -> `/mnt/sda3/source/KNOPPIX/var/www/wordtrans'
`/KNOPPIX/var/yp' -> `/mnt/sda3/source/KNOPPIX/var/yp'
`/KNOPPIX/var/yp/binding' -> `/mnt/sda3/source/KNOPPIX/var/yp/binding'
`/KNOPPIX/var/yp/Makefile' -> `/mnt/sda3/source/KNOPPIX/var/yp/Makefile'
`/KNOPPIX/var/yp/nicknames' -> `/mnt/sda3/source/KNOPPIX/var/yp/nicknames'
`/KNOPPIX/vmlinuz' -> `/mnt/sda3/source/KNOPPIX/vmlinuz'
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# cp -p /cdrom/KNOPPIX/*.* /mnt/sda3/master/KNOPPIX/KNOPPIX
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# cp /cdrom/*.* /mnt/sda3/master/KNOPPIX/
root@ttyp1[knoppix]#
(2-1-1C). ハードディスク上に展開したファイルを追加/削除
root@ttyp1[knoppix]# chroot /mnt/sda3/source/KNOPPIX/
root@ttyp1[/]# root@ttyp1[/]# mount -t proc /proc proc
root@ttyp1[/]#
root@ttyp1[dhcpc]# pwd
/etc/dhcpc
root@ttyp1[dhcpc]# ls -l
合計 8
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root knoppix 49 2003-03-27 00:53 resolv.conf
root@ttyp1[dhcpc]# mv resolv.conf resolv.conf-org
root@ttyp1[dhcpc]# cp resolv.conf-org resolv.conf
root@ttyp1[dhcpc]# vi resolv.conf
# Insert nameservers here
# nameserver 127.0.0.1
search
nameserver 130.87.152.1
nameserver 130.87.34.2
nameserver 130.87.34.3
~
~
E138: Can't write viminfo file /home/knoppix/.viminfo!
Hit ENTER or type command to continue
root@ttyp1[dhcpc]#
root@ttyp1[dhcpc]# cat resolv.conf
# Insert nameservers here
# nameserver 127.0.0.1
search
nameserver 130.87.152.1
nameserver 130.87.34.2
nameserver 130.87.34.3
root@ttyp1[dhcpc]#
root@ttyp1[share]# pwd
/usr/share
root@ttyp1[share]# du -k
:
56 ./zoneinfo/SystemV
52 ./zoneinfo/US
6712 ./zoneinfo
675776 .
root@ttyp1[share]# ls
WINGs doc-base java rtf2latex
WindowMaker dpkg jpilot samba
XaoS emacs kbackup sane
a2ps emacs21 kdoc screen
aclocal enscript kernel-package services
aclocal-1.7 et keymaps servicetypes
alien etable kismet sgml-base
alsa ethereal knoppix sitar
amanda ettercap knoppix-terminalserver slrn
apache evolution language-env sndconfig
apmd fluxbox lftp sodipodi
applets fonts libgphoto2 sounds
application-registry foomatic libical-evolution squid
applnk ftape-tools libtool tabset
apps gal linda tasksel
arpwatch games lintian tct
aumix-gtk gettext locale templates
autoconf ghostscript lyx terminfo
automake-1.7 gimp mailx texinfo
autostart glib-2.0 man texmf
awk gnibbles man-db themes
base-config gnobots2 mc tipptrainer
base-files gnome menu tix4.1
base-passwd gnome-pilot mime-info tk8.3
bb gnome-print mimelnk trans
binfmts gnumeric mindi type-convert
bison gnupg misc unidata
bochs gpa modconf usbutils
bonobo gpsdrive mondo util-linux
bonobo-conf grace mpage vgabios
bug groff mysql videolan
calendar gs-esp nmap videomodes
cdrdao gtk-doc oaf vim
common-licenses gtkam ogonkify vncserver
config gtkhtml-1.1 omf wallpapers
configlets guppi perl wine
console hwdata perl5 wmakerconf
consolefonts i18n pilot-link wnn
consoletrans icewm pixmaps wordtrans
control-center icons pnm2ppa wprint
cups idl pnp.ids wx
curl ifupdown po-debconf xfce
debconf images ppp xfig
debhelper info psi xine
defoma initrd-tools pspell xmms
devscripts ircII qcad xpdf
dict isdn qt3 xviddetect
dlint isdn-config rdesktop zile
doc isdnvboxserver rosegarden zoneinfo
root@ttyp1[share]#
root@ttyp1[share]# pwd
/usr/share
root@ttyp1[share]# rm -rf doc
root@ttyp1[share]# rm -rf games
root@ttyp1[share]# rm -rf texmf
root@ttyp1[share]# du -k
2228 ./zoneinfo/right
56 ./zoneinfo/SystemV
52 ./zoneinfo/US
6712 ./zoneinfo
415324 .
root@ttyp1[share]#
これで260MBの空領域ができた。 compact.tar.gzファイルを組み込む。
root@ttyp1[/]# pwd
/
root@ttyp1[/]# ls -l
合計 104
drwxr-xr-x 2 root root 4096 2003-03-23 01:55 bin
drwxr-xr-x 2 root root 4096 2003-03-27 00:55 boot
drwxr-xr-x 2 root root 4096 2003-03-31 13:50 cdrom
drwxr-xr-x 10 root root 32768 2003-04-07 10:27 dev
drwxr-xr-x 143 root root 8192 2003-04-07 10:55 etc
drwxr-xr-x 2 root root 4096 2001-04-15 09:45 floppy
drwxrwsr-x 2 root staff 4096 2003-03-28 15:19 home
drwxr-xr-x 2 root root 4096 2001-04-15 09:45 initrd
drwxr-xr-x 7 root root 4096 2003-03-23 01:56 lib
drwx------ 2 root root 4096 2003-03-27 00:24 lost+found
drwxr-xr-x 5 root root 4096 2003-04-07 10:55 mnt
drwxr-xr-x 2 root root 4096 2002-11-27 10:05 none
drwxr-xr-x 3 root root 4096 2003-04-03 16:43 opt
dr-xr-xr-x 58 root root 0 2003-05-30 19:45 proc
drwxr-xr-x 2 root root 4096 2003-03-25 08:51 root
drwxr-xr-x 2 root root 8192 2003-03-25 07:44 sbin
lrwxrwxrwx 1 root root 8 2003-05-30 11:16 tmp -> /var/tmp
drwxr-xr-x 14 root root 4096 2002-08-17 20:49 usr
drwxr-xr-x 16 root root 4096 2003-04-07 10:55 var
lrwxrwxrwx 1 root root 23 2003-05-30 11:54 vmlinuz -> boot/vmlinuz-2.4.20-xfs
root@ttyp1[/]# mkdir TOYO
root@ttyp1[/]#
root@ttyp1[/]# mount 130.87.153.9:/home2/onlpara-wrk /mnt
root@ttyp1[/]# ls -l /mnt/root/knoppix
合計 149420
-rw-r--r-- 1 nobody nogroup 152848889 2003-05-29 14:00 compact.tar.gz
root@ttyp1[/]# ls -l TOYO
合計 0
root@ttyp1[/]# cp /mnt/root/knoppix/compact.tar.gz TOYO
root@ttyp1[/]# ls -l TOYO
合計 149420
-rw-r--r-- 1 root root 152848889 2003-05-30 14:03 compact.tar.gz
root@ttyp1[/]#
root@ttyp1[/]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
rootfs 9621880 1841196 7291908 21% /
/dev/root.old 9621880 1841196 7291908 21% /
none 9621880 1841196 7291908 21% /dev/pts
/dev/scd0 9621880 1841196 7291908 21% /cdrom
df: `/KNOPPIX': そのようなファイルやディレクトリはありません
df: `/ramdisk': そのようなファイルやディレクトリはありません
df: `/mnt/sda3': そのようなファイルやディレクトリはありません
130.87.153.9:/home2/onlpara-wrk
22659864 1159192 20349616 6% /mnt
root@ttyp1[/]# umount /mnt
root@ttyp1[/]#
root@ttyp1[/]# cd etc/dhcpc
root@ttyp1[dhcpc]# ls -l
合計 12
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root root 126 2003-05-30 13:18 resolv.conf
-rw-r--r-- 1 root knoppix 49 2003-03-27 00:53 resolv.conf-org
root@ttyp1[dhcpc]# rm resolv.conf
rm: remove 通常ファイル `resolv.conf'? y
root@ttyp1[dhcpc]# mv resolv.conf-org resolv.conf
root@ttyp1[dhcpc]# ls -l
合計 8
-rw-r--r-- 1 root root 343 2001-06-05 13:41 config
-rw-r--r-- 1 root knoppix 49 2003-03-27 00:53 resolv.conf
root@ttyp1[dhcpc]#
root@ttyp1[dhcpc]# updatedb
root@ttyp1[dhcpc]# umount /proc
root@ttyp1[dhcpc]# exit
exit
root@ttyp1[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1454 517 74% /
/dev/cdrom 717056 717056 0 100% /cdrom
/dev/cloop 1783328 1783328 0 100% /KNOPPIX
/dev/shm 408924 11312 397612 3% /ramdisk
/dev/sda3 9621880 1840740 7292364 21% /mnt/sda3
root@ttyp1[knoppix]#
root@ttyp1[knoppix]# touch /mnt/sda3/master/KNOPPIX/KNOPPIX/ MyKNOPPIX-May30-2003
root@ttyp1[knoppix]#
(2-1-1D). 圧縮ルートイメージの作成
root@ttyp1[knoppix]# mkisofs -R -l -V "My KNOPPIX iso9660 filesystem" -hide-rr-moved -v /mnt/sda3/source/KNOPPIX | create_compressed_fs - 65536 > /mnt/sda3/master/KNOPPIX/KNOPPIX/KNOPPIX
:
Block# 26642 size 65536 -> 65562 [compression ratio 100%, overall: 41%]
Block# 26643 size 65536 -> 64750 [compression ratio 98%, overall: 41%]
Block# 26644 size 65536 -> 65562 [compression ratio 100%, overall: 41%]
Block# 26645 size 65536 -> 65169 [compression ratio 99%, overall: 41%]
Total translation table size: 0
Total rockridge attributes bytes: 8970012
Total directory bytes: 22941696
Path table size(bytes): 91016
Done with: The File(s) Block(s) 841349
Writing: Ending pad block Start Block 852700
Block# 26646 size 65536 -> 55851 [compression ratio 85%, overall: 41%]
Done with: Ending pad block Block(s) 20
Max brk space used 329f904
852720 extents written (1665 Mb)
Partial read (32768 bytes of 65536), padding with zeros.
Block# 26647 size 32768 -> 84 [compression ratio 0%, overall: 41%]
Block size 65536, number of blocks 26648.
Done.
root@ttyp1[knoppix]#
(2-1-1E). 独自 KNOPPIX iso ファイルの作成
(ここで作業を中断してKNOPPIXをリブートしたので再マウントしている)
root@ttyp0[knoppix]# fdisk /dev/sda
このディスクのシリンダ数は 3648 に設定されています。
間違いではないのですが、1024 を超えているため、以下の場合
に問題を生じうる事を確認しましょう:
1) ブート時に実行するソフトウェア (例. バージョンが古い LILO)
2) 別の OS のブートやパーティション作成ソフト
(例. DOS FDISK, OS/2 FDISK)
コマンド (m でヘルプ): p
Disk /dev/sda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sda1 1 638 5124703+ b Win95 FAT32
/dev/sda2 639 1913 10241437+ f Win95 拡張領域 (LBA)
/dev/sda3 1914 3130 9775552+ 83 Linux
/dev/sda4 3131 3648 4160835 82 Linux スワップ
/dev/sda5 639 1913 10241406 b Win95 FAT32
コマンド (m でヘルプ): q
root@ttyp0[knoppix]#
root@ttyp0[knoppix]# mkdir /mnt1
root@ttyp0[knoppix]# mkdir /mnt2
root@ttyp0[knoppix]# mount /dev/sda1 /mnt2
root@ttyp0[knoppix]# mount /dev/sda3 /mnt1
root@ttyp0[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/root 1971 1453 518 74% /
/dev/cdrom 717056 717056 0 100% /cdrom
/dev/cloop 1783328 1783328 0 100% /KNOPPIX
/dev/shm 408924 11216 397708 3% /ramdisk
/dev/sda1 5114692 8 5114684 1% /mnt2
/dev/sda3 9621880 2542880 6590224 28% /mnt1
root@ttyp0[knoppix]#
root@ttyp0[KNOPPIX]# pwd
/mnt1/master/KNOPPIX
root@ttyp0[KNOPPIX]#
root@ttyp0[KNOPPIX]# ls -l
合計 28
drwxr-xr-x 2 root root 4096 2003-05-30 15:35 KNOPPIX
-r-xr-xr-x 1 root root 54 2003-05-30 13:09 autorun.bat
-r--r--r-- 1 root root 45 2003-05-30 13:09 autorun.inf
-r--r--r-- 1 root root 3262 2003-05-30 13:09 cdrom.ico
-r-xr-xr-x 1 root root 3433 2003-05-30 13:09 index.html
-r--r--r-- 1 root root 1083 2003-05-30 13:09 index.html.orig.gz
-r--r--r-- 1 root root 2021 2003-05-30 13:09 music.html
root@ttyp0[KNOPPIX]#
root@ttyp0[KNOPPIX]# mkisofs -l -r -J -V "My-KNOPPIX" -hide-rr-moved -v -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o ../my-knoppix.iso /mnt1/master/KNOPPIX
mkisofs 2.0 (i686-pc-linux-gnu)
Scanning /mnt1/master/KNOPPIX
Scanning /mnt1/master/KNOPPIX/KNOPPIX
Writing: Initial Padbock Start Block 0
Done with: Initial Padbock Block(s) 16
Writing: Primary Volume Descriptor Start Block 16
Done with: Primary Volume Descriptor Block(s) 1
Writing: Eltorito Volume Descriptor Start Block 17
Size of boot image is 2880 sectors -> Emulating a 1440 kB floppy
Done with: Eltorito Volume Descriptor Block(s) 1
Writing: Joliet Volume Descriptor Start Block 18
Done with: Joliet Volume Descriptor Block(s) 1
Writing: End Volume Descriptor Start Block 19
Done with: End Volume Descriptor Block(s) 1
Writing: Version block Start Block 20
Done with: Version block Block(s) 1
Writing: Path table Start Block 21
Done with: Path table Block(s) 4
Writing: Joliet path table Start Block 25
Done with: Joliet path table Block(s) 4
Writing: Directory tree Start Block 29
Done with: Directory tree Block(s) 4
Writing: Joliet directory tree Start Block 33
Done with: Joliet directory tree Block(s) 2
Writing: Directory tree cleanup Start Block 35
Done with: Directory tree cleanup Block(s) 0
Writing: Extension record Start Block 35
Done with: Extension record Block(s) 1
Writing: The File(s) Start Block 36
1.41% done, estimate finish Sat May 31 16:38:44 2003
2.83% done, estimate finish Sat May 31 16:38:08 2003
4.24% done, estimate finish Sat May 31 16:51:43 2003
5.65% done, estimate finish Sat May 31 16:48:10 2003
7.07% done, estimate finish Sat May 31 16:46:45 2003
8.48% done, estimate finish Sat May 31 16:51:30 2003
9.89% done, estimate finish Sat May 31 16:49:52 2003
11.31% done, estimate finish Sat May 31 16:51:51 2003
12.72% done, estimate finish Sat May 31 16:51:35 2003
14.13% done, estimate finish Sat May 31 16:50:25 2003
15.54% done, estimate finish Sat May 31 16:52:41 2003
16.96% done, estimate finish Sat May 31 16:51:37 2003
18.37% done, estimate finish Sat May 31 16:50:48 2003
19.78% done, estimate finish Sat May 31 16:52:28 2003
21.19% done, estimate finish Sat May 31 16:51:43 2003
22.61% done, estimate finish Sat May 31 16:52:36 2003
24.02% done, estimate finish Sat May 31 16:52:20 2003
25.44% done, estimate finish Sat May 31 16:51:43 2003
26.85% done, estimate finish Sat May 31 16:52:54 2003
28.26% done, estimate finish Sat May 31 16:52:15 2003
29.67% done, estimate finish Sat May 31 16:52:03 2003
31.09% done, estimate finish Sat May 31 16:52:44 2003
32.50% done, estimate finish Sat May 31 16:52:17 2003
33.91% done, estimate finish Sat May 31 16:52:48 2003
35.32% done, estimate finish Sat May 31 16:52:39 2003
36.74% done, estimate finish Sat May 31 16:52:15 2003
38.15% done, estimate finish Sat May 31 16:52:59 2003
39.57% done, estimate finish Sat May 31 16:52:33 2003
40.98% done, estimate finish Sat May 31 16:52:46 2003
42.39% done, estimate finish Sat May 31 16:53:03 2003
43.80% done, estimate finish Sat May 31 16:53:28 2003
45.22% done, estimate finish Sat May 31 16:53:22 2003
46.63% done, estimate finish Sat May 31 16:53:02 2003
48.04% done, estimate finish Sat May 31 16:53:33 2003
49.45% done, estimate finish Sat May 31 16:53:16 2003
50.87% done, estimate finish Sat May 31 16:53:13 2003
52.28% done, estimate finish Sat May 31 16:53:28 2003
53.69% done, estimate finish Sat May 31 16:53:10 2003
55.11% done, estimate finish Sat May 31 16:53:26 2003
56.52% done, estimate finish Sat May 31 16:53:22 2003
57.93% done, estimate finish Sat May 31 16:53:09 2003
59.35% done, estimate finish Sat May 31 16:53:27 2003
60.76% done, estimate finish Sat May 31 16:53:17 2003
62.17% done, estimate finish Sat May 31 16:53:14 2003
63.58% done, estimate finish Sat May 31 16:53:25 2003
65.00% done, estimate finish Sat May 31 16:53:14 2003
66.41% done, estimate finish Sat May 31 16:53:24 2003
67.82% done, estimate finish Sat May 31 16:53:20 2003
69.23% done, estimate finish Sat May 31 16:53:12 2003
70.65% done, estimate finish Sat May 31 16:53:25 2003
72.06% done, estimate finish Sat May 31 16:53:19 2003
73.48% done, estimate finish Sat May 31 16:53:19 2003
74.89% done, estimate finish Sat May 31 16:53:23 2003
76.30% done, estimate finish Sat May 31 16:53:15 2003
77.71% done, estimate finish Sat May 31 16:53:22 2003
79.13% done, estimate finish Sat May 31 16:53:19 2003
80.54% done, estimate finish Sat May 31 16:53:17 2003
81.95% done, estimate finish Sat May 31 16:53:25 2003
83.36% done, estimate finish Sat May 31 16:53:18 2003
84.78% done, estimate finish Sat May 31 16:53:18 2003
86.19% done, estimate finish Sat May 31 16:53:23 2003
87.61% done, estimate finish Sat May 31 16:53:16 2003
89.02% done, estimate finish Sat May 31 16:53:24 2003
90.43% done, estimate finish Sat May 31 16:53:21 2003
91.84% done, estimate finish Sat May 31 16:53:18 2003
93.26% done, estimate finish Sat May 31 16:53:24 2003
94.67% done, estimate finish Sat May 31 16:53:19 2003
96.08% done, estimate finish Sat May 31 16:53:22 2003
97.49% done, estimate finish Sat May 31 16:53:21 2003
98.91% done, estimate finish Sat May 31 16:53:19 2003
Total translation table size: 2048
Total rockridge attributes bytes: 3374
Total directory bytes: 6144
Path table size(bytes): 26
Done with: The File(s) Block(s) 353810
Writing: Ending pad block Start Block 353846
Done with: Ending pad block Block(s) 26
Max brk space used 9000
353872 extents written (691 Mb)
root@ttyp0[KNOPPIX]#
root@ttyp0[master]# pwd
/mnt1/master
root@ttyp0[master]# ls -l
合計 708444
drwxr-xr-x 3 root root 4096 2003-05-30 13:09 KNOPPIX
-rw-r--r-- 1 root root 724729856 2003-05-31 16:53 my-knoppix.iso
root@ttyp0[master]#
(2-1-1E). 独自 KNOPPIX iso ファイルの作成
作成したisoファイルは my-knoppix.iso と名付けた。 Windows XPの "Easy CD
Creator" を使ってCDを焼いた。
(2-2-2). my-knoppix.isoで作成したKNOPPIXの実行
CDから起動して、"BOOT:" のプロンプトが表示された時のキー入力は正常。
KNOPPIXが立ち上がってからも何も問題はない。
(2-2-3). KNOPPIXのCDに組み込んだ compact.tar.gzからの復旧
(2-2-2A). コンパクトフラッシュの準備
root@ttyp2[my-knoppix-iso]# /sbin/fdisk /dev/sda
コマンド (m でヘルプ): m
コマンドの動作
a ブート可能フラグをつける
b bsd ディスクラベルを編集する
c dos 互換フラグをつける
d 領域を削除する
l 既知の領域タイプをリスト表示する
m このメニューを表示する
n 新たに領域を作成する
o 新たに空の DOS 領域テーブルを作成する
p 領域テーブルを表示する
q 変更を保存せずに終了する
s 空の Sun ディスクラベルを作成する
t 領域のシステム ID を変更する
u 表示/項目ユニットを変更する
v 領域テーブルを照合する
w テーブルをディスクに書き込み、終了する
x 特別な機能 (エキスパート専用)
コマンド (m でヘルプ): p
Disk /dev/sda: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = シリンダ数 of 1008 * 512 = 516096 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sda1 1 993 500440+ 83 Linux
コマンド (m でヘルプ): d
Selected partition 1
コマンド (m でヘルプ): n
コマンドアクション
e 拡張
p 基本領域 (1-4)
p
領域番号 (1-4): 1
最初 シリンダ (1-993, 初期値 1):
初期値 1 を使います
終点 シリンダ または +サイズ または +サイズM または +サイズK (1-993, 初期値 993):
初期値 993 を使います
コマンド (m でヘルプ): p
Disk /dev/sda: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = シリンダ数 of 1008 * 512 = 516096 bytes
デバイス ブート 始点 終点 ブロック ID システム
/dev/sda1 1 993 500440+ 83 Linux
コマンド (m でヘルプ): w
領域テーブルは交換されました!
ioctl() を呼び出して領域テーブルを再読込みしま
ディスクを同期させま
root@ttyp2[my-knoppix-iso]#
root@ttyp2[my-knoppix-iso]# mke2fs -j /dev/sda1
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
125488 inodes, 500440 blocks
25022 blocks (5.00%) reserved for the super user
First data block=1
62 block groups
8192 blocks per group, 8192 fragments per group
2024 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@ttyp2[my-knoppix-iso]#
root@ttyp2[my-knoppix-iso]# mount -t ext3 /dev/sda1 /mnt/sda1
root@ttyp2[my-knoppix-iso]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1456 515 74% /
/dev/cdrom 707744 707744 0 100% /cdrom
/dev/cloop 1705440 1705440 0 100% /KNOPPIX
/dev/shm 408932 8604 400328 3% /ramdisk
/dev/hda2 39029916 13266544 25763372 34% /mnt/hda2
/dev/sdb3 9621880 5385860 3747244 59% /mnt/sdb3
/dev/sda1 484602 8239 451341 2% /mnt/sda1
root@ttyp2[my-knoppix-iso]#
(2-2-2B). compact.tar.gzを展開
root@ttyp2[my-knoppix-iso]# cd /mnt/sda1
root@ttyp2[sda1]# pwd
/mnt/sda1
root@ttyp2[sda1]# ls -l
合計 12
drwx------ 2 root root 12288 2003-06-05 16:10 lost+found
root@ttyp2[sda1]# ls -l /KNOPPIX/TOYO
合計 149267
-rw-r--r-- 1 root root 152848889 2003-05-30 14:03 compact.tar.gz
root@ttyp2[sda1]# tar xzf /KNOPPIX/TOYO/compact.tar.gz
root@ttyp2[sda1]#
root@ttyp2[sda1]# pwd
/mnt/sda1
root@ttyp2[sda1]# ls -l
合計 135
drwxr-xr-x 2 root root 2048 2003-05-14 22:49 bin
drwxr-xr-x 3 root root 1024 2003-05-22 10:51 boot
drwxr-xr-x 20 root root 116736 2003-05-29 08:23 dev
drwxr-xr-x 25 root root 2048 2003-05-29 08:23 etc
drwxr-xr-x 5 root root 1024 2003-05-14 22:59 home
drwxr-xr-x 2 root root 1024 2001-06-22 03:32 initrd
drwxr-xr-x 5 root root 3072 2003-05-14 22:50 lib
drwx------ 2 root root 1024 2003-05-14 22:35 lost+found
drwxr-xr-x 3 root root 1024 2003-05-14 14:07 mnt
drwxr-xr-x 2 root root 1024 1999-08-24 01:03 opt
drwxr-xr-x 2 root root 1024 2003-05-14 22:35 proc
drwxr-xr-x 4 root root 1024 2003-05-14 14:19 ramfs
drwxr-x--- 3 root root 1024 2003-05-22 10:33 root
drwxr-xr-x 2 root root 3072 2003-05-14 22:49 sbin
lrwxrwxrwx 1 root root 9 2003-06-05 16:17 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 2003-05-19 14:59 usr
lrwxrwxrwx 1 root root 9 2003-06-05 16:17 var -> ramfs/var
root@ttyp2[sda1]#
root@ttyp2[sbin]# e2label /dev/sda1
root@ttyp2[sbin]# e2label /dev/sda1 /
root@ttyp2[sbin]# e2label /dev/sda1
/
root@ttyp2[sbin]#
root@ttyp2[sda1]# cd sbin
root@ttyp2[sbin]# ls -l grub
-rwxr-xr-x 1 root root 248416 2002-09-06 05:59 grub
root@ttyp2[sbin]# ./grub
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.92 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 22 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+22 p (hd1,0)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.
grub> quit
root@ttyp2[sbin]#
注.
"root (hd1,0)" および "setup (hd1)" のコマンドで指定するハードディス
クの番号は、ユーザの使用環境によって変わる。 私の環境では、
内蔵IDEハードディスク : /dev/hda hd0
USB-コンパクトフラッシュR/Wアダプタ : /dev/sda hd1
外部USBディスク : /dev/sdb hd2
となっている。
(2-2-2C). 作成したコンパクトフラッシュを起動
onlsun1[35]% ssh onlsbc1
inoue@onlsbc1's password:
[inoue@onlsbc1 inoue]$ ls -l /
合計 134
drwxr-xr-x 2 root root 2048 5月 14 22:49 bin
drwxr-xr-x 3 root root 1024 5月 22 10:51 boot
drwxr-xr-x 20 root root 116736 6月 5 17:09 dev
drwxr-xr-x 25 root root 2048 6月 5 17:08 etc
drwxr-xr-x 5 root root 1024 5月 14 22:59 home
drwxr-xr-x 2 root root 1024 6月 22 2001 initrd
drwxr-xr-x 5 root root 3072 5月 14 22:50 lib
drwx------ 2 root root 1024 5月 14 22:35 lost+found
drwxr-xr-x 3 root root 1024 5月 14 14:07 mnt
drwxr-xr-x 2 root root 1024 8月 24 1999 opt
dr-xr-xr-x 36 root root 0 6月 6 2003 proc
drwxr-xr-x 5 root root 1024 6月 5 17:08 ramfs
drwxr-x--- 3 root root 1024 5月 22 10:33 root
drwxr-xr-x 2 root root 3072 5月 14 22:49 sbin
lrwxrwxrwx 1 root root 9 6月 5 16:17 tmp -> ramfs/tmp
drwxr-xr-x 16 root root 1024 5月 19 14:59 usr
lrwxrwxrwx 1 root root 9 6月 5 16:17 var -> ramfs/var
[inoue@onlsbc1 inoue]$
ok. システムは正常に立ち上がった。
これで、KNOPPIXのCD-ROMに組み込んだ compact.tar.gzファイルから、コンパク
トフラッシュへシステムを復旧する環境ができた。
---xxxxx