おもちゃ環境備忘録 その4 (さくらのVPS 512にCentoOS 6をインストールしてみた。)

前回までCentOS 5.4を色々設定していたんですが
もう本当にただの思いつきでCentOS 6にしました。

一応起動して動いてますが、
多分(執筆時点で)さくらはサポートしてくれないので注意してください。

準備

最低限ネットワーク周りの情報を抑えます。
・IP/Subnet
デフォルトゲートウェイ
DNS

CentOSのネットワークインストールイメージをダウンロード

今回は理研からダウンロードします。

# curl -O http://ftp.riken.jp/Linux/centos/6.0/isos/x86_64/CentOS-6.0-x86_64-netinstall.iso

ISOイメージをマウントしてコピー

起動に必要なファイルを/boot配下にコピーします。

# mount -t iso9660 -o ro,loop CentOS-6.0-x86_64-netinstall.iso /mnt/
# cp /mnt/images/pxeboot/vmlinuz /mnt/images/pxeboot/initrd.img /boot 

grub.confへ追記する。

# cat /boot/grub/grub.conf 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/vda2
#          initrd /initrd-version.img
#boot=/dev/vda
default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 
terminal --timeout=10 serial console
hiddenmenu
title CentOS6 Installation
	root (hd0,0)
	kernel /vmlinuz ro root=LABEL=/ console=tty0 console=ttyS0,115200n8r
	initrd /initrd.img
title CentOS (2.6.18-238.19.1.el5)
	root (hd0,0)
	kernel /vmlinuz-2.6.18-238.19.1.el5 ro root=LABEL=/ console=tty0 console=ttyS0,115200n8r
	initrd /initrd-2.6.18-238.19.1.el5.img
title CentOS (2.6.18-194.26.1.el5)
	root (hd0,0)
	kernel /vmlinuz-2.6.18-194.26.1.el5 ro root=LABEL=/ console=tty0 console=ttyS0,115200n8r
	initrd /initrd-2.6.18-194.26.1.el5.img

再起動する

再起動後ネットワークインストールが始まります。

# reboot

OSインストール

ここからリモートコンソールをコピペしたので
がっつり体裁が崩れてます。

治すのに面倒だったからこのままで。。。w

言語を選ぶ

英語を選びました。

───────┤ Choose a Language ├────────┐
                    │                                     │
                    │ What language would you like to use │
                    │ during the installation process?    │
                    │                                     │
                    │      Catalan                ↑       │
                    │      Chinese(Simplified)    ▮       │
                    │      Chinese(Traditional)   ▒       │
                    │      Croatian               ▒       │
                    │      Czech                  ▒       │
                    │      Danish                 ▒       │
                    │      Dutch                  ▒       │
                    │      English                ↓                                                                                                            
                    │ 
                    │                                     │
                    │               ┌────┐                │
                    │               │ OK │                │
                    │               └────┘                │
                    │                                     │
                    │                                     │
どのメディアからインストールするか選ぶ

URLを選びます。

                        ┌───┤ Installation Method ├───┐
                        │                             │
                        │ What type of media contains │
                        │ the installation image?     │
                        │                             │
                        │        Local CD/DVD         │
                        │        Hard drive           │
                        │        NFS directory        │
                        │        URL                  │
                        │                             │
                        │   ┌────┐       ┌──────┐     │
                        │   │ OK │       │ Back │     │
                        │   └────┘       └──────┘     │
                        │                             │
                        │                             │
TCP/IPの設定

IPv4はManualを選択します。
IPv6は遊んでみたいのでそのまま有効にしました。

─────────────┤ Configure TCP/IP ├─────────────┐
                │                                              │
                │ [*] Enable IPv4 support                      │
                │        ( ) Dynamic IP configuration (DHCP)   │
                │        (*) Manual configuration              │
                │                                              │
                │ [*] Enable IPv6 support                      │
                │        (*) Automatic neighbor discovery      │
                │        ( ) Dynamic IP configuration (DHCPv6) │
                │        ( ) Manual configuration              │
                │                                              │
                │        ┌────┐               ┌──────┐         │
                │        │ OK │               │ Back │         │
                │        └────┘               └──────┘         │
                │                                              │
                │                                              │

最初に控えたネットワーク値を入力

       ┌────────────┤ Manual TCP/IP Configuration ├─────────────────┐
       │                                                                │
       │ Enter the IPv4 and/or the IPv6 address and prefix (address /   │
       │ prefix).  For IPv4, the dotted-quad netmask or the CIDR-style  │
       │ prefix are acceptable. The gateway and name server fields must │
       │ be valid IPv4 or IPv6 addresses.                               │
       │                                                                │
       │ IPv4 address: 49.212.0.xxx____ / 255.255.254.0___              │
       │ Gateway:      49.212.0.1_______________________________        │
       │ Name Server:  210.224.163.4____________________________        │
       │                                                                │
       │             ┌────┐                        ┌──────┐             │
       │             │ OK │                        │ Back │             │
       │             └────┘                        └──────┘             │
       │                                                                │
       │                                                                │
ミラーサーバを指定

やっぱり理研を使いました。

        ┌────────────────────────┤ URL Setup ├─────────────────────────┐
        │
        │          Please enter the URL containing the CentOS
        │          installation image on your server. 
        │
        │ http://ftp.riken.go.jp/Linux/centos/6.0/os/x86_64
        │
        │ [ ] Enable HTTP proxy
        │
        │ Proxy URL        ___________________________________
        │ Username         _______________
        │
        │ Password         _______________
        │
        │            ┌────┐                       ┌──────┐
        │            │ OK │                       │ Back │             │
        │            └────┘                       └──────┘
        │
        │
タイムゾーンの指定

普通にAsia/Tokyo(GMT+9)を使います。
UTCは使いません。

                    ┌───────┤ Time Zone Selection ├───────┐
                    │                                     │
                    │ In which time zone are you located? │
                    │                                     │
                    │ [ ] System clock uses UTC           │
                    │                                     │
                    │  Asia/Tehran                     ↑  │
                    │  Asia/Thimphu                    ▒  │
                    │  Asia/Tokyo                      ▮  │
                    │  Asia/Ulaanbaatar                ▒  │
                    │  Asia/Urumqi                     ↓  │
                    │                                     │
                    │      ┌────┐          ┌──────┐       │
                    │      │ OK │          │ Back │       │
                    │      └────┘          └──────┘       │
                    │                                     │
                    │                                     │
パスワード設定
                ┌──────────────┤ Root Password ├───────────────┐
                │                                              │
                │    Pick a root password. You must type it    │
                │    twice to ensure you know it and do not    │
                │    make a typing mistake.                    │
                │                                              │
                │ Password:           ********________________ │
                │ Password (confirm): *********_______________ │
                │                                              │
                │        ┌────┐               ┌──────┐         │
                │        │ OK │               │ Back │         │
                │        └────┘               └──────┘         │
                │                                              │
                │                                              │
パーティション設定

ドライブ全体を使います。

       ┌─────────────────────┤ Partitioning Type ├─────────────────────┐
       │                                                               │
       │ Installation requires partitioning of your hard drive.  The   │
       │ default layout is suitable for most users.  Select what space │
       │ to use and which drives to use as the install target.         │
       │                                                               │
       │                 Use entire drive                     │
       │                 Replace existing Linux system                 │
       │                 Use free space                                │
       │                                                               │
       │   Which drive(s) do you want to use for this installation?    │
       │         [*]    sda    20480 MB (ATA QEMU HARDDISK) ↑          │
       │                                                    ▮          │
       │                                                               │
       │                      ┌────┐   ┌──────┐                        │
       │                      │ OK │   │ Back │                        │
       │                      └────┘   └──────┘                        │
       │                                                               │
       │                                                               │

この後警告が出るのでOKすると
フォーマットが始まってインストールして再起動を促されます。
再起動が終われば普通に完了。

初期設定

スターウォーズみたいにエピソードが逆になったですが、
このエントリーもよかったら見てください。

おもちゃ環境備忘録 その1 - げんろぐ
おもちゃ環境備忘録 その2 - げんろぐ
おもちゃ環境備忘録 その3 - げんろぐ


このエントリーはid:kaigaiさんのエントリーを参考にさせて頂きました。
READ : さくらのVPSにFedoraをインスコ - KaiGaiの俺メモ