[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debootstrap as an valuable instructioanal experience



On 2/20/15, Richard Owlett <rowlett@cloud85.net> wrote:
> Several months ago, when I was having problems with a very
> customized install, I was pointed to debootstrap as an
> appropriate tool. I finding that it will evidently give me not
> only the fine control and minimal footprint desired, but it leads
> me to explore areas of Debian that I know less about than I thought.
>
> My question -- Does anyone know of a detailed (newbie oriented)
> writeup on using debootstrap to install a bootable Debian to a
> second partition of a drive already containing a complete default
> install? All the writeups I've found assume various levels of
> experience and leave out things that "everybody knows".
> Fortunately the leave out different things so I think I am
> getting a reasonably complete overview.
>
> Comments? TIA


Well, I'm off to a good start. Just about ready to hit Send and
something glitched on my keyboard, CTRL key stuck or something, and I
was sent back to an empty email.

So. I'm going to take this route. We could address each section of the
how-to that I used. First I'm going to highlight this page because it
keeps understandably pulling up top of the list if one searches the
Net for Debian Debootstrap:

https://wiki.debian.org/Debootstrap

That is NOT what I used. THAT is making my head whoozy right now. BUT
I can see where they're going with it.

THIS PAGE and/or one of its clones is what I've used for Wheezy,
Jessie, and Sid:

https://www.debian.org/releases/stable/amd64/apds03.html.en

I THINK the 2nd version I keep mentioning having seen might be
something like the page named for Lenny. So I'm just going to skip
looking for that 2nd set of instructions and go with that apds03 page
above there...

The first section, D.3.1. Getting Started, I just use Gparted to
accomplish up through where it says "# swapon /dev/hda5". And that
reminded me why I keep feeling I needed to find that unrelated "neat"
page. It was because of the idea of CHOICE in our software packages:

https://packages.debian.org/testing/admin/

Searching on the word "partition" on that page shows several options
there if someone's not into Gparted and doesn't know where to start
looking. Our package managers can also help with that search. I use
the following for this type of thing:

# apt-cache search partition

If someone needs to go the command line route that is featured on the
how-to page, we can go back and walk through it until it functions
correctly for whomever might go that route. I just haven't tried it
and don't have a way to test it before talking it up this very second.

A place this already gets sticky and starts splitting us all off into
different directions is... what file system do we use. Even there in
that first section, they imply several different ones would work. I
happen to use ext4, but I've read at least once that's not ideal.
Might have been something about not being fully supported everywhere,
maybe.

There's ext2 and ext3 that are similar and that are mentioned
specifically there in the how-to. Maybe someone has insight why they
choose what they choose in similar instances.

By the way, that's only for hard drives, too.. USB thumbdrives/sticks,
I've several times seen reference to FAT for those so... there you go.
You have to decide what it's installing on and find the consensus on
the best file system for it.

So here we are, still in that first section. One more thing needs
done. The target partition needs mounted. I still have some trouble
wrapping my head around this part, but it's easy enough to do. You
create a directory that stands out to you, and that's what you mount
your target partition to. For me lately, I do something similar to:

# mkdir /mnt/cin
# mount /dev/sda3 /mnt/cin

That's empty at first so that's the only "mount" that you do just then
(in case you're thinking, "Don't we also need to mount
yada-yada.....?").

You can debootstrap into just any old directory you create. I THOUGHT
I was mounting and chroot'ing into those subdirectories afterward,
even performing actions there, too, but am not quite confirming that
within my notes. Just saying that because it's something that can be
looked back into again if it's needed. Right now, though, I'm getting
a "not a block device" error when I attempt to do what I'm sure I've
done in the past..

The next section, "D.3.2. Install debootstrap" lists the most manual
way of installing debootstrap. For many of us, all those lines that
make up that step are replaced by using a couple quick keystrokes
within our favorite package managers (e.g. apt, aptitude, synaptic,
etc) to install debootstrap.

If someone has a need to go the longer manual route, their steps there
seem pretty straight forward. We can definitely walk through them one
by one if need be.

Now the next section (and last I'll do tonight), "D.3.3. Run debootstrap".

You need to pick your mirror, the software package repository you're
going to pull from:

http://www.debian.org/mirror/list

They list the following architectures: amd64, armel, armhf, i386,
ia64, mips, mipsel, powerpc, s390, s390x, and sparc. We pick the one
of those that is the architecture the completed install will
eventually run from. That then replaces the word "ARCH" in the
following:

# /usr/sbin/debootstrap --arch ARCH wheezy \
     /mnt/debinst http://ftp.us.debian.org/debian

"/mnt/debinst" is the target mounted directory. In my case, it's
usually something like "/mnt/cin" or "/mnt/abc".

"wheezy" is replaced by whatever release you want to download/install.
The last time I did this, my command looked like this:

debootstrap --arch amd64 sid /mnt/cin ftp://ftp.us.debian.org/debian

That is the command that starts the debootstrap. It will look like it
hangs for a while sometimes before it really gets going. It's just
busy downloading what becomes something like a 30+ MB sized file
related to the list of most current software packages available. I
THINK that hang time is debootstrap's version of when we do something
like "apt-get update" before we look into upgrading our systems.

The how-to also talks about using an appropriate CD in place of a
repository out on the Net. My kneejerk originally was WHY debootstrap
if you already have a CD in hand? Rational thought immediately after
is it's because it's about being in control and being as bare bones as
one wants, CD or no CD. THAT is "why".

So if you went that route and had a CD mounted at /cdrom, they suggest:

# /usr/sbin/debootstrap --arch ARCH wheezy \
     /mnt/debinst file:/cdrom/debian/

or similar that provides the correct full path to the CD.

If that all has been done just right, that pulls the very basic of
base files onto our computer. I'm going to stop with that. That was
just to get started, and it took that much to explain. AND there are a
few holes still left in there. We just have to keep helping each other
fill in those holes.

Of all the things about Debian, this one right here, debootstrap,
became the great equalizer for me. I imagine it doing phenomenal
things to help introduce Debian to people who never dreamed it was
possible to remain developer level current while at poverty level and
with no high speed Internet at their Fingertips.. :)

Keep warm out there.. :)

Cindy :)

-- 
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with plastic sporks *


Reply to: