Setting Up a Base Linux Install on a Laptop

 in
In part 2 of his series on Linux and the laptop, Jay discusses how to install and configure Sid.

In my previous article, I discussed the things one should consider when purchasing a laptop on which Linux will run. This time I would like discuss a few ways to get the laptop up and running with a base Linux install. Your first step is selecting a distribution. I have been using Debian for about five years now and have grown quite accustomed to it. As a result, much of this article tilts to the way Debian does things. The goal of this article is to get you up and running with Debian Sid and the 2.4.20 kernel.

The Splendor of Sid

Debian has a reputation for being difficult to install. Although this is not necessarily true, Debian's installer is a far cry from the fully automated installers of distributions such as Mandrake and Red Hat. However, there is a benefit to your extra labor: much more control of how the system is laid out, which packages are installed and which kernel features are enabled or disabled. This gives you the freedom to have a system completely tailored to your specific needs. Debian Sid (unstable) is my preferred flavor. At the time of this writing, Woody (stable) and Sarge (testing) also are available. I like Sid because it offers the latest software in binary form with the shortest release date turn-around. The largest advantage can be found with all the Debian flavors, the powerful apt-get system. Combine apt-get with Sid, and you can be sure your system will be up to date with all the leading edge (sometimes bleeding edge) applications for the Linux operating system.

Early Decisions

To get started, you're going to need a basic kernel to boot from and to start the install. Before you can boot any kernel, you need to decide from which medium you would like to boot. You have two main choices: CD-ROM or floppy disk. This assumes you have a high-speed internet connection; Sid is available only through download. I suggest using a CD-ROM where possible. It is faster than floppies, and you won't have to swap disks around. Compact disk images can be found here and floppy disk images can be found here This is where things can get a little confusing. Even though we are eventually going to have a Sid system, you must start with the Woody boot images. You have to trust me on this one. Make a Woody boot CD-ROM from the ISO image or the corresponding floppy disks from the six bin files.

Efforts are being made to try to provide an up-to-date CD-ROM that users may acquire through snail-mail, but these efforts are few and far between. This also defeats one of the major advantages of using an OS that is constantly updated; often, daily updates are applied to Sid. If you find a major bug with one of Sid's packages, you can be sure that a fix is soon to follow.

The Basic Install

Now you should have the CD or floppy disks ready, and your high speed Internet connection is aching to start downloading packages. If you're using a CD-ROM, you may have to change a setting in your laptop's BIOS to be able boot from it; the same goes for the floppy install. Either way, once the laptop boots a Debian image you will be presented with a boot prompt. Press Enter to begin the install or a different option to begin a rescue. The rescue feature is useful for recovering from a botched kernel install. As usual, if confusion abounds press F1 for help. An installation is what we need, so press Enter and fire up the blue text-based installer if booting from CD-ROM; if you're using floppies you'll be prompted for the next disk. The Debian installation is divided into steps. If you so choose, you may jump around between the steps. To simplify things I outline the basic order and syntax of the steps below.

  1. Configure the Keyboard

    This is the first step of any OS install; use QWERTY unless you know otherwise.

  2. Partition a Hard Disk

    This can be a hot issue amongst Linux/UNIX people. Here's my recommendation for how to partition a laptop or desktop, but not a server. HDA1 should be swap, and it's size should be twice the size of your memory. HDA2 should be root and take the remainder of the drive. In this step, use the cfdisk utility to set up the partitions. Key tips: don't forget to make your root partition bootable, don't forget to change your swap partition Type to swap and don't forget to write your changes to disk.

  3. Initialize and Activate a Swap Partition

    Select the partition you set the swap to in the previous step and verify your choice.

  4. Initialize a Linux Partition

    Select the partition you set as root and verify your choice. If you created more than one partition other then swap, repeat this step incrementally to enable each one.

  5. Install Kernel and Driver Modules

    Select the same media type that you booted from. This is where CD-ROM users advance much faster, because floppy disk users have to insert up to five floppies.

    If you are doing a PCMCIA device install, now is the time to use the alternate choice; go to Configure PCMCIA Support. If you are not doing a PCMCIA device install, continue with Configure Device Driver Modules.

    This is where you can specify what external modules the kernel loads at boot time. Depending on your NIC card, you may have to load a module for it. Don't fret about loading modules for devices you are not sure about. The installer lets you know promptly if it's unable to find your hardware.

  6. Configure the Network

    This is perhaps the most important step of them all. This option is available only if your kernel detected a networking device or if you loaded the appropriate module. Go through the menus and fill in your TCP/IP information.

    A trick I like to do before I start accessing any network network connections is to switch out of the installer by holding Alt+Ctrl+F2. This brings you into a fresh console session, from where you can try pinging an outside address. This is a good way to verify your TCP/IP settings prior to starting the Net-based install. This also is a convenient place to fix any TCP/IP problems you may find. From here you have access not only to config files, such as resolv.conf, but also to run commands, such as ifconfig. Once you are confident the network configuration is running properly, press Alt+Ctrl+F1 to continue with the install.

  7. Install the Base System

    Time to start using that high-speed internet connection. Select Network to begin a base Linux install from the latest stable packages at Debian.org. A progress bar indicates the download's progress.

  8. Make the System Bootable

    This step asks you where you would like to install LILO. Unless you have something special in mind, the default is the best option. If you had another OS in the laptop previously and did not completely remove all of its system records, you may be prompted to put your previous OS in a boot menu with Debian. This is pretty confusing, especially after you rewrote the Inode tables earlier in the install. When prompted for this choose Ignore.

  9. Make a Boot Floppy

    People installing from CD-ROM can ignore this step as they may not have a floppy drive with which to format a boot floppy. Floppy disk users may choose this option to put an emergency recovery copy of your kernel onto a floppy disk. I skip it because I can use the rescue floppy that I used to start the install in case of recovery.

  10. Reboot the System

    Nothing to say here. You're better off if you do what the man says.

    At this point the system restarts with the freshly installed 2.2.20 kernel. After the reboot is complete, it fires up your favorite blue text-based installer. First you are asked some questions pertaining to the date and time zone and then some security questions. If you're not sure what to answer, go with the defaults. Finally, it asks some basic password and user creation questions and then goes back to the topic-based install process.

  11. Shall I Remove PCMCIA Packages?

    If you are not using any PCMCIA devices, remove these packages. Its easy to add them later if you need them.

  12. Do You Want to Use a PPP Connection to Install the System?

    It is not out of the question to do a full Linux install over a 56k modem. Personally I don't have the patience, and I know many other people feel the same. If you don't plan to, say No.

  13. Choose a Method apt Should Use to Access the Debian Archive

    This is where things get tricky. If you were setting up a Woody system, now would be the time when you would configure your apt sources and run tasksel. But because we're setting up a Sid system, this is the point when we start changing things. When asked this question, select Cancel. Then you are asked to run tasksel or dselect; choose No. This halts the install. You then are asked a couple of package configuration questions and then dropped to a login prompt.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Swap size

Anonymous's picture

For a laptop with more than 256MB of RAM, don't make a swap partition at all. Swap activity prevents your disk from spinning down, and uses more juice from the batteries. (OTOH, swapping out some big program that you're not using right then could let the kernel cache more data, maybe preventing some disk accesses from what you're doing.) If you ever need a ton of virtual memory, dd if=/dev/zero of=/var/tmp/swap bs=1024k count=n; mkswap /var/tmp/swap;swapon /var/tmp/swap.

To let your HD spin down more, mount your filesystems with noatime. Then the kernel won't update the atime in the inodes of files you read. This means reading files can result in _no_ disk accesses if they were in the cache.

On a modern desktop, you don't need swap=2xRAM. That's just dumb when you have 512MB or 1GB of RAM. Why would you commit 2GB of disk space to swap, permanently? 64MB or 128MB is a good size for a desktop swap partition. That puts a limit on how much the kernel can swap out, so it won't take forever to swap it all back in when you come back to your X session after samba took up all the RAM with disk cache. If you use tmpfs for /tmp, you might well want 256MB of swap, but even 64MB should be enough for tmpfs if you don't put huge files there. (put them in /var/tmp instead, or something like that.) Again, if you need a ton of VM for something, make a swap file. That's slightly slower, but much more flexible than a swap partition.

re:Setting Up a Base Linux Install on a Laptop

Wichser Starr's picture

I'm not sure it's superior knowledge, just common sense. Imagine how difficult
consumer items we take for granted (cars, appliances, consumer electronics)
would be to use if they only came in kit form. I currently have an unassembled
desk and chest of drawers laying in boxes because it takes a while to read
through the instructions to figure out how to assemble properly.

I do routine maintenance on my car. However when the timing belt broke, I
had it towed in and had a mechanic replace it. Could I have done it myself?
probably. Would it have been fun or time effective? Probably not.

re:Setting Up a Base Linux Install on a Laptop

Ficken Blasen's picture

-Since it isn't always possible to get an expert, could the experts
-maybee put together both a gui and a non-gui base system
-preconfiguration, and get it into the instalation wizards on the
-cd roms (where many newbies start from anyway) ???

For you getting an expert should be no problem: you're already on the net!
Simply post your problem (like you just did) and folks should jump at the
opportunity to help.

re:Setting Up a Base Linux Install on a Laptop

Nutte Strich's picture

-And like you said the current set up wizards are no substitute for the
-help of an actual expert. And that is especialy true if you want/need the
-communication features but don't want/can't use the full gui applications.

That's not really true. Every current distribution will work just fine
without X even though you may lose some of the point and click admin
features. One of the things I like about Slackware is that its minimal
configuration tools (netconfig,pppconfig,setup,etc.) all run from the
command line. I know that YaST from SuSE does too. So X isn't the
end all be all.

Missed a step that newbies won't understand

Anonymous's picture

Don't forget: after you apt-get install kernel-source-2.4.20, be sure to uncompress the tar.gz file like so...

bunzip2 kernel-source-2.4.20.tar.gz

tar xvf kernel-source-2.4.20.tar

Re: Missed a step that newbies won't understand

Anonymous's picture

why would you need a bunzip2 to decompress a .tar.gz? does'nt tar -zxf take care of this?

and anyway, the kernel comes as a .bz2, in which case the decompressing command is alright ,just the file extn. is'nt

Re: Missed a step that newbies won't understand

Anonymous's picture

Excep that the package kernel-source-2.4.20 will get you the file kernel-source-2.4.20.tar.bz2, so you could simply do:

tar xvjf kernel-source-2.4.20.tar.bz2

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

I have an older laptop (HP Pavilion N3250) and went through

the regular Debian install on it a few weeks ago. After

upgrading to 'sid', I saw the performance get slow ...

and the kernel compile was a hassle, of course.

Then I installed Knoppix 3.1 per a suggestion here:

http://www.linuxworld.com/site-stories/2002/1104.barr.html

... and was able to have a testing/unstable installation

in 30 minutes with full support for sound, WLAN (PCMCIA), ethernet

(PCMCIA), video, etc. ... With no kernel compile. There was a bug

in the lilo.conf (vga=###) and /etc/pcmcia/config (syntax error), but other than that, no problems and no hassles.

... another way to go about it anyway. Congratulations to Knoppix for a great way to install Debian :-)

--Brian High

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

brian,

do you still have your recovery cd that came with th n3250???

i am looking for the video driver, i have been to the hp web site, all i get is
a (not very) smart driver download

with no driver

my recovery cd is damaged $^$^$%&^Y$^%

jim master@citlink.net

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

A small trick that I use to make sure that everything gets updated and installed correctly is to run "dselect" after doing any sort of a blanket upgrade (it's sort of like vi, always there). I pick "select" from the menu, go into the selection process, then don't pick anything. What this does is force the system to check dependencies of items that were installed or going to be installed as a whole and allow you to easily let the package managment tools resolve them for you.

Then you can go through and use "tasksel" (for taskselect, uses "meta-packages" to install groups of packages that support what "tasks" you want to use the system for) to take care of figuring out what needs to be there to support what you're doing. Make sure to run dselect after tasksel is done doing its thing to doublecheck that there's nothing left to do.

I usually do this on a standard install anyhow, because it ties up any loose ends that may not be immediately obvious at a time when it's quick n easy to fix them.

Re: Setting Up a Base Linux Install on a Laptop

jknotzke's picture

I hope there is a part 3 to this.

Having just installed Sarge on a Thinkpad A31 I can tell you that getting the base install is the easiest part. It's installing X that is the pain in the arse not to mention getting suspend/resume to work while in X and getting the wheel mouse to work....

Building the kernel on debian

Anonymous's picture

I'm a fairly new debian user, and one of nice thing of debian are the tools to build and package kernels. I can't believe the author haven't shown the kernel-package tools (make-kpkg and al.), or how one can easily add patches or modules.

Also, I've yet to read something about the daily life on sid (what can be broken, how to avoid catastrophes, and so on). The article is not very thorough on valuable information, i.e. unavailable elsewhere or difficult to find.

S.

Re: Building the kernel on debian

Anonymous's picture

Sid is only unstable by Debian standards. By most general standards, sid would be considered stable. I use it on systems inside my network so the kids can get the latest and greatest progs and patches and it's only been broken once that I can remember, and that was after an update (to get new features in tuxpaint, awesome kid oriented front end prog for gimp), and that was fixed when we checked a day or so later. But it didn't break the system, just that package was broken, and only in a complaining way.

I don't think that you're going to find a situation where sid has really messed people up seriously, because by convention anything uploaded has been checked pretty well and if there's any problems they will be broadcast pretty loudly. There's usually very few reasons people *need* to run from sid outside of bragging rights that they're doing so. :-)

Anything being uploaded that is an updated system critical component is also not only going to be more heavily scruitinized, it's going to be more well known because lots of people were probably waiting for it.

IMHO most of the benefits derived from any sort of update are gained by moving from 2.2.x to 2.4.x in general. This gives you better support for newer hardware and, of course, ability to use iptables/netfilter.

Updating the kernel between 2.2 and 2.4 is a serious issue, but I just updated from bf24 to 2.4.20-686 and the only thing I had to do was go load up my nic module using "modconf". A very common task...lots of times the nic aren't coming up like you want them to. Ever try changing out a driver in win2k? What a PITA.

Most people have relatively few problems with sid, which is why so many people are running it and not that many are complaining, and why not many seem to think it's a big hop to switch from stable to unstable.

The only thing that I don't like about it is that you can't autopatch your security holes unless you're on stable. Security.d.o is the only official repository of security fixes that are apt-get "-able", and it's for stable only.

Another thing is that sometimes you may not have all the dependencies met for a package that you want to install because it's not completed in sid yet. So there are things that you might not be able to use right away that would be just fine in stable or testing.

You're also an idiot if you're running bleeding edge releases on exposed systems without a specific reason to do so.

In the past sometimes "testing" would be less stable than "unstable" for various reasons, but I think that is changed now...A final thought might be that since Debian is constantly trying to rework their release system so that they can have more frequent stable releases (this was problematic in the past) that code in testing is more "delivery-ready" than sid.

Anyhow, more than was asked for or probably wanted.

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

One of the steps that's always at the top of my list when installing on an x86 Debian box is making the filesystems ext3. This is simply a matter of using a kernel with built-in ext3 support, running tune2fs -j /dev/hda1 (replace hda1 with the partition that you want to create a journal for), changing instances of ext2 in /etc/fstab to ext3, and rebooting. Ext3 makes life much nicer.

The odd thing is that I've had the option to create Ext3 filesystems in the installer on the other architectures I've installed Debian on.

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

This depends if you boot with the normal/compact/idepci kernel images, which are 2.2.x, or the bf24, which is 2.4.x. ext3 doesn't exist on the former kernels so it's not an option. In the latter you get prompted for ext2, ext3 or reiserfs.

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

Hi

I have cd iso #5 that the kernel is bf24. In this case, I ask you:Do i have only to install the kernel from cd and not from internet?

Thanks

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

Unless you have older hardware that won't work with the version of isolinux that is on cd#1, you don't need to use cd#5. At least that's the difference I noticed and where it hung when I was having a problem with installing new kernel on pentium 200mmx system...

You should be able to use either, but all the kernels are available on the first disk. I'm not sure why using either version of isolinux isn't given as an option or why they felt they needed to use a newer version on the first cd, but that's the way it is...

All you should have to do is boot the first disc and type "bf24" and you get 2.4.18 patched prettily to deb's standards installed on your machine. If isolinux hangs on you, kernel 2.4 might not be for you either (only beneficial for newer hardware and iptables support). Doesn't hurt to try, though.

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

Good advice. Definately use ext3. Because if you select ReiserFS and don't remember to install the reiserfs tools... Anyway ext3 is better.

Re: Setting Up a Base Linux Install on a Laptop

Anonymous's picture

you can accomplish the same thing just as easily by putting in your apt sources yourself with the 'edit apt sources by hand option'.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState