Install Debian Lenny via network

A few days back I have got a laptop from one of my friend. Since I don’t have another pc other than my desktop my plan was to use this laptop for doing experiments. So I decided to install Debian GNU/Linux Lenny to test LTSP5. But the optical drive of lap was not working. My friend told me that he transferred the data from the lap by connecting lap HDD to another pc using the external USB HDD adapter. But he doesn’t have that at that time. So the only option for me to install Debian is via LAN. For that the lap has to be booted from a pen drive.
So my first experiment was on how to boot a pen drive. The steps are given in the following tutorial. http://hackingwithdebian.blogspot.com/2009/01/triple-booting-from-pen-drive.html

I could boot the lap using the bootable pen drive. The distro used for usb booting was Debian Lenny Live. After booting. I created a partition in one of the harddisk in the lap and formatted it with ext3. The next step was to mount that partiton. So I mounted that in /mnt.

To install Debian inside that partition we need the tool “debootstrap“.
But it was absent in my Lenny Live. So I decided to install it via the network. I gave an IP to the lap and another to the desktop. Then I installed Apache2 on my desktop pc. Then I created a directory named repo inside the document directory of apache (/var/www/repo). I mounted the first DVD of Lenny on /var/www/repo.

Next I added the following line to /etc/apt/sources.list of Lenny live running on laptop.

deb http://192.168.0.1/repo lenny main

where 192.168.0.1 is the ip of my desktop pc.

Then run the command apt-get update and apt-get install debootstrap.

So the lap is ready for the installation of Debian Lenny. Open terminal. Change directory to /mnt. Then run the command,

debootstrap lenny . http://192.168.0.1/repo

It will install the base system. Next is to install xserver gnome etc.
First of all mount /proc and /dev in the chroot environment

mount -o bind /dev /mnt/dev

mount -o bind /proc /mnt/proc

Then chroot into base system. chroot /mnt
then create a password for the root user using the command “passwd

Installed the necessary applications.

apt-get install gdm gnome xserver-xorg iceweasel

Finally install the grub.

grub-install /dev/sda1 –root-directory=/ –no-floppy

Finally exit from the chroot environment. (press ctrl d to exit)

umount /mnt/dev
umount /mnt/proc
umount /mnt

sync
reboot

Remove pen drive.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • FriendFeed
  • FSDaily
  • Identi.ca
  • LinkedIn
  • RSS
  • StumbleUpon
  • Technorati
  • Twitter
  • Yahoo! Bookmarks

Related posts:

  1. How to upgrade Debian Etch / IT@School GNU/Linux to Lenny
  2. Triple booting from pen drive
  3. Grub 2 in Debian Etch
Sep 12th, 2009 | Posted in Tutorial
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>