Oct 17, 2003
onlsbc1, コンパクトフラッシュ上のLinuxシステム復旧
--- インストール #13
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(http://www-online.kek.jp/~inoue/para-CAMAC/
Work/SBC-Linux17.html)
高エネルギー加速器研究機構
素粒子原子核研究所
物理、オンライングループ
井上 栄二
目的
Oct 16, 2003作成の、Debian Linux の tarファイルからコンパクト
フラッシュ上にシステムを構築する。
(1). tarファイルをダウンロード
(2). コンパクトフラッシュ上に Linux システムを構築
--------------------------------------------------------------------
(1). tarファイルをダウンロード
onlgw 上の tarファイルを、KNOPPIXシステムを起動しているシステム上の
ディスクにダウンロードする。
(1-1). USBハードディスクのマウント
knoppix@ttyp0[knoppix]$ su
root@ttyp0[knoppix]# mkdir /mnt1
root@ttyp0[knoppix]# chmod go+w /mnt1
root@ttyp0[knoppix]# mount /dev/sda1 /mnt1
root@ttyp0[knoppix]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1662 309 85% /
/dev/cdrom 635994 635994 0 100% /cdrom
/dev/cloop 1528028 1528028 0 100% /KNOPPIX
/ramdisk 409008 6084 402924 2% /ramdisk
/dev/sda1 5044156 4328148 459776 91% /mnt1
root@ttyp0[knoppix]# ls -l /mnt1
合計 80
-rwx--x--x 1 root root 1488 2003-06-03 09:02 1simple.custom.knx-cdcust.sh
-rwx--x--x 1 root root 1378 2003-06-03 09:02 3mini.custom.knx-cdcust.sh
-rwx--x--x 1 root root 877 2003-06-03 09:01 4opera.custom.knx-cdcust.sh
-rwx--x--x 1 root root 228 2003-06-03 09:01 auto.knx-cdcust.sh
-rwx--x--x 1 root root 23550 2003-06-03 09:01 custom.knx-cdcust.sh
drwxr-xr-x 4 root root 4096 2003-06-03 08:37 knx-cdcust
-rwxr--r-- 1 root root 18496 2003-06-02 17:25 knx-cdcust.sh
drwx------ 2 root root 16384 2003-06-02 17:22 lost+found
root@ttyp0[knoppix]#
(1-2). compact-debian-oct162003.tar.gzファイルのダウンロード
KNOPPIXシステムの Webブラウザ、Konqueror を使って onlgw 上のファイル
compact-debian-oct162003.tar.gz をダウンロードする。
root@ttyp0[mnt1]# ls -l com*
-rw-r--r-- 1 knoppix knoppix 143602724 2003-10-17 09:48 compact-debian-oct162003.tar.gz
root@ttyp0[mnt1]#
(2). コンパクトフラッシュ上に Linux システムを構築
onlgw からダウンロードした tarファイルから、コンパクトフラッシュ上に
Linux システムを復旧する。
(2-1). コンパクトフラッシュの準備
コンパクトフラッシュ上にファイルシステムを作成する。
root@ttyp0[mnt1]# 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+ 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/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@ttyp0[mnt1]#
root@ttyp0[mnt1]# 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 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@ttyp0[mnt1]#
ot@ttyp0[mnt1]# ls -l /mnt
合計 9
drwxr-xr-x 2 root root 0 2003-10-17 08:52 auto
lrwxrwxrwx 1 root root 15 2003-10-17 08:50 cdrom -> /mnt/auto/cdrom
lrwxrwxrwx 1 root root 16 2003-10-17 08:50 floppy -> /mnt/auto/floppy
drwxr-xr-x 2 root root 1024 2003-10-17 17:49 hd
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 hda1
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 hda2
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 pts
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 sda1
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 sda3
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 sda5
drwxr-xr-x 2 root root 1024 2003-10-17 08:49 sdb1
drwxr-xr-x 2 root root 1024 2003-10-17 17:49 test
root@ttyp0[mnt1]# mount -t ext3 /dev/sdb1 /mnt/sdb1
root@ttyp0[mnt1]# df -k
Filesystem 1K-ブロック 使用 使用可 使用% マウント位
/dev/root 1971 1662 309 85% /
/dev/cdrom 635994 635994 0 100% /cdrom
/dev/cloop 1528028 1528028 0 100% /KNOPPIX
/ramdisk 409008 5816 403192 2% /ramdisk
/dev/sda1 5044156 4468532 319392 94% /mnt1
/dev/sdb1 484602 8239 451341 2% /mnt/sdb1
root@ttyp0[mnt1]#
(2-2). 圧縮 tarファイルの展開
compact-debian-oct162003.tar.gzファイルを展開する。
root@ttyp0[sdb1]# pwd
/mnt/sdb1
root@ttyp0[sdb1]# ls -l
合計 12
drwx------ 2 root root 12288 2003-10-17 10:07 lost+found
root@ttyp0[sdb1]# ls -l /mnt1/com*
-rw-r--r-- 1 knoppix knoppix 143602724 2003-10-17 09:48 /mnt1/compact-debian-oct162003.tar.gz
root@ttyp0[sdb1]# tar xzf /mnt1/compact-debian-oct162003.tar.gz
root@ttyp0[sdb1]#
root@ttyp0[sdb1]# pwd
/mnt/sdb1
root@ttyp0[sdb1]# ls -l
合計 44
drwxr-xr-x 2 root root 2048 2003-10-15 09:12 bin
drwxr-xr-x 3 root root 1024 2003-10-08 10:29 boot
drwxr-xr-x 2 root root 1024 2003-10-06 18:57 cdrom
drwxr-xr-x 9 root root 21504 2003-10-16 10:03 dev
drwxr-xr-x 42 root root 3072 2003-10-16 10:03 etc
drwxr-xr-x 2 root root 1024 2003-10-06 18:57 floppy
drwxrwsr-x 3 root staff 1024 2003-10-06 10:30 home
drwxr-xr-x 2 root root 1024 2003-10-06 18:57 initrd
drwxr-xr-x 5 root root 3072 2003-10-06 16:47 lib
drwx------ 2 root root 1024 2003-10-06 18:07 lost+found
drwxr-xr-x 2 root root 1024 2003-10-16 09:45 mnt
drwxr-xr-x 2 root root 1024 2003-10-06 18:57 opt
drwxr-xr-x 2 root root 1024 2002-02-09 00:42 proc
drwxr-xr-x 4 root root 1024 2003-10-09 13:53 ramfs
drwxr-xr-x 3 root root 1024 2003-10-08 17:10 root
drwxr-xr-x 2 root root 2048 2003-10-15 09:12 sbin
lrwxrwxrwx 1 root root 9 2003-10-17 10:16 tmp -> ramfs/tmp
drwxr-xr-x 12 root root 1024 2003-10-15 09:11 usr
lrwxrwxrwx 1 root root 9 2003-10-17 10:40 var -> ramfs/var
lrwxrwxrwx 1 root root 25 2003-10-17 10:16 vmlinuz -> boot/vmlinuz-2.4.18-bf2.4
root@ttyp0[sdb1]#
root@ttyp0[sdb1]# which e2label
/sbin/e2label
root@ttyp0[sdb1]# e2label /dev/sdb1
root@ttyp0[sdb1]# e2label /dev/sdb1 /
root@ttyp0[sdb1]# e2label /dev/sdb1
/
root@ttyp0[sdb1]#
root@ttyp0[sdb1]# cd sbin
root@ttyp0[sbin]# pwd
/mnt/sdb1/sbin
root@ttyp0[sbin]# ls -l grub
-rwxr-xr-x 1 root root 109560 2002-02-04 13:41 grub
root@ttyp0[sbin]#
root@ttyp0[sbin]# ./grub
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.91 (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)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd2) (hd2)1+16 p (hd2,0)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.
grub> quit
root@ttyp0[sbin]#
注.
"root (hd1,0)" および "setup (hd1)" のコマンドで指定するハードディス
クの番号は、ユーザの使用環境によって変わる。 私の環境では、
内蔵IDEハードディスク : /dev/hda hd0
外部USBディスク : /dev/sda hd1
USB-コンパクトフラッシュR/Wアダプタ : /dev/sdb hd2
となっている。
(2-3). 作成したコンパクトフラッシュを起動
KNOPPIXシステムをシャットダウンして、コンパクトフラッシュのメディアを
アダプタからとりはずす。 こうして作成したコンパクトフラッシュのメディア
をCC/NETに装着し電源をオンする。
onlsbc1:/home/inoue# shutdown -h now
onlsbc1:/home/inoue# Broadcast message from root (pts/0) (Fri Oct 17 13:25:49 2003):
The system is going down for system halt NOW!
:
:
GRUB Hard Disk Error
GRUB ハードディスクエラーになった。
FD上のgrubを使って立ち上げる。
(2-4). grub の再セットアップ
コンパクトフラッシュのシステムが立ち上がったところで grub を再セット
アップする。
onlsun4[42]% ssh -l toyo onlsbc1
The authenticity of host 'onlsbc1 (130.87.153.3)' can't be established.
RSA key fingerprint is 39:d3:0b:96:ac:92:26:d1:38:2c:fa:60:d8:22:bf:98.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'onlsbc1,130.87.153.3' (RSA) to the list of known hosts.
toyo@onlsbc1's password:
Linux onlsbc1 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown
Most of the programs included with the Debian GNU/Linux system are
freely redistributable; the exact distribution terms for each program
are described in the individual files in /usr/share/doc/*/copyright
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Oct 9 14:54:00 2003 from onlsun4.kek.jp
toyo@onlsbc1:~$
onlsbc1:/boot# pwd
/boot
onlsbc1:/boot# ls -l
total 1809
-rw-r--r-- 1 root root 559088 Oct 6 18:10 System.map-2.4.18-bf2.4
lrwxrwxrwx 1 root root 11 Oct 17 10:16 boot.b -> boot-menu.b
-rw-r--r-- 1 root root 16984 Oct 6 18:10 config-2.4.18-bf2.4
drwxr-xr-x 2 root root 1024 Oct 17 13:43 grub
-rw-r--r-- 1 root root 1263339 Oct 6 18:10 vmlinuz-2.4.18-bf2.4
onlsbc1:/boot# mv grub grub-bak
onlsbc1:/boot#
onlsbc1:/sbin# pwd
/sbin
onlsbc1:/sbin# ls -l grub
-rwxr-xr-x 1 root root 109560 Feb 4 2002 grub
onlsbc1:/sbin#
onlsbc1:/sbin# which grub
/sbin/grub
onlsbc1:/sbin# grub
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.91 (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 (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no
Error 15: File not found
grub> quit
grub-install からやり直す。
onlsbc1:/# grub-install /dev/hdc
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.91 (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 (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)
Checking if "/boot/grub/stage1" exists... no
Error 2: Bad file or directory type
grub> quit
onlsbc1:/#
onlsbc1:/boot# pwd
/boot
onlsbc1:/boot# rm -rf grub
onlsbc1:/boot#
grub パッケージのインストールからやり直す。
onlsbc1:/# apt-get remove --purge grub
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
grub*
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 504kB will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 19233 files and directories currently installed.)
Removing grub ...
dpkg: failed to write available record about `gob' to `/var/lib/dpkg/available': No space left on device
E: Sub-process /usr/bin/dpkg returned an error code (2)
onlsbc1:/#
/var のスペースが足りなくて、パッケージを削除できない。
RAMディスクのサイズを大きくして作業を進める。
nlsbc1:/# reboot
Broadcast message from root (pts/0) (Fri Oct 17 14:36:22 2003):
The system is going down for reboot NOW!
:
:
grub> root (hd0,0)
grub> kernel /vmlinuz root=/dev/hdc1 ro ramdisk_size=65578
grub> boot
:
onlsun4[43]% !!
ssh -l toyo onlsbc1
toyo@onlsbc1's password:
Linux onlsbc1 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown
Most of the programs included with the Debian GNU/Linux system are
freely redistributable; the exact distribution terms for each program
are described in the individual files in /usr/share/doc/*/copyright
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Oct 9 14:54:00 2003 from onlsun4.kek.jp
toyo@onlsbc1:~$
onlsbc1:/home/toyo# apt-get --purge remove grub
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
grub*
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 504kB will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 19233 files and directories currently installed.)
Removing grub ...
onlsbc1:/home/toyo#
grub パッケージの再インストール。
onlsbc1:/home/toyo# apt-get clean
onlsbc1:/home/toyo# apt-get install grub
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
grub
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 247kB of archives. After unpacking 504kB will be used.
Get:1 http://ftp.jp.debian.org stable/main grub 0.91-2 [247kB]
Fetched 247kB in 30s (7968B/s)
Selecting previously deselected package grub.
(Reading database ... 19196 files and directories currently installed.)
Unpacking grub (from .../archives/grub_0.91-2_i386.deb) ...
Setting up grub (0.91-2) ...
onlsbc1:/home/toyo#
onlsbc1:/home/toyo# apt-get clean
onlsbc1:/home/toyo# grub-install /dev/hdc1
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.91 (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 (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0,0)
Checking if "/boot/grub/stage1" exists... no
Error 2: Bad file or directory type
grub> quit
onlsbc1:/home/toyo#
onlsbc1:/home/toyo# grub
Probing devices to guess BIOS drives. This may take a long time.
GRUB version 0.91 (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 (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.
grub> quit
onlsbc1:/home/toyo#
onlsbc1:/home/toyo# ls -l /boot
total 1810
-rw-r--r-- 1 root root 559088 Oct 6 18:10 System.map-2.4.18-bf2.4
lrwxrwxrwx 1 root root 11 Oct 17 10:16 boot.b -> boot-menu.b
-rw-r--r-- 1 root root 16984 Oct 6 18:10 config-2.4.18-bf2.4
drwxr-xr-x 2 root root 1024 Oct 17 15:29 grub
drwxr-xr-x 2 root root 1024 Oct 17 13:43 grub-bak
-rw-r--r-- 1 root root 1263339 Oct 6 18:10 vmlinuz-2.4.18-bf2.4
onlsbc1:/home/toyo# ls -l /boot/grub
total 163
-rw-r--r-- 1 root root 30 Oct 17 15:29 device.map
-rw-r--r-- 1 root root 7904 Oct 17 15:29 e2fs_stage1_5
-rw-r--r-- 1 root root 7440 Oct 17 15:29 fat_stage1_5
-rw-r--r-- 1 root root 6912 Oct 17 15:29 ffs_stage1_5
-rw-r--r-- 1 root root 8640 Oct 17 15:29 jfs_stage1_5
-rw-r--r-- 1 root root 7104 Oct 17 15:29 minix_stage1_5
-rw-r--r-- 1 root root 9568 Oct 17 15:29 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Oct 17 15:29 stage1
-rw-r--r-- 1 root root 95712 Oct 17 15:29 stage2
-rw-r--r-- 1 root root 6560 Oct 17 15:29 vstafs_stage1_5
-rw-r--r-- 1 root root 9320 Oct 17 15:29 xfs_stage1_5
onlsbc1:/home/toyo# update-grub
Searching for GRUB installation directory ... found: /boot/grub .
Testing for an existing GRUB menu.list file...
Could not find /boot/grub/menu.lst file. Would you like one generated for you? (y/N) y
Updating /boot/grub/menu.lst ... done
Please note that configuration parameters for GRUB are stored in
/boot/grub/menu.lst . You must edit this file in order to set the options
which GRUB passes to the kernel, as well as the drive which GRUB looks in to
for the kernel.
Everything on the line after "kopt=" is passed to the kernel as parameters,
and "groot=" must be set to the partition(in GRUB terms, such as "(hd0,0)")
which GRUB will load the kernel from.
After you have edited /boot/grub/menu.lst , please re-run 'update-grub'.
onlsbc1:/home/toyo# ls -l /boot/grub
total 166
-rw-r--r-- 1 root root 30 Oct 17 15:29 device.map
-rw-r--r-- 1 root root 7904 Oct 17 15:29 e2fs_stage1_5
-rw-r--r-- 1 root root 7440 Oct 17 15:29 fat_stage1_5
-rw-r--r-- 1 root root 6912 Oct 17 15:29 ffs_stage1_5
-rw-r--r-- 1 root root 8640 Oct 17 15:29 jfs_stage1_5
-rw-r--r-- 1 root root 2398 Oct 17 15:43 menu.lst
-rw-r--r-- 1 root root 7104 Oct 17 15:29 minix_stage1_5
-rw-r--r-- 1 root root 9568 Oct 17 15:29 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Oct 17 15:29 stage1
-rw-r--r-- 1 root root 95712 Oct 17 15:29 stage2
-rw-r--r-- 1 root root 6560 Oct 17 15:29 vstafs_stage1_5
-rw-r--r-- 1 root root 9320 Oct 17 15:29 xfs_stage1_5
onlsbc1:/home/toyo# cat /boot/grub/menu.lst
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5
# Pretty colours
color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default optons below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda1 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)
## should update-grub create alternative boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.4.18-bf2.4
root (hd0,0)
kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro
savedefault
title Debian GNU/Linux, kernel 2.4.18-bf2.4 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro single
savedefault
### END DEBIAN AUTOMAGIC KERNELS LIST
onlsbc1:/home/toyo#
onlsbc1:/boot/grub# pwd
/boot/grub
onlsbc1:/boot/grub# vi menu.lst
:
title RAM SIZE=50MB, Debian GNU/Linux, kernel 2.4.18-bf2.4
root (hd0,0)
#kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro
kernel /boot/vmlinuz-2.4.18-bf2.4 root=/dev/hdc1 ro ramdisk_size=50712
savedefault
:
menu.lst: 89 lines, 2486 characters
onlsbc1:/boot/grub#
onlsbc1:/boot/grub# update-grub
Searching for GRUB installation directory ... found: /boot/grub .
Testing for an existing GRUB menu.list file... found: /boot/grub/menu.lst .
Updating /boot/grub/menu.lst ... done
onlsbc1:/boot/grub#
---xxxx