で、唐突めいているけど、あちこち調べながら X なしで squeeze を KVM にてインストールする方法。あちこち調べたのは良いけど、ポロポロ忘れるので...
目的としては DRBD や heartbeat 試したく lxc 使おうとしたけど、今々は lxc 上で DRBD 動かず。ちょっと挑戦した けど、8.4 で connector 止めて genetlink 使う予定だそうなので、素直に? 挫折、待たせてもらうことに。d-i をイジる手もあるそうだけど、素の netinst.iso で何度か試してみて忘れがちなコト
- 真っ黒画面でスペース & linux test
- /etc/default/grub の編集 & update-grub
- /etc/inittab の編集
$ kvm-img create -f raw drbd1.img 8G
Formatting 'drbd1.img', fmt=raw size=8589934592
$ ls
debian-6.0.0-amd64-netinst.iso drbd1.img
-f qcow2 が正統? なのだろうけど、後々ホスト側からイジるにあたって
kvm-nbd とか面倒なので...で起動
真っ黒画面の真ん中に$ kvm -cdrom debian-6.0.0-amd64-netinst.iso -hda drbd1.img -boot d -curses
640x480で、何も表示されないけどスペース一回押した後に (ここ何押下するかよく忘れる)
linux textとすると...
こんな画面。ここで F8Welcome to Debian GNU/Linux! F1
This is a Debian 6.0 (squeeze) installation CD-ROM.
It was built 20110205-14:31; d-i 20110106+b1.
HELP INDEX
KEY TOPIC
<F1> This page, the help index.
<F2> Prerequisites for installing Debian.
<F3> Boot methods for special ways of using this CD-ROM
<F4> Additional boot methods; rescue mode.
<F5> Special boot parameters, overview.
<F6> Special boot parameters for special machines.
<F7> Special boot parameters for selected disk controllers.
<F8> Special boot parameters for the install system.
<F9> How to get help.
<F10> Copyrights and warranties.
Press F2 through F10 for details, or ENTER to boot:
For example そのままSPECIAL BOOT PARAMETERS - INSTALLATION SYSTEM F8
You can use the following boot parameters at the boot: prompt,
in combination with the boot method (see <F3>). These parameters
control how the installer works.
RESULT PARAMETER
Disable framebuffer vga=normal fb=false
Don't start PCMCIA hw-detect/start_pcmcia=false
Force static network config netcfg/disable_dhcp=true
Set keyboard map bootkbd=es
Select the kde or xfce desktops desktop=kde
Accessibility options (last 2 options not available for all images):
Use high contrast theme theme=dark
Use Braille tty brltty=driver,device,texttable
Use Speakup speakup.synth=driver
For example:
boot: install vga=normal fb=false
Press F1 for the help index, or ENTER to boot:
で進む。イメージファイル名の通り DRBD を試したかったのでパーティションは 6G を / に 2G は何もせず残りを swap として。Software Selection では Standard と SSH。GRUB のインストールまで終ってリブートするから CD 外してね。になったところinstall vga=normal fb=false
で Go Back。Execute Shell を選択して、ちょっと面倒だけど[!!] Finish the installation
Installation complete
Installation is complete, so it is time to boot into your new system.
Make sure to remove the installation media (CD-ROM, floppies), so
that you boot into the new system rather than restarting the
installation.
<Go Back> <Continue>
もう一つ /etc/inittab もBusyBox v1.17.1 (Debian 1:1.17.1-8) built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ # mount
rootfs on / type rootfs (rw)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
none on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
none on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda1 on /target type ext3 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1 on /dev/.static/dev type ext3 (rw,relatime,errors=remount-ro,data=orde
red)
tmpfs on /target/dev type tmpfs (rw,relatime,mode=755)
~ # chroot /target
# cd /etc/default
# cp grub grub.dpkg-dist
# vi grub
....
# diff -uw grub.dpkg-dist grub
--- grub.dpkg-dist 2011-03-28 11:49:36.000000000 +0900
+++ grub 2011-03-28 11:45:39.000000000 +0900
@@ -4,8 +4,8 @@
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
-GRUB_CMDLINE_LINUX_DEFAULT="quiet"
-GRUB_CMDLINE_LINUX=""
+GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8r"
+GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop
=1"
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
@@ -13,7 +13,7 @@
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
-#GRUB_TERMINAL=console
+GRUB_TERMINAL="serial console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
done
でメニューの Finish the Inistallation & Continue... で再起動しないので、他コンソールから kill して再起動。今度は -curses じゃなくて -nographic で
# cd /etc
# cp inittab inittab.dpkg-dist
# vi inittab
...
# diff -uw inittab.dpkg-dist inittab | head
--- inittab.dpkg-dist 2011-03-28 11:52:02.000000000 +0900
+++ inittab 2011-03-28 11:53:16.000000000 +0900
@@ -52,15 +52,15 @@
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
-2:23:respawn:/sbin/getty 38400 tty2
-3:23:respawn:/sbin/getty 38400 tty3
-4:23:respawn:/sbin/getty 38400 tty4
-5:23:respawn:/sbin/getty 38400 tty5
-6:23:respawn:/sbin/getty 38400 tty6
+#2:23:respawn:/sbin/getty 38400 tty2
+#3:23:respawn:/sbin/getty 38400 tty3
+#4:23:respawn:/sbin/getty 38400 tty4
+#5:23:respawn:/sbin/getty 38400 tty5
+#6:23:respawn:/sbin/getty 38400 tty6
# Example how to put a getty on a serial line (for a terminal)
#
-#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
+T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
# Example how to put a getty on a modem line.
# sync
# exit
~ # sync
~ # exit
でクライアントとして使う分にはソレナリ。kvm -nographic drbd1.img
0 件のコメント:
コメントを投稿