Installing Debian from another Distro using Debootstrap

I recently wanted to format a disk that I had, I wanted to put Debian, for a server and try things. The point was that I was really lazy to create a Bootable USB, then boot my computer and start installing everything.

And he also had other things to do. So I started the task of investigating how to install it from another Linux, as if it were virtualized. This is how I met Debootstrap.  And I will briefly explain how I did:

Installation.

This always depends on where the process is going to be done. I for example use Manjaro. So it would be something like:

yaourt -S debootstrap

Using Debian and similar, it would be.

sudo apt-get install debootstrap

It is also important to know what we are going to need Chroot.

Running

Now let's get to the point. !! The first thing we must doer is to define claRarely which disk and which partition of that disk we are going to use.

For example:

I have two discs:

First record:  sDA  It's divided in 4 partitions (sda1, sda2, sda3, sda4)

Second Disc: sdb  It is where I have my base system installed. That is Manjaro.

In this order of ideas. I chose the disk  SDA and the partition sda3

Now what I do is mount the partition.

I create the folder where I am going to mount the partition.

sudo mkdir /media/Debian

Now I mount the partition.

sudo mount /dev/sda3 /media/Debian

Install the base system

In this step then we proceed to install the base system of our Debian. For that we execute.

sudo debootstrap --arch i386 wheezy /media/Debian http://ftp.fr.debian.org/debian

–Arch: We choose the 32 or 64 bit architecture.

Wheezy:  Here we are choosing the Debian version.

/ media / Debian: Where we mount our partition.

Next we see how our base system begins to be installed.

Screenshot from 2013-08-16 14:07:05

This takes a few minutes depending on the bandwidth

When finished we will see this message and also we will see that indeed if the files were downloaded:

Screenshot from 2013-08-16 14:15:35

Screenshot from 2013-08-16 14:15:55

Setting up Debian.

Now what we have to do is "get into" the Debian. So we can execute orders as if we were in the debian We run the following on the console.

LANG=C.UTF-8 chroot /media/Debian /bin/bash

In this way we can execute orders from the console debian

Now what?

Let's install the kernel! .. For that, first we are going to edit the sources.list.

nano /etc/apt/sources.list

To generate bliss sources.list we can use the following Web design

And we update.!

apt-get update && sudo apt-get upgrade

So we look for a kernel that we like with:

aptitude search linux-image-

Then we will get a list of available kernels. In my case I installed the linux-image-3.2.0-4-686-pae

apt-get install linux-image-3.2.0-4-686-pae

In this sense we would already have Debian, but we are going to configure a little more.

Mounting Partitions.

Editing the / etc / fstab file

nano /etc/fstab

What we are going to put there depends on each computer. In my case I will only tell you that the root "/" is in sda3 (Where you install Debian)

It would be something like:

"/ Dev / sda3 / ext4 defaults 0 1"

And now we only ride with:

mount -a

Now we are going to customize the system a bit. With the following command we configure the time zone:

dpkg-reconfigure tzdata

We are going to install the ssh (I will handle it only by RED)

apt-get install ssh

We add users and change the password to ROOT

adduser usuarioprueba
passwd root

Now we just execute "exit" to stay in the natural system console and update the grub

sudo update-grub

Screenshot from 2013-08-16 15:03:07

From here on you can do any configuration that is already to your liking. How to install other services or a graphical environment.

I hope you like the post.!

Regards.!


12 comments, leave yours

Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   gonzalezmd (# Bik'it Bolom #) said

    Excellent work.

  2.   All said

    Whoa! how useful. I will do the test

  3.   Chaparral said

    Great!

  4.   eliotime3000 said

    Excellent. Debian From Scrarch for archers.

  5.   x11tete11x said

    there is a mistake

    1.    @Jlcmux said

      Lol I will never be able to with that word. I always… I ALWAYS misspell it. uu

      1.    x11tete11x said

        no problem, after one of the mods fixes it: v

        1.    Manual of the Source said

          Yes, sure, don't bother using spell checker, that's what we're for, to use it for you, hahaha. 😀

          Ok, that's it, and incidentally, I also sudoed the Yaourt command because it should never be used as root. 😛

  6.   cristian said

    Interesting and very practical.

  7.   sieg84 said

    interesting.

  8.   g919v3r said

    as always interesting ... usually I quickly forget almost everything I read and keep the central idea, but in this case, I can't get the 'fence' of the third paragraph out of my head, otherwise good job!

    1.    Manual of the Source said

      Hahaha, it's already corrected. 😀