10. あしたのための その3
• 現行のインストーラは「initrd」システムを採用している!
• Debian 7.0(wheezy)のkernelパッケージに含まれるinitrdは圧縮状態で約10MB、
伸張して約24MB!
• Boot時にはkernelイメージとinitrdイメージをRAM読み込み、更にinitrdをRAMDISK
上に展開するので、その分RAMが必要。
なので・・・
Unpacking initramfs...
Kernel panic - not syncing: Out of memory and no killable processes...
となる!
2014/6/28 10
RAM容量の壁!
★ initrdを使わないkernelをbuildする必要あり!
11. 2014/6/28 11
Kernelのビルド
tar Jxf linux-3.2.57.tar.xz
<中略>
cd linux-3.2.57
make menuconfig
<中略>
make-kpkg --revision=1.0 --rootcmd=fakeroot kernel-image
<中略>
エラーが発生しなければ、このファイルが出来上がる♪
../linux-image-3.2.57_1.0_i386.deb
← ここ超重要!!
Kernelのオプションは超重要です。
Initirdを使わなくするオプションは必須ですが、その他、最新のカーネルの標準
オプションでは今回のマシンに全然マッチしていない!
全部見直しの必要あり!! (トホホ・・・)
12. Let’s Try!
2014/6/28 12
パーテーションの設定
fdisk /dev/sdc
Command (m for help): p
Disk /dev/sdc: 10.1 GB, 10056130560 bytes
64 heads, 32 sectors/track, 9590 cylinders, total 19640880 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 2048 18876415 9437184 83 Linux
/dev/sdc2 18876416 19640879 382232 82 Linux swap / Solaris
Command (m for help):
ここからは既に稼働しているマシンにHDDを接続!
13. Let’s Try!
2014/6/28 13
rootのFSを作る
mkfs -t ext4 /dev/sdc1
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
589824 inodes, 2359296 blocks
117964 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2415919104
72 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
Swapを作る
mkswap /dev/sdc2
Setting up swapspace version 1, size = 382228 KiB
no label, UUID=bb1f500a-aa15-41a5-b797-c2c075d125df
mount
mount /dev/sdc1 /mnt
14. Let’s Try!
2014/6/28 14
システムイメージ展開
debootstrap --arch i386 wheezy /mnt http://ftp2.jp.debian.org/debian/
設定ファイル編集
vi /mnt/etc/inittab
vi /mnt/etc/apt/sources.list
vi /mnt/etc/securetty
vi /mnt/etc/fstab
vi /mnt/etc/passwd ← 最初設定し忘れて、bootとはしたけどlogin出来ない状態に…
Kernelイメージのインストール
chroot /mnt
Dpkg -i linux-image-3.2.57_1.0_i386.deb
このkernelはinitrdを使わない
野良ビルドしたkernel
17. Let’s Try!
2014/6/28 17
List of all partitions:
[ 1.746265] No filesystem could mount root, tried:
[ 1.752750] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
うぁぁぁぁぁぁぁ…
Ext4のドライバをモジュールでコンパイルしてた… orz
その他、いろんなことがありました・・・
さっさとまとめておけば良かったのに・・・
もう忘れた・・・ orz
そして、ついに!