MAKEDEV: mkdir: File exists
MAKEDEV: mkdir: File exists
Create /etc
Create an /etc directory:
# mkdir /mnt/ec2-fs/etc
Create /mnt/ec2-fs/etc/fstab and add the following entries to it:
/dev/sda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
Create yum-xen.conf
Create a temporary yum configuration file that will ensure all the required basic packages and utilities
are installed. This configuration file can be created anywhere on your main file system, but for now we'll
assume that you create it in your working directory. Just to clarify, it does not need to be created in the
loopback file system. It is used only during installation of the loopback file system. Create
yum-xen.conf with the following content:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
gpgcheck=0
obsoletes=1
reposdir=/dev/null
[base]
name=Fedora Core 4 - $basearch - Base
mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
[updates-released]
name=Fedora Core 4 - $basearch - Released Updates
mirrorl-
ist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
enabled=1
Mount proc
Due to a bug in the groupadd utility from the shadow-utils package (versions prior to 4.0.7-7), the
new proc file system needs to be mounted by hand at this point.
# mkdir /mnt/ec2-fs/proc
# mount -t proc none /mnt/ec2-fs/proc
Install the Operating System
At this stage all the basic directories and files have been created and you are ready to do the operating
system installation. This process might take a while depending on the speed of the host and the network
link to the repository.
# yum -c yum-xen.conf --installroot=/mnt/ec2-fs -y groupinstall Base
Amazon EC2
Developer Guide
7
Setting up Group Process
Setting up repositories
base 100% |=========================| 1.1 kB 00:00
updates-released 100% |=========================| 1.1 kB 00:00
comps.xml 100% |=========================| 693 kB 00:00
comps.xml 100% |=========================| 693 kB 00:00
Setting up repositories
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 824 kB 00:00
base : ################################################## 2772/2772
Added 2772 new packages, deleted 0 old in 15.32 seconds
primary.xml.gz 100% |=========================| 824 kB 00:00
updates-re: ################################################## 2772/2772
Added 2772 new packages, deleted 0 old in 10.74 seconds
...
Complete!
Congratulations!
You now have a base installation in the image file you've created. The next steps are to configure the
installation to operate inside Amazon EC2, and to customize the installation for your use.
Configure the Installed Operating System
The base operating system has now successfully been installed. You must now configure the networking
and hard drives to work in the Amazon EC2 environment.
Configure the Network Interface
The Amazon EC2 environment provides a networking interface card that needs to be configured to
provide external network access for the running instance. Edit (or create) the following file
/mnt/ec2-fs/etc/sysconfig/network-scripts/ifcfg-eth0, making sure it contains at least
the following information.
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
Note
The Amazon EC2 DHCP server ignores hostname requests. If you set DHCP_HOSTNAME the
local hostname will be set on the instance but not externally. In addition, this local hostname
will be the same for all instances of the AMI, which may prove confusing.
Enable Networking
After configuring the network interface, you need to ensure that networking will come up when the
system is started. To do this, ensure that (at least) the following appears in
/mnt/ec2-fs/etc/sysconfig/network.
NETWORKING=yes
Set up Hard Drives in /etc/fstab
Amazon EC2
Developer Guide
8
Previous Page Next Page