Installing Debian from Ubuntu Hard Disk Installation

Installing Debian From Ubuntu or any other GNU/Linux

This post is about how to install Debian GNU Linux from your hard disk, with the help of your Ubuntu GNU Linux operating system and without using CDrom, floppy, or any other removable media.

I learned that when I was trying to install Debian and had no other way to run the installation media. My DVDrom was broke, USB boot didn’t work and I had no other computer to run a network install. My only option was to install Debian from Ubuntu. This installation method is called hard disk install.

Instructions to perform a hard disk install are available on the official Debian Installer Manual (Debian Installer Manual’s instructions are not Ubuntu specific but it does not matter). I would just try to make it a little more simpler. Please note that there are many other ways to do this, it will be a good idea to review other methods before trying this one.

Important: Please backup all your data before trying this method.

In this example we are trying to install Debian 7 aka Wheezy also known as Debian 7 on amd64 architecture. If you want to install a different architecture, like i386 then you need to browse the same debian repository to find these files for i386. Also note, that even though we are installing Debian Wheezy, which is the current stable release, you can install debian testing or even Debian Lenny (previous version of Debian) using the same method.

So for Debian Wheezy on 64bit computers (most modern notebooks and desktop computers are 64bit. If your machine has multi core processor then it is 64bit, if you are unsure then try i386), You need to download:

The first two files will load the debian installer, and the third file is a CD image or installation media which will install rest of the packages during the installation. Place these three files in /boot/newinstall directory.

Preparing Boot Loader – Grub2

If you are installing from Ubuntu 9.10 or later versions, then you have Grub 2 installed as the default boot loader. Edit grub.cfg file located in /boot/grub/. In grub.cfg file you will find a menuentry for your current linux distro. below this entry you will find a line set root=(hd0,msdos1) or something similar. You need to have that line in the menu entry you are going to paste for new install. Lets add a new menu entry to grub to boot Debian installer from it.


menuentry 'New Install' {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
linux /boot/newinstall/vmlinuz
initrd /boot/newinstall/initrd.gz
}

Preparing Boot Loader – Grub1 or Grub Legacy

Now If you have Grub1 installed on your other operating system then open Grub menu.lst located at /boot/grub/menu.lst with your favorite text editor.

Scroll down until you see something like this:


title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=3599efe8-de32-4c9f-aed1-33c1c61d4bdf ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

Note the root (hd0,6) line this is the partition where your Ubuntu is installed. It could be different for you depending your partition location. And now, we are going to boot Debian Installer from here. Add the following lines to your Grub menu.lst file.

title New Install
kernel (hd0,6)/boot/newinstall/vmlinuz
initrd (hd0,6)/boot/newinstall/initrd.gz

Now save the file and reboot your computer and you will see Grub showing you “New Install” as an option in the menu. Select it to boot Debian Installer and install it.

There is a similar way to install Ubuntu from a GNU/Linux based operating system. You can also Install Ubuntu, Debian and many other Linux distributions from Windows or anyother operating system by using UNetbootin. To be very honest, I am kind of surprised to find out so many ways to install free open source operating systems on my computer.

Published by Noumaan Yaqoob

I am a full-time WordPress blogger, I write tutorials about using WordPress, WordPress themes and plugins. Need help with your website? Feel free to contact me.

Comments

  1. Hi,
    Thanks for the post. I’m going to install Debian 8 from ubuntu 14.04. It seems that the file “boot.img.gz” is needed in order to boot correctly (without cd-rom detection). So, you need vmlinuz, initrd.gz, boot.img.gz and the iso file.
    Bye,
    Sponch

  2. hello!
    Thanks for your post,
    i have try, for information, i’m using ubuntu 14.04 with 640gb, using lvm for partitioning. i want install debian from ubuntu with this trick, boot to iso sucsess after i change “set root=’to my vg id” but problem show up after scanning iso installer, he says installer not detected. I’ve try to shell and cannt mount the lvm partition.
    what should i do?

    Thanks in advance

  3. Note: if you get an error along the lines of “could not read file. you must load the kernel first.

    Remove the /boot/ from the path in the two lines:
    linux /boot/newinstall/vmlinuz
    initrd /boot/newinstall/initrd.gz

    Change to:
    linux /newinstall/vmlinuz
    initrd /newinstall/initrd.gz

  4. How can I determine the partition location. I tried using Gparted to find out the partition location but it does not give me the detail. Ubuntu on my computer currently loads from (hd0,1) but it does not seem to work.

  5. […]  http://ubuntu.sabza.org/2008/03/24/installing-debian-from-ubuntu Tags: Debian, disco fisso, installazione, rimovibili, supporti, Ubuntu […]

  6. […] invez de reproduzir tdo o artigo, vou so dar o link […]

Leave a Reply

Your email address will not be published. Required fields are marked *