Skip to content


How to install Ubuntu Lucid to hard drive Part 1

Firewall is one of the most important thing that you should have it although your business is a cyber cafe, internet cafe or gaming center. Because running a firewall system meant to protect your interest and your investment, also your business reputation is depending on it.

So I want to install Ubuntu Linux for my other system without using a cdrom, but I dont want to do it on that system, instead of that I want to install it via my current working ubuntu desktop that Im using right now.

Actually I want to build a firewall system complate with hotspot gateway and freeradius. But for now lets start with the basic installation first.

You could follow the instruction from ubuntu help community by Curtis Lee BolinInstallation From Linux or you can continue to read it from here because I made a little modification for the installation method and I add the instruction for the post-installation and how to setup a firewall base system.

How to install without CD

You can install Ubuntu directly from Ubuntu using debootstrap. Debootstrap installs some essential packages in a directory for use with chroot. Note that the essential packages does not in itself make the system bootable. It just installs what you need to chroot to that directory and use apt-get to install other packages witch makes ubuntu usable.

Step 1. First turn off you computer and plugin your hard drive to it, after turn it on back then check that you have debootstrap installed if not, then you should run the following command below:

# sudo apt-get install debootstrap

(NOTE: if you want to install a newer release than your current system, you normally need to install the backported debootstrap version, see: UbuntuBackports)

Step 2. Partition device and make a file-system, to make it more easy, I use cfdisk to create partition for the other drive.

We will assume /dev/sdb is the storage device for your fresh install. I use my thumbdrive to show you an example how to partition the other drive for another system to setup an installation of ubuntu linux from your current ubuntu desktop.

Remove former partitions and create the new on.

# sudo cfdisk /dev/sdb

cfdisk (util-linux-ng 2.17.2)

Disk Drive: /dev/sdb
Size: 2056257536 bytes, 2056 MB
Heads: 64   Sectors per Track: 62   Cylinders: 1012

Name        Flags      Part Type  FS Type          [Label]        Size (MB)
——————————————————————————
sdb1        Boot        Primary   W95 FAT32 (LBA)                   2056.00

[ Bootable ]  [  Delete  ]  [   Help   ]  [ Maximize ]  [  Print   ]
[   Quit   ]  [   Type   ]  [  Units   ]  [  Write   ]

Use your arrow key to the [ Delete ] option to remove your partition on the other drive:

Name        Flags      Part Type  FS Type          [Label]        Size (MB)
——————————————————————————
Pri/Log   Free Space                        2056.00

[   Help   ]  [   New    ]  [  Print   ]  [   Quit   ]  [  Units   ]
[  Write   ]

Create new partition from free space, then you will see your drive is empty, now select [ New ] to create your new partition and select [ Primary ] :

Name        Flags      Part Type  FS Type          [Label]        Size (MB)
——————————————————————————
Pri/Log   Free Space                        2056.00

Size (in MB): 1500

You need to enter new size limit for primary partition, press backspace then enter the size yo want, for example I use 1500MB and 500MB++ for the extended and swap partition.

Now create the rest of your free space as an extended and swap, to change type of your newly created partition navigate to [ Type ] press Enter and select 83 for linux and 82 for swap.

Name        Flags      Part Type  FS Type          [Label]        Size (MB)
——————————————————————————
sdb1        Boot        Primary   Linux                             1499.34
sdb5                    Logical   Linux swap / Solaris               556.67

and select your primary partition as bootable by press the option [ Bootable ]. The write down your partition and quite cfdisk.

Are you sure you want to write the partition table to disk? (yes or no): yes

then [ Quit ] and start to make the file-system

# sudo mkfs.ext4 /dev/sdb1

Step 3. Mount that new partition.

# sudo mkdir /mnt
# sudo mount /dev/sdb1 /mnt

Step 4. Create the new install.

# sudo debootstrap lucid /mnt

Step 5. Copy files to the new install to keep your repositories

# sudo cp /etc/apt/sources.list /mnt/etc/apt/

Step 6. Chroot to your new install.

# sudo mount –bind /dev /mnt/dev
# sudo mount -t proc /proc /mnt/proc
# sudo chroot /mnt /bin/bash

Step 7. Upgrade the new install.

# apt-get update
# apt-get install language-pack-en-base

Note: I install the language-pack-en-base before upgrade to avoid perl warnings as shown below.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.utf8″
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

then continue with :

# apt-get upgrade

Step 8. Install Grub and Linux Kernel.

# apt-get install grub-pc linux-image

Step 9. set root password.

To set a root password.

(NOTE: You must at least set a root password if you aren’t adding a user)

# passwd

It should now be safe to reboot, you may want the next few things.

Step 10. If you want to access it with ssh after reboot.

Use vi or install nano to edit /etc/hostname.

Remove anytext in this file and add the hostname you would like.

# vi /etc/hostname

yourhostnameyouwant

and then edit /etc/network/interfaces

# vi /etc/network/interfaces

Add this lines to /etc/network/interfaces. This will start eth0 at boot and request an ip with dhclient.

auto eth0
iface eth0 inet dhcp

Next you need to install ssh

# apt-get install ssh

Turn off your computer, remove the new installation drive and plugin to the other system, and bootup the system. If you want the Ubuntu Gnome desktop, continue with Step 11, but if you want to setup a firewall base system, so just skip the Step 11 and Step 12, so it safe for you turn off your system and boot the drive from other system.

Step 11. Install ubuntu-desktop.

# apt-get install ubuntu-desktop ubuntu-standard

Step 12. Reboot and keep those fingers crossed.

# sudo halt or sudo reboot

To be continue on Part 2

Posted in Cyber Cafe, Linux, Networking, Open Source, Tutorial.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Continuing the Discussion

  1. Data Recovery Software | Restore Hard Drive linked to this post on June 21, 2010

    [...] How to install Ubuntu Lucid to hard drive Part 1 | osscc [...]

You must be logged in to post a comment.



Free counter and web stats