SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-31 14:13:04

jelloir
#! CrunchBanger
From: Outside the garden wall
Registered: 2009-08-21
Posts: 210

Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

Not much of an intro here.  Since Wheezy the business card installer appears to be gone.

So this is how to "sidtrap" a fresh install.  Couldn't let Arch users have all the fun smile

Grab a Debian based live CD.  I tested using the standard Squeeze live ISO and Ubuntu 12.04.  The latter being handy for users wanting a web browser to follow this guide plus wireless access.  #! should work as well but I did not test it.

The archicture of the Live CD should be the same as intended Sid install achitecture i.e. i686 or AMD64.

This guide reads better for advanced users but post your questions if your lost...  Also if their is anything you feel should be updated make a post about it.  I'll also try and format it a bit better, I just wanted to get it on the forum, then go to sleep.

Boot to your live cd configure an internet connection, open a terminal and su to to root however your live cd allows, e.g.

sudo su
Partitioning

create partitons on your disk.  This is my setup so adjust for yourself.  If you are new or interested about LVM then have a read of el koraco's LVM guide, reserving some disk space is a generally a good idea.

fdisk /dev/sda

Primary partiton 512M, type = Linux
Remaining disk space as Primary partition, type = LVM

Install LVM (only required if you actually use LVM).

apt-get install lvm2

Load the device mapper module.

modprobe dm-mod

Format what will be the /boot partition.

mkfs.ext4 /dev/sda1

Create a Physical Volume.

pvcreate /dev/sda2

Create Volume Group and logical Volumes.  I create random names for my volume groups assigned to a variable.

VG=vg$(tr -cd a-zA-Z0-9 < /dev/urandom | head -c 6)
vgcreate $VG /dev/sda2
lvcreate -n root -L 8G $VG
lvcreate -n log -L 2G $VG
lvcreate -C y -n swap -L 4G $VG
lvcreate -n tmp -L 2G $VG
lvcreate -n home -l +100%FREE $VG
lvremove $VG/tmp

Format and mount the partitions

mkfs.ext4 /dev/mapper/$VG-root
mkfs.ext4 /dev/mapper/$VG-log
mkfs.ext4 /dev/mapper/$VG-home
mkswap /dev/mapper/$VG-swap
swapon /dev/mapper/$VG-swap
mount /dev/mapper/$VG-root /mnt
mkdir /mnt/boot
mkdir -p /mnt/var/log
mkdir /mnt/home
mount /dev/sda1 /mnt/boot
mount /dev/mapper/$VG-log /mnt/var/log
mount /dev/mapper/$VG-home /mnt/home
Bootstrap Sid

Install debootstrap

apt-get install debootstrap

Bootstrap a Sid install (update the URL using your closest mirror).

debootstrap sid /mnt http://mirror.internode.on.net/pub/debian

It will start downloading and installing, hopefully you will receive “Base system installed successfully" at the end. Pat yourself on the back!

Create an fstab

Create an fstab.  In my case I just needed to tail the last 4 lines of /etc/mtab and replace /mnt where nesessary.  Something like...

tail -n 4 /etc/mtab | sed -e 's/mnt//g' -e 's/\/\//\//g' > /mnt/etc/fstab

Otherwise just make it manually.

Manually create a swap entry e.g.

/dev/mapper/vgVSaG9E-swap none swap sw 0 0

Update the fsck order column in the fstab.  Afterwards mine looks like this:

/dev/mapper/vgVSaG9E-root / ext4 rw 0 1
/dev/sda1 /boot ext4 rw 0 2
/dev/mapper/vgVSaG9E-log /var/log ext4 rw 0 2
/dev/mapper/vgVSaG9E-home /home ext4 rw 0 2
/dev/mapper/vgVSaG9E-swap none swap sw 0 0

You could replace with UUID's by running blkid, up to you...

Setup Networking

Edit /mnt/etc/network/interfaces

allow-hotplug eth0
iface eth0 inet dhcp

Setup Hostname

echo sidbox.example.local > /mnt/etc/hostname
Configure The Install

Mount dev,proc and sys to /mnt

mount -o bind /proc /mnt/proc
mount -o bind /dev /mnt/dev
mount -t sysfs /sys /mnt/sys

Enter the sid install

chroot /mnt /bin/bash

Do an apt-get update and verify it works.

apt-get update

Install lvm (if your using it).

apt-get install lvm2

Setup locales

apt-get install locales

Edit /etc/locale.gen and uncomment your required locales, then run

locale-gen
export LANG=en_AU.UTF-8

(Adjust the LANG for yours obviously)

Set time zone and hw clock

dpkg-reconfigure tzdata
hwclock --systohc --utc

Install libnss-myhostname

apt-get install libnss-myhostname

install the kernel.

apt-get install linux-image-amd64

At this stage you might like to add contrib and non-free to your /etc/sources.list to install missing firmware e.g.

cat /etc/sources.list
deb http://mirror.internode.on.net/pub/debian sid main contrib non-free
apt-get install firmware-linux firmware-linux-nonfree
apt-get install apt-file
apt-file update
apt-file --package-only search /lib/firmware/ | xargs apt-get install -y
Install and configure grub
apt-get install grub2

Select your device from the debconf prompt and hit OK.  Watch for any errors and troubleshoot them else your install might not boot.

┌──────────────────────────┤ Configuring grub-pc ├───────────────────────────┐  
│ The grub-pc package is being upgraded. This menu allows you to select      │  
│ which devices you'd like grub-install to be automatically run for, if      │  
│ any.                                                                       │  
│                                                                            │  
│ Running grub-install automatically is recommended in most situations, to   │  
│ prevent the installed GRUB core image from getting out of sync with GRUB   │  
│ modules or grub.cfg.                                                       │  
│                                                                            │  
│ If you're unsure which drive is designated as boot drive by your BIOS, it  │  
│ is often a good idea to install GRUB to all of them.                       │  
│                                                                            │  
│ Note: it is possible to install GRUB to partition boot records as well,    │  
│ and some appropriate partitions are offered here. However, this forces     │  
│ GRUB to use the blocklist mechanism, which makes it less reliable, and     │  
│ therefore is not recommended.                                              │  
│                                                                            │  
│ GRUB install devices:                                                      │  
│                                                                            │  
│    [*] /dev/sda (250059 MB; ???)                                           │  
│    [ ] - /dev/sda1 (536 MB; /boot)                                         │  
│    [ ] /dev/dm-0 (8589 MB; vgVSaG9E-root)                                  │  
│                                                                            │  
│                                                                            │  
│                                   <Ok>                                     │  
│                                                                            │  
└────────────────────────────────────────────────────────────────────────────┘
System Customisation

Disable recommends (copy and paste this code block if you like)

cat > /etc/apt/apt.conf.d/10recommends <<EOF
APT "";
APT::Install-Recommends "false";
EOF

Install desired software - you could do a heap of customisation at this stage if you wanted.

apt-get update
apt-get install ssh less vim

You get the idea...

For ceni users (update the URL with a closer mirror).

echo 'deb http://ftp.spline.de/pub/aptosid/debian/ unstable main fix.main' \
> /etc/apt/sources.list.d/aptosid.list
apt-get update
apt-get --allow-unauthenticated install aptosid-archive-keyring
apt-get update
apt-get install ceni

Last but not least set the root password.

passwd root

You can also create a standard use account, setup sudo etc.

exit from the chroot

exit

then unmount /mnt/sys, /mnt/dev, /mnt/proc, /mnt/home, etc, etc

Reboot your live cd and boot to your new and slick sid system waiting for customisation smile  Configure ceni and off you go!

post boot procedures (to be completed - going to sleep now yawn)
update /etc/apt/sources.list

Last edited by jelloir (2012-11-05 04:44:20)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-10-31 19:52:50

machinebacon
#! unstable
From: PRC
Registered: 2009-07-02
Posts: 6,212
Website

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

Nice touch with the LVM, well done smile

Such a great post shouldn't go unnoticed!


Start Distrohopping here! -> Break your own... cool  VSIDO  cool LinuxCNC  kiss Frugalware <- It's all just a kernel.

Offline

#3 2012-10-31 21:55:41

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,644

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

This is the best debootstrap guide out there. Major props for using LVM as well. I wouldn't add the remaining free space to home, otherwise you're missing out on LVM's ability to make a million partitions, but this needs to be stickied and probably spread across the web.

Offline

#4 2012-10-31 21:58:56

rizzo
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,109

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

Fantastic guide smile

On a side note, the stable business card installer is here and gives you sid install options in advance mode http://www.debian.org/CD/netinst/#businesscard-stable

Offline

#5 2012-10-31 22:00:29

rizzo
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,109

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

machinebacon wrote:

Such a great post shouldn't go unnoticed!

I agree, I'll sticky it for a while smile

Offline

#6 2012-11-01 08:53:00

jelloir
#! CrunchBanger
From: Outside the garden wall
Registered: 2009-08-21
Posts: 210

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

Excellent... my first sticky, wait... what?  @el_koraco, I'll link to your LVM guide with a recommendation on reading that, your right about reserving space, I tend to focus around space reservations for snaphots.

Offline

#7 2012-11-17 13:22:39

tradetaxfree
#! CrunchBanger
Registered: 2011-03-05
Posts: 111

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

The Testing Business Card Installers are just a little hard to find - you need "mini.iso" from the netboot folder of the Debian Installer subdomain:

http://d-i.debian.org/daily-images/i386 … t/mini.iso
http://d-i.debian.org/daily-images/amd6 … t/mini.iso

Offline

#8 2012-12-12 17:31:53

nazuk
New Member
Registered: 2012-12-11
Posts: 3

Re: Sidstrap Guide - How to bootstrap Sid from most Debian Based live CD's

Great tutorial. Tried it and it works great. Thanks a bunch  smile

Last edited by nazuk (2012-12-12 17:32:07)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo