2009-05-06

Installing Debian Linux

If you've been keeping score at home, you should know that we're now ready to install Debian on the Mini 9. Before you install Linux on a computer, you'll need to make sure your BIOS is set to allow you to boot from your installation media. I'll be installing from the bootable flash drive I made in an earlier post.

In order to get into the BIOS on a mini 9, you need to reboot and press "2" to get in there. You'll need to enable boot from "USB Storage" and set this to boot with higher priority than the internal Hard Drive. If you're following this to install Debian on a different computer with a cd installation, the process should be similar, and you just want to make the CD-ROM drive boot with the highest priority. Be sure to save your changes when you exit the BIOS conifiguration.

Now we're ready to do the installation. You'll want to put the installation flash drive in a free USB port or the installation CD in your CD-ROM drive and reboot your computer. The system should boot up into the installation. If you're installing from a USB flash drive using the method I described before, it should boot automatically into the text based installation. If you're installing from the CD, it should give you an option for a text based or graphical installation; the biggest difference is the graphical installation lets you use the mouse and looks a little nicer.

Before we get started talking about the actual installation, I have a few things to mention:
  • I highly recommend having a wired internet connection during the installation for two reasons:
    • This will automatically configure networking on your computer
    • You will be able to download package updates from a mirror during the installation
  • Don't worry about making mistakes during the installation:
    • You will (or at least should) learn from them
    • You can always re-install over a bad install
The Debian installation is not too complicated, so I will skip over the stuff that is easy and go into more detail in the areas where there are real decisions to be made and/or I have reasons for wanting to do things in a particular way.
  • Choose Language
    Not a whole lot to explain here, you should know what language you want.

  • Select Keyboard Layout
    Again, not too deep here, should closely match your language.

  • Configure the network
    • Hostname: give your computer a name
    • Domain name: if you don't know what you put here, you can probably leave it blank

  • Configure the Clock
    You should know your time zone.

  • Partition Disks
    Partitioning your hard drive is probably the place where people get the most scared or are the most unsure. I suppose I'll start with a quick explanation of what a partition is. An analogy for thinking about a hard disk with partitions would be to think about a field with a fence dividing it into different parts. Stuff that is in one area is cut off from another area by the fence, and if you wanted to make one area bigger, you'd have to move the fence. For more on partitions, check out this wikipedia entry.

    Partitioning your hard drive is really not that scary. When you get to place on partitioning your hard drive, I highly recommend manually partitioning your hard drive. Doing so will give you more knowledge of your system and will be better for preserving your data should something go wrong. Speaking of preserving data, I make all my partitions primary partitions, as opposed to logical partitions. It has been my experience that if you need to boot into a livecd environment to recover data, this is much easier if you're not using logical volumes.

    All Linux really needs to operate is a root partition (mount point: / ). Some will say that Linux also needs a swap partition, but if you've got enough RAM this is not necessary, and many people suggest not putting a swap partition on an SSD. Speaking of SSDs, people recommend using the ext2 file system to prevent extra write cycles from the journaling features with the ext3 file system. Also, you should set up your partitions on an SSD with the mount option "noatime." This mount option means that the system will not update the last access time for a file; in short, this means fewer write cycles.

    They say the partition containing the /boot directory should be located as close to the front of the drive as possible. I take this a step further by creating a partition specifically for /boot. I set this partition up to be 100 MB with an ext2 file system. Not surprisingly, this partition needs to have the "boot flag" turned on.

    The next partition I create is the root partition, and I probably make it bigger than it actually needs to be at 10 GB, but I figure that way I won't run out of space for installing programs. Since this is on an SSD, I set it up as ext2 with the "noatime" mount option.

    If I were going to create a swap partition, I would do it next. If you're going to create a swap partition, it doesn't make sense to make your swap partition smaller than the amount of RAM you have on your system. Unless, of course, you don't plan on using the hibernate function (i.e. suspend to disk); in which case you can make your swap partition whatever size you wish. I am not making a swap partition here because this is on an SSD.

    Now I make my final partition: /home. I make this partition take up any remaining space on the drive. Putting /home in its own partition is good for cases where you need to re-install your system, but don't want to lose your personal data. If you mess up your system beyond repair or choose to upgrade by doing a fresh installation, it is possible to leave your /home partition intact. Like my / partition, I'm keeping this one ext2 and using the "noatime" mount option because it is on an SSD.

    Note, the available disk space above does not match what I have said that I used above and the USB flash drive does not show as an available disk. This is because I took the screen shots while running the installation in VirtualBox on another computer. The numbers I mention above do match what is currently setup on my Dell Mini 9.
    If you don't create a swap partition, the installer will give you a warning, you can simply select "No" to move on past this.
    Selecting "Yes" on the above screen will write your changes to the partition table and format the hard disk. Once you do this, you'll find it's not quite as exciting as you had hoped.

  • Installing the Base System
    Absolutely no user intervention in this step

  • Set up Users and Passwords
    • Root Password: If you're familiar with Ubuntu, this will be a new step. Ubuntu tries to hide the root user from you, in what is, I suspect, a measure to make it slightly more difficult to damage your system. Note: Just because you can log in as the root does not mean you should. In fact, I recommend logging in as root only when necessary
    • New User setup: Here you can set up the user that you will be primarily logging in as. Just enter your name, pick a user name, and password.

  • Configure the Package Manager
    I would recommend using a network mirror. This will automatically download package updates during the installation. This will take longer than not doing so, but you'll have up to date software packages when the installation is finished. Just pick your country and then select a mirror. When it asks about an HTTP proxy, chances are you can leave this blank if you don't know what you need to do here.

  • Software Selection
    For the Mini9, you pretty much only want the Desktop Environment, Laptop, and Standard System features. If you're installing on some other machine, you probably have an idea what you want to use it for, and chances are if you don't know what something is on the list, you don't need it. Plus, you can always install this stuff later anyway if you find you need/want something here and you didn't mark it for installation.

  • Installing Software
    To steal a mantra from Charlie Papazian: Relax, Don't Worry, Have a Homebrew. (Or a commercial brew is fine)

  • Install GRUB Boot Loader on a Hard Disk
    If this installation of Linux is going to be the only operating system on your machine, there's no reason that I can think of not to install GRUB to your master boot record
  • Finish the Installation
    Congratulations, you've finished the installation of Debian Linux. Simply select continue, and be sure to remove your installation media before rebooting your computer to enjoy your new Linux installation

Well, that does it for this post. Next time, we'll start configuring Debian to work correctly on the Dell Mini 9.

No comments:

Post a Comment