HOWTO: Debian netinstall

Forum rules
Share your brain ;)
pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

HOWTO: Debian netinstall

Unread post by pidsley » Sat Aug 03, 2013 10:29 pm

Is there anyone here who has not done a Debian netinstall? If you haven't tried it, I think you should, if only to see how easy it really is, and to have the opportunity to select just exactly what you really need in your custom install. You will also see the dependencies for everything you install, and you may be surprised (and shocked) by how much crap your icon theme or terminal emulator really pulls in.

I should also just say here that I do not mean in any way to say that mb has not done excellent work with the bbq spins -- I only want to present another learning opportunity to those of us how do this as a hobby and/or like to try new things.

Please don't do this on a production machine, on your girlfriend's machine, or anywhere you can't bork. Breaking a netinstall is not bad -- it will teach you lots of things just installing a pre-built spin will not, but you don't want to break your main install today.

Getting started

Download the "mini iso" from here for 32-bit or here for 64-bit. Copy it to a USB stick or CD as usual.

Prepare a partition on a test machine; you will only need a single root partition of around 6G max, unless you plan to really pimp it out with a bunch of bloat (and if that's your plan, stop reading now and go install a pre-made bbq spin). Also create a swap partition if you want to use one and there is not one on the disk already.

Netinstall!

Boot the USB or CD, and select "Advanced options" then "Expert install" -- there are a lot of steps, but most of them should be intiuitive, if not obvious. For most of the first few screens you can simply accept the defaults -- Choose language (accept the defaults if you want English) do not select any additional locales unless you know you need them, Configure the keyboard (accept the default again unless you know what you are doing) Detect network hardware, Auto configure networking (again the defaults should be fine on a wired machine), enter your hostname, accept the default domain name, http protocol for the mirror, select your country, accept the default mirror, leave the proxy blank unless you know you need to enter something.

"Debian version to install" select "sid" then let the installer download installer components. Do not select any additional installer components to load, just "Continue" and let the installer load what it needs.

"Set up users and passwords" -- Yes enable shadow passwords. Do not allow login as root (you will install a user with sudo privileges and can enable the root account later -- this is easier than allowing root login and adding a user later). Enter your user name and username for your account, then enter your new user's password.

"Configure the clock" -- set the clock using ntp, accept the default ntp server, and select your time zone.

"Detect disks" -- allow the installer to detect your hardware. "Partition disks" select "Manual" -- select the partition where you want to install, then "use as" select ext4, "format the partition" select "yes", "mount point" select "/ - the root file system". Select "Done setting up the partition" Here you can select other partitions for boot and home if you like, but it's simpler to just use one partition for everything.

In the right column of the screen you should now see which partitions will be used for root (and swap, if you have one). Select "Finish partitioning and write changes to disk". Make sure the partitions are set up the way you want them on the next screen (if you made a mistake you can go back and fix it) and then "Yes" for "Write changes to disk".

"Install the base system" -- let the installer do its work. It's downloading everything from the mirror, so it will take a while. At some point you will be asked which kernel you want. On a 32-bit box, select "linux-image-686-pae"; on 64-bit select "linux-image-amd64" (if you have a machine that requires a 486 kernel select "linux-image-486").

"Drivers to include in the initrd" -- select "targeted..."

"Configure the package manager" -- "use non-free software 'yes'" unless you are rms. If you say "no" here you can always enable it later.

"Select and install software" -- the installer does some preconfiguration, then you decide whether to participate in the usage survey.

"Choose software to install" -- use the arrow and space keys to unselect everything except "Standard system utilities" -- this is important -- you can install everything else later. The installer will go do its work. Again it is pulling things from the mirror, so be patient. This takes a little longer than installing the base system.

"Install the GRUB bootloader on a hard disk" -- do this if your netinstall is the only thing on the disk, or if you want your netinstall to control GRUB. Tell the installer where it should install GRUB. You can skip this step if you have another install already controlling GRUB (you will need to update-grub there later) -- if this is the case, select "Continue without bootloader".

"Finish the installation" -- almost done! -- "Yes" the system clock is set to UTC (it is, right?) -- "Installation complete" !!

Your machine should now reboot, either into GRUB for your netinstall, or GRUB for your other install if you did not install GRUB during the netinstall. Run "sudo update-grub" in your other install to find the new install, and reboot. You will boot to a console login -- login as the user you created, and enable the root account with "sudo passwd root".

Next step (maybe tomorrow) we will install some handy console tools, X (with a terminal emulator and a window manager), systemd, and some siduction and bbq sources. (see this post).

Screenshot or it didn't happen :)

Image

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: HOWTO: Debian netinstall with some bbq sauce

Unread post by wuxmedia » Sun Aug 04, 2013 9:51 am

nice howto pids
I might have to do a better install, i think i just hit 'install' seemed to bring in most of what i needed for a server.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
bones
Clooney
Posts: 2385
Joined: Fri Jun 28, 2013 11:47 pm
Location: Cascadia

Re: HOWTO: Debian netinstall with some bbq sauce

Unread post by bones » Sun Aug 04, 2013 3:12 pm

Nice HOWTO, pids. I've only ever done full DE installs via Debian netinstall, usually Xfce or LXDE, but I've also done Gnome and KDE, in my bloat-loving days. I really need to do it up starting with no X, and build my perfect system.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: HOWTO: Debian netinstall with some bbq sauce

Unread post by DebianJoe » Sun Aug 04, 2013 4:14 pm

*DJ's Stamp of Approval*

I think we've previously discussed the difference in methods, but Pidsley's system is probably the quickest way to get a minimal Sid. I normally build stable, change repos and then dist-upgrade...which is a little longer. I've yet to use this method, but I've been keeping it on the back-burner should I ever need to reinstall. Thanks for sharing.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: HOWTO: Debian netinstall with some bbq sauce

Unread post by dkeg » Sun Aug 04, 2013 10:37 pm

Thanks pids, and very well written. Nice rainy day project.

Work hard; Complain less

User avatar
MrPink
applies for custom title
Posts: 49
Joined: Tue Jan 22, 2013 10:38 pm

Re: HOWTO: Debian netinstall with some bbq sauce

Unread post by MrPink » Mon Aug 05, 2013 9:36 am

Nice. Looking forward to the rest. I usually also choose "laptop utilities" during install. AFAIK it doesn't pull anything I would not have chosen for my laptop afterwards.

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: HOWTO: Debian netinstall

Unread post by pidsley » Mon Aug 05, 2013 9:15 pm

I have decided that there are enough guides for what to do next with a netinstall (DJ and bacon have both written at least one) and that most people here probably know what to do next anyway. If someone else wants to pick this up and expand on it, please feel free. Otherwise, I'm done.

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: HOWTO: Debian netinstall

Unread post by Sector11 » Thu Aug 22, 2013 9:49 pm

Please don't do this on a production machine, on your girlfriend's machine, or anywhere you can't bork. Breaking a netinstall is not bad -- it will teach you lots of things just installing a pre-built spin will not, but you don't want to break your main install today.
Only one computer here, two of us use it. I did this once, 15 months ago ...
let me make that clear, I used the Debian Net Installer ... but not this HowTo

As I recall it, the installer part (selecting partitions to use) isn't any different that other debian installers ... soooo why would doing this be different than installing another spin/distro?
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: HOWTO: Debian netinstall

Unread post by wuxmedia » Thu Aug 22, 2013 10:10 pm

expert install, probably.
hitting 'install' walks you through it (as i did), pidsley did it from a very base stance (and changes to sid right away), respect.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: HOWTO: Debian netinstall

Unread post by DebianJoe » Thu Aug 22, 2013 10:13 pm

The largest reason to take the expert-mode netinstall method is that it's the easiest way to get only the packages that the user wants. It puts control directly in the hands of who's doing the install.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: HOWTO: Debian netinstall

Unread post by Sector11 » Fri Aug 23, 2013 12:14 am

OK I don't think I worded that right ... I too used the "Expert Install".

I was wondering about the part that this is more dangerous that a regular distro Live CD install.

If I recall, it still uses gparted to select partitions and installs Grub in the same manner as a Live*.
Just a thought.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: HOWTO: Debian netinstall

Unread post by GekkoP » Wed Sep 04, 2013 6:17 pm

Damn, I should've read this how-to before doing it all by myself. I mean, it's working and I'm happy, but I chose "generic" instead of "targeted" at "Drivers to include in the initrd". I must say it, I was scared.

User avatar
johnraff
Sperminator
Posts: 199
Joined: Wed Oct 17, 2012 6:38 pm
Location: Japan
Contact:

Re: HOWTO: Debian netinstall

Unread post by johnraff » Wed Sep 04, 2013 6:48 pm

@pidsley that's very nice and clear - thank you. A good post to link to in the future. (That would be OK right?)

btw what does that "targeted" driver option do?
All code is one.

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: HOWTO: Debian netinstall

Unread post by pidsley » Wed Sep 04, 2013 8:51 pm

johnraff wrote:btw what does that "targeted" driver option do?
Short answer: it causes the installer to build an initrd (actually an initramfs) that contains only the drivers it thinks you need.

Long answer: it causes the installer to create a file called "driver-policy" in the /etc/initramfs-tools/conf.d/ directory. This file contains the line "Modules=dep" and this overrides the normal "MODULES=most" line in /etc/initramfs-tools/initramfs.conf, causing the initrd to be built with only drivers the system is aware you need when the initrd is built. For example, an "untargeted" initrd contains drivers for almost all hard disk controllers, while the "targeted" initrd only contains the driver for the controller in the machine where the system was installed. Including only the necessary drivers reduces the size of the initrd considerably (from around 14M to around 3M on my machines), and can reduce the amount of time it takes to rebuild the initrd every time this is necessary (watch during your next dist-upgrade and see how many times the initramfs is updated). It can, however, cause problems if you later add something that depends on a driver being present in your initrd, or (for example) try to use the same hard disk install in another machine without rebuilding the initrd. I have always specified "targeted" in my several netinstalls, and I have never had a problem.

GekkoP, I believe you can rebuild your initrd with targeted drivers by adding the driver-policy file as described above and using update-initramfs to rebuild the initrd, but if the way you have it set up now is working, there's really no reason to change it.

More information in the Debian wiki: https://wiki.debian.org/Initrd
More about initrd: http://www.ibm.com/developerworks/linux ... /l-initrd/ and https://en.wikipedia.org/wiki/Initrd
How to examine the contents of your initrd: http://linuxpoison.blogspot.com/2010/03 ... image.html

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: HOWTO: Debian netinstall

Unread post by GekkoP » Wed Sep 04, 2013 9:30 pm

Thanks for this explanation.
I'll follow your advice and keep my system as it is since it is working very well. To be honest, it's not doing very much: print server, ps3 media server, vino and transmission are the only things I use it for at the moment. But I'll pay attention to this "targeted" detail next time I do a netinstall and keep in mind to give it a try.

User avatar
johnraff
Sperminator
Posts: 199
Joined: Wed Oct 17, 2012 6:38 pm
Location: Japan
Contact:

Re: HOWTO: Debian netinstall

Unread post by johnraff » Thu Sep 05, 2013 6:06 am

Thanks pidsley.
pidsley wrote:Including only the necessary drivers reduces the size of the initrd considerably (from around 14M to around 3M on my machines), and can reduce the amount of time it takes to rebuild the initrd every time this is necessary (watch during your next dist-upgrade and see how many times the initramfs is updated).
Yes, I've tapped many an impatient finger waiting for initramfs to be rebuilt.
All code is one.

User avatar
gurtid
Uninstaller
Posts: 239
Joined: Thu Oct 18, 2012 7:53 am

Re: HOWTO: Debian netinstall

Unread post by gurtid » Sun Sep 08, 2013 8:34 pm

Does using 'targeted' on install, or implementing it post install, result in any noticeable performance gains? i.e. boot speed, memory footprint . . .

I would try this myself but no access to Linux for a day or two.
If I understand correctly:

if I add a line

Code: Select all

Modules=dep
in file

Code: Select all

/etc/initramfs-tools/conf.d/driver-policy
. . . and then rebuild initramfs, that should be all that's required?
^ [EDIT] . . . nvm - I read the docs pidsley quoted. Yes, that is all that is required.
The Beaver Destroys Forests

User avatar
gurtid
Uninstaller
Posts: 239
Joined: Thu Oct 18, 2012 7:53 am

Re: HOWTO: Debian netinstall

Unread post by gurtid » Mon Sep 09, 2013 9:05 am

TESTING COMPLETED

Pre update-initramfs

initrd is 13.0MB.

I shutdown and restarted the pc 5 times to get some averages.

Average Memory use ~84Mb (Conky)
Average boot time ~13.5 seconds (systemd-analyze)

Post update-initramfs

initrd is 8.4MB

Shutdown and restart * 5

Average Memory use ~84Mb (Conky)
Average boot time ~11.4 seconds (systemd-analyze)

RESULTS:

over 2 seconds shaved off kernel time

CONCLUSION:

Worthwhile? Yes! :)
The Beaver Destroys Forests

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: HOWTO: Debian netinstall

Unread post by GekkoP » Mon Sep 09, 2013 9:51 am

Nice. I'll try that too. To be honest boot on my machine is pretty fast right now, but since it is a quick fix I'm going to check out whether there is a difference or not.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: HOWTO: Debian netinstall

Unread post by machinebacon » Mon Sep 09, 2013 1:11 pm

@gurtid: the real advantage is, as pid pointed out, when you run upgrades and the ramdisk is updated. as for the 2 seconds shaved off on boot: lol :) obviously time for a ssd :D
..gnutella..

Post Reply