2 2008-03-05
시스템 설정하기

/etc/fstab안에 기본적으로 들어있는 BOOT, ROOT, 그리고 SWAP을 위에서 생성한 실제 파티션 이름으로 수정합니다.

livecd linux # cd /etc
livecd etc # nano -w fstab
/dev/sda1   /boot     ext2    noauto,noatime     1 2
/dev/sda3   /         ext3    noatime            0 1
/dev/sda2   none      swap    sw                 0 0

/etc/fstab안에 기본적으로 들어있는 BOOT, ROOT, 그리고 SWAP을 위에서 생성한 실제 파티션 이름으로 수정합니다.

livecd linux # cd /etc
livecd etc # nano -w fstab
/dev/md1          /boot                   ext2  noauto,noatime  1 2
/dev/md3          /                       ext3  noatime         0 1
/dev/sda2         none                    swap  sw,pri=1        0 0
/dev/sdb2         none                    swap  sw,pri=1        0 0
/dev/vg/usr       /usr                    ext3  noatime         1 2
/dev/vg/portage   /usr/portage            ext2  noatime         1 2
/dev/vg/distfiles /usr/portage/distfiles  ext2  noatime         1 2
/dev/vg/home      /home                   ext3  noatime         1 2
/dev/vg/opt       /opt                    ext3  noatime         1 2
/dev/vg/tmp       /tmp                    ext2  noatime         1 2
/dev/vg/var       /var                    ext3  noatime         1 2
/dev/vg/vartmp    /var/tmp                ext2  noatime         1 2

/etc/conf.d/net 파일을 수정하여 네트워크 설정을 합니다. 그리고, net.eth0을 default run-level의 init 스크립트에 추가합니다. 만약에 두개 이상의 NIC를 가지고 있다면, 나머지 NIC들을 net.eth0에 심볼릭 링크를 걸으신 후에, default run-level의 init 스크립트에 또한 추가시켜 줍니다. nano를 이용하거나, 밑에 나와있는 명령어들을 이용하여 /etc/conf.d/net파일을 수정하시면 됩니다.

livecd etc # cd conf.d
livecd conf.d # echo 'config_eth0=( "192.168.1.10/24" )' >> net
livecd conf.d # echo 'routes_eth0=( "default via 192.168.1.1" )' >> net
livecd conf.d # rc-update add net.eth0 default
(네트워크 카드 드라이버를 모듈로써 컴파일하였다면, 그 이름을 /etc/modules.autoload.d/kernel-2.6에 추가하여 줍니다.)
livecd conf.d # echo r8169 >> /etc/modules.autoload.d/kernel-2.6
(만약 재부팅 후에도 원격 컴퓨터에서 ssh로 접속 할수 있게끔 하려면은 부팅시 sshd를 자동시작하게끔 설정합니다.)
livecd conf.d # rc-update add sshd default
만약 PCMCIA 카드를 사용하신다면,pcmciautils을 인스톨합니다.

passwd를 이용하여 root 비밀번호를 설정합니다.

livecd conf.d # passwd
New UNIX password: 비밀번호 입력
Retype new UNIX password: 비밀번호 재입력
passwd: password updated successfully

/etc/conf.d/clock 을 수정하여 이전 쳅터에서 사용했던 시간대를 설정합니다.

livecd conf.d # nano -w /etc/conf.d/clock
TIMEZONE="Asia/Seoul"

/etc/rc.conf, /etc/conf.d/rc, 그리고 /etc/conf.d/keymaps 를 열어, 시스템 설정을 확인하고, 필요하다면 수정합니다.

livecd conf.d # nano -w /etc/rc.conf
livecd conf.d # nano -w /etc/conf.d/rc
livecd conf.d # nano -w /etc/conf.d/keymaps
시스템 도구들 설치

RAID와 LVM2 도구들을 설치합니다.

livecd conf.d # emerge mdadm lvm2

syslog-ng와 같은 시스템 로깅 툴과 vixie-cron 같은 cron 데몬을 설치하고 default run-level 에 추가하여 줍니다.

Cron 데몬은 MTA를 필요로 하기에, mail-mta/ssmtp 를 설치하라고 나올 것 입니다. 만약 다른 MTA를 사용하시고 싶으시다면, 이 단계에서 설치하시길 추천드립니다. 하지만 지금 다른 MTA를 설치하실 시간이 없으시다면, 지금은 그냥 ssmtp만 설치하시고, 나중에 원하시는 MTA를 설치한 후, ssmtp를 지우셔도 무방합니다.
livecd conf.d # time emerge syslog-ng vixie-cron

real  1m54.099s
user  1m2.630s
sys   0m34.620s
livecd conf.d # rc-update add syslog-ng default
livecd conf.d # rc-update add vixie-cron default

앞서 설치 한 파일 시스템의 종류에 따라, 필요한 도구들을 설치하고 (xfsprogs, reiserfsprogs 또는 jfsutils) 네트워크 도구들 또한 설치합니다. (dhcpcd 또는 ppp)

livecd conf.d # emerge xfsprogs       (만약 XFS를 사용한다면)
livecd conf.d # emerge jfsutils       (만약 JFS를 사용한다면)
livecd conf.d # emerge reiserfsprogs  (만약 ReiserFS를 사용한다면)
livecd conf.d # emerge dhcpcd         (만약 DHCP 클라이언트가 필요하다면)
livecd conf.d # emerge ppp            (만약 PPPoE ADSL 연결이 필요하다면)
부트로더 설정

grub을 설치하고 설정합니다.

livecd conf.d # time emerge grub

real  1m4.634s
user  0m39.460s
sys   0m15.280s
livecd conf.d # nano -w /boot/grub/grub.conf
default 0
timeout 10

title Gentoo
root (hd0,0)
kernel /boot/kernel root=
livecd conf.d # grub
Probing devices to guess BIOS drives. This may take a long time.

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

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 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
grub/menu.lst"... succeeded
Done.

grub> quit
livecd conf.d # grub
Probing devices to guess BIOS drives. This may take a long time.

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

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 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
grub/menu.lst"... succeeded
Done.

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1)

grub> quit