Skip to content

Instantly share code, notes, and snippets.

@novi
Created April 7, 2012 14:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save novi/2329413 to your computer and use it in GitHub Desktop.
Save novi/2329413 to your computer and use it in GitHub Desktop.
新しいさくらのVPS(v3, 2G)にArchLinuxをインストール

4/6のお昼、申し込みを4回くらいポチポチしちゃったけど大丈夫かな... って思ったら、2台契約されていました…

前準備

参考にしたソースは次

  1. さくらVPSにArchLinuxを入れる - sharow memo
  2. さくらVPS にArch Linux をインストールする。 - kenkov diary
  3. GUIDE: Arch install on qemu kvm x86_64 virtio virt-manager (Page 1) / Installation / Arch Linux Forums

ソース1の冒頭を見ながら、CentOSの設定をメモる。

  • Archbootからだとmkinitcpioがコケるので、initramfsがビルドできない
    • VFS云々でkernel panic
  • さらに、virtioのmoduleが読み込まれないのでコケる (はず)
    • さくらの新VPS(v3)からはvirtio(vda)になった。パフォーマンスは良いんだけどね。裏技でSCSI(sda)でも起動できるが非推奨。

なので、ソース1のArchbootを使った方法は使えません。オフィシャルのisoインストーラを使います。 isoから起動して、ソース3の方法でインストールすれば起動します。 今回は archlinux-2011.08.19-core-x86_64.iso を使いました。(ローカルインストール)

手順

  1. がんばってGrub2をインストールする。(色々と面倒なことをやった気がする。これからの人はソース2にあるようにGrub2が標準のディストリをインストールすればOK)
  2. フォーマットする予定の無いパーティションにisoを置く。
  3. リブートしてGrub2のシェルを起動する。
  4. シェルからisoを起動。起動方法は一番下(40_custom)参照。
  5. ソース3の方法でインストールする。途中ブートローダの選択はskipする。(今回root方法はby-labelにしました。grub2が自動で設定するので影響しないかも。)
  6. grub-mkconfig する前に /etc/grub.d/40_custom をエディタで開いて、以下を追加。(これがないとシリアルポートコンソールが使えないはず)
set timeout=100
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal_input serial console
terminal_output serial console

isoからブートできてしまえば、あとは手順通りです。

パーティション

  • mbr: Grub2
  • vda1: CentOSのboot (最終的には使わない) 100MB
  • vda2: CentOSのswapを潰して、ext3としてArchbootとインストーラのisoを入れてある(レスキュー用) 2GB
  • vda3: /boot 200MB
  • vda5: swap 2GB
  • vda6: / 10GB
  • vda7: /home 残り

40_custom

set timeout=100
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal_input serial console
terminal_output serial console

# iso の起動方法のサンプル
# (hd0,2) と img_dev=/dev/vda2 はisoを置いたパーティション
menuentry "Archlinux-2011.08.19-core-x86_64.iso" {
set isofile="/archives/archlinux-2011.08.19-core-x86_64.iso"
loopback loop (hd0,2)$isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201108 img_dev=/dev/vda2 img_loop=$isofile earlymodules=loop
initrd (loop)/arch/boot/x86_64/archiso.img
}

menuentry "ArchBoot-2012-01" {
linux (hd0,2)/boot/vm64 boot=live config hostname=archlinux console=tty0 console=ttyS0,115200n8r
initrd (hd0,2)/boot/initrd64.img
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment