Debian Installation from a USB Flash Drive

Before we can move on to upgrading the SSD on the Mini 9, I figured we should perpare our installation media. Since the Mini 9 does not have a CD/DVD drive on it, and I don't have an external CD/DVD drive laying around, I decided that I would install Debian onto the Mini 9 via a USB flash drive.
Things you will need:
  • A computer running Linux (a Mini 9 with Ubuntu Remix on it should do fine)
  • A USB flash drive:
    • At least 64 MB for the business card .iso
    • At least 256 MB for the network install .iso
    • At least 1GB for the standard CD .iso
  • A Debian installation .iso (you only need one of the following):
    *Using either of these, you will need a wired internet connection during the installation process to download packages.
  • The following addional files:

I did this using the standard CD .iso because I already had it downloaded, but either of the other two should work just fine. Just a heads up for when you actually install with this, I recommend a wired internet connection during the installation as this will autmatically configure networking during the installation process and it will download any package updates when installing.
I think we're ready to get started.
  1. Let's start by making sure we have all everything we need installed on our computers. We will need the dosfstools package if our flash drive is not a single FAT16 partition, the syslinux and mtools packages to install the syslinux boot loader on the flash drive, and the mbr package in case we need to fix a corrupted MBR on the flash drive:

    # apt-get update
    # apt-get install dosfstools syslinux mtools mbr

  2. Check the file system on your flash drive and get the device name for the flash drive (if you're working on a Mini 9, this is probably /dev/sda). For the purposes of this guide, I will use /dev/sdX for the device name of the flash drive, be sure to replace the "X" with the appropriate letter. You will want to make sure you have the correct drive name for you flash drive; you don't want to accidentally format your hard drive because you used the wrong drive name. Most flash drives come with a single FAT16 partition, which is what we want since we will be using syslinux as the boot loader which uses a FAT16 partition. We can use fdisk to check the partitions on the flash drive and to get the device name:

    # fdisk -l

  3. Skip this step if your flash drive is already a single FAT16 partition. If your flash drive is not a single FAT16 partition, we will make changes to the partition table with fdisk and format the filesystem with mkdosfs. First we want to make sure none of the partitions on the drive are mounted:

    # umount /dev/sdX1
    # umount /dev/sdX2

    Repeat the above for each partion number shown when you listed your partitions with fdisk before. Now that the drive is not mounted, we can write a new partition table with fdisk:

    # fdisk /dev/sdX
    Command (m for help):

    • Typing "m" will give you a list of commands
    • If you need to see a list of partitions again (this will help make sure you're messing with the right drive), type "p"
    • Type "d" and then a partition number to delete a partion
    • Repeat above step until typing "p" returns no partions
    • Create a new partition with "n"
    • Type "p" to make it a primary partiton, and then "1" to make it the first partiton
    • Hit the 'Enter' key twice to make this partition take up the whole drive
    • You should now be back at the 'Command (m for help):' prompt, type "a" and then "1" to set the boot flag on the first partition
    • Type "t" then "1" and then "6" to set the file system on the partion to FAT16
    • Type "w" to write the partition table, and then you should be back at the standard bash prompt

    Now we want to format the file system with mkdosfs:

    # mkdosfs /dev/sdX1

  4. At this point, the flash drive is probably mounted on your system (even if you just formatted it), so we need to unmount it before we can install syslinux on it:

    # umount /dev/sdX1
    # syslinux /dev/sdX1

  5. Now we need to mount the flash drive; the easiest way to do that is to unplug it and plug it back in. By default, my flash drive was mounted to /media/disk. If you have already downloaded the vmlinuz and initrd.gz files, copy them onto the flash drive now. Alternatively, we can download them directly to the flash drive:

    # cd /media/disk
    /media/disk # wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/cdrom/initrd.gz
    /media/disk # wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/cdrom/vmlinuz

  6. Now we need to create a file called 'syslinux.cfg'. This is a configuration file for syslinux that tells it what to do. The file needs to contain the following information two lines:

    default vmlinuz
    append initrd=initrd.gz ramdisk_size=12000 root=/dev/ram rw

    Depending on the image you are booting with this, you may need to increase the ramdisk_size parameter. I used the above settings with the standard CD iso image and did not have any problems. Also, if you run into issues with booting from the flash drive, it may help to add devfs=mount,dall to the second line. You can create this file with your favourite text editor:

    # vim syslinux.cfg

    # gedit syslinux.cfg

    # nano syslinux.cfg

    Or you can create the file directly from the command line with the 'echo' command:

    # echo "default vmlinuz" > syslinux.cfg
    # echo "append initrd=initrd.gz ramdisk_size=12000 root=/dev/ram rw" >> syslinux.cfg

  7. Now you can copy your iso to the flash drive:

    # cp /`path to iso`/`iso file name`.iso /media/disk/

    Or you can drag and drop the file in nautilus or whatever your file manager of choice is.

  8. At this stage you should be done, but I always have to do an extra step. For some reason, during the above processes, I always corrupt the MBR on the flash drive. Not to worry, though, because it is easy to repair. First we need to unmount the flash drive again and then we can use install-mbr:

    # umount /dev/sdX1
    # install-mbr /dev/sdX

Well, there you have it! You should now have a flash drive that you can boot up into the debian installation with. You should be able to boot up into the installation on any computer that will allow you to boot from USB (you may need to turn this on in the BIOS). We are all ready to swap out the SSD in the Mini 9 with a bigger and faster one in my next post.


Dell Inspiron Mini 9 RAM Upgrade

When I bought my Mini 9, Dell wanted $75 to upgrade the RAM from 512 MB to 2GB. Dell also only puts in 533 MHz RAM when you order the Mini 9, but they sell replacement RAM at 800 MHz. I found on Newegg.com that I could get a 2 GB stick of RAM at 800 MHz for about $17 that would work in the Mini 9. Seemed like a no-brainer to me. NOTE: it appears the price has gone up for this particular stick of RAM.

In order to upgrade the RAM on your Mini 9, you will need:
  • Dell Mini 9
  • RAM - 200 pin DDR2 at 800HMz (533 MHz or 667 MHz will also work)
  • Small phillips head screw driver

Before you get started, remember to ground yourself (that's no TV, no phone, and no internet...) so that you don't ruin your electronics with a static discharge. That means it's probably not a good idea to put on and take off your new sweater a bunch of times really fast or scuff around the carpet in your wool socks.

Let's get started.
  1. Make sure your Mini 9 is turned off and you have disconnected the power cable and removed the battery.
  2. Remove the two screws indicated above and gently pry the back plate off with the screw driver.
  3. Carefully use your fingers to pull the metal brackets on the sides of the RAM to the sides, the RAM should pop up at an angle.
  4. Pull the stick of RAM out and set aside for later.
  5. Put the new RAM in place. Carefully, but firmly, push it into the connector, it should remain up at an angle like the old RAM just before you removed it.
  6. Carefully, but firmly, press the RAM down until the side brackets click into place and the RAM stays securly down and parallel to the board.
  7. Replace the back place, pressing down so that it clicks into place and replace the screws.
  8. Replace the battery and/or plug in the power cable and boot up your Mini 9 and enjoy your new RAM.
  9. Get crafty with the RAM you removed from your Mini 9. Make some nice jewelry out of it, maybe a neclace or some earrings, use your imagination!

Well, we did it, and it wasn't that hard. Next time we'll prep for upgrading the SSD by making a bootable Debian installation flash drive.


Token First Post

Welcome to my blog, grabag-linux. As you may have guessed from the name, this is going to be a relatively linux-centric blog. I got the idea after I got a new netbook (a Dell Inspiron Mini 9) and a friend suggested I document all the stuff I've been doing to it as a reference for anyone else who needs it.

I realized he was on to something, but figured there is only so much I can write about linux specific to my netbook. So, much of the content will be general linux stuff with some posts specific to the Mini 9.

I got the Mini 9 to be a fun toy and for portability. I bought it with the cheapest options across the board with the intentions of upgrading the RAM and SSD myself. In my next post, I'll take a screw driver to the back of the Mini 9.