dboettger's Blog

Debootstrap Ubuntu Lucid 10.04 on a Rootserver

Posted on: September 7, 2010

Hello,

I didn’t post for a while. But now i have some new stuff. I had some trouble installing ubuntu on a Rootserver ( 1&1 ) where i only had a rescue system available. The only dependency is that the recovery console is a debian based system.

The system was already partitioned and some software raid’s were already available.

Create new swap space:
mkswap /dev/sda2

Reformat md1 with ext3:
mkfs.ext3 /dev/md1

mkdir /ubuntu
mount /dev/md1 /ubuntu

wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.23_all.deb
dpkg –install debootstrap_1.0.23_all.deb

debootstrap –arch amd64 lucid /ubuntu http://archive.ubuntu.com/ubuntu

echo “127.0.0.1 localhost” > /ubuntu/etc/hosts
echo “ilaegir01” > /ubuntu/etc/hostname

vi /etc/network/interfaces

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

vi /ubuntu/etc/fstab

/dev/md1 / ext3 defaults 0 1
/dev/sda2 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0

mount –bind /dev /ubuntu/dev
mount –bind /proc /ubuntu/proc
chroot /ubuntu
apt-get update

apt-get install linux-image-server openssh-server grub

cp /proc/mounts /etc/mtab
aptitude install mdadm
mkdir /boot/grub
grub-install /dev/sda
update-grub

aptitude install nano

nano /boot/grub/menu.lst

change following lines:
kernel /boot/vmlinuz-2.6.32-21-server root=/dev/md1 ro quiet splash
AND
kernel /boot/vmlinuz-2.6.32-21-server root=/dev/md1 ro single

TO:
kernel /boot/vmlinuz-2.6.32-21-server root=/dev/md1 ro quiet splash console=tty0 console=ttyS0,57600
AND
kernel /boot/vmlinuz-2.6.32-21-server root=/dev/md1 ro single console=tty0 console=ttyS0,57600

Be warned to execute update-grub on every kernel security update, then choose the package maintainers version
of menu.lst and add the console again to the kernel parameter!

nano /etc/init/ttyS0.confab

# ttyS0 – getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 57600 ttyS0 vt100

passwd

exit

After reboot you should edit the /etc/apt/sources.list and replace it with the wolling content

nano /etc/apt/sources.list

# deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ – Release amd64 (20100427)]/ lucid main restricted

#deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ – Release amd64 (20100427)]/ lucid main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://de.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ lucid universe
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid universe
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse

## Uncomment the following two lines to add software from the ‘backports’
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://de.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical’s
## ‘partner’ repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner

deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse

aptitude update
aptitude safe-upgrade

If there is any new kernel added, then execute update-grub after the installation.
Then add the entries fot the console to the menu.lst again.

Sorry, this is just a quick post with only a minimum of explanations, but i hope i am able to help somebody out there.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Tweets

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Advertisements
%d bloggers like this: