Fiberglassing a Rocket

Back in April 2011 myself and a friend bought a Forte Rocket kit from Apogee Rockets to complete my level one and two NAR certification flight. The kit used standard cardboard tubing and through wall fins. After spending the time putting the kit together, I decided to go the extra mile and fiberglass the rocket. I’m writing this to give a quick tutorial on fiberglassing rockets and tell you about the lessons that I learned from the experience.

Once I had the rocket completed I decided to go to Autozone and but some of the fiberglass. I bought:

  • 3m fiberglass cloth (8 square ft/.75 square m) $10
  • 3m fiberglass resin (32 oz/1 liter) $22.50

Knowing how much fiberglass cloth and resin you need is a challenge. I bought 8 square feet for my rocket, which was just enough to double layer the 3.5 ft tall cardboard tube and fin section of the rocket. I only ended up using about 60% of the 32 oz resin.

To apply the fiberglass, I used some good quality rubber gloves, foam paint brushes, and an object for squeegeeing the resin. The foam brushes did dissolve in the resin and sometimes left little bits and pieces behind. If you have an old paint brush you don’t mind throwing away it would be a better application tool. For the gloves, I suggest getting the good quality rubber gloves. The fiberglass resin will eat through latex gloves and many of the other thin gloves. If you are careful with the rubber gloves and don’t allow the fingers to cure together, then they will be in good condition after use with the exception of small area of resin hardened on the outside. For the squeegee, I used an old plastic card as a squeegee. It worked great.

When you mix the resin I suggest using a cheap glass cup. I originally used wax dixie cups, but the resin ate through them (probably because of the heat). Keep in mind that as the resin cures it gets hot. Mix enough resin to complete the fiberglass sheet you are working on.

Be sure that the area you are working in is well shielded with cardboard. If a drop of resin fall on a concrete floor and cures, it will be there for the eternity of time. Also wear pants and a long sleeve shit that you don’t care about. The resin will get on your clothes.

To allow the resin to cure faster you may be interested in using a heater. The resin usually takes 24 hours to completely cure, but by using a heater you can get that number down to around 6 hours.

If you plan on sanding the fiberglass I suggest using hefty gloves, a hospital style facemask, and safety glasses that cover your eyes well. Even with this protection you will still get fiberglass splinters. The best way to minimise the exposure is to make sure you do a good job with the application of the resin and making sure that your fiberglass cloth is cut perfectly to size. I suggest just using sandpaper sheets. For a perfectly smooth finish I recommend using a 120 grit followed by a 600 grit followed by a high grit. Be prepared to use a lot of the high grit sandpaper, fiberglass has a way with clogging the grits up.

To apply the fiberglass:

  1. Measure the area over which you want to fiber glass. Add approximately 2 inches (4 cm) overhang on each side because when you cut the cloth you will effectively loose when you cut the section out
  2. Place a piece of the cloth on the rocket to make sure that it is the right size
  3. Mix the resin with the hardener in the glass cup
  4. Apply generous amounts of resin to the cloth
  5. Use the squeegee to eliminate all air pockets and excess resin
  6. You can use a rag to wipe off the pools of resin as long as the resin is not close to curing
  7. Repeat the process for each piece

Here’s some pictures of my finished product.

Posted in Rockets | Leave a comment

Getting the Parts For My New RepRap Prusa

Here’s a list of all the parts for my Prusa Mendel RepRap where I bought them and their costs.

  1. $95Stepper Motors x 5
    http://www.alltronics.com/
    I got the Nema 17 2A bipolar 4 wire connection stepper motor. Any bipolar 4, 6, 8 wire connection will work as long as the holding torque is greater than 3 kg*cm. If you’re unsure about what to get for yourself just go to ultimachine.com and get the ones there. You need 5 steppers because one axis uses two steppers and one stepper is needed to drive the PLA plastic feed.
  2. $0Printed Plastic Parts
    ebay
    I actually got these parts from a friend, but you can order them from ebay. Search for “prusa” and get an SAE kit if you go with the same hardware store parts I did. THey should cost somewhere around $40 for just the plastic printed parts.
  3. $96 x Bearings 608ZZ 8x22x7
    http://www.amazon.com/
    Get 6 608 bearings for your RepRap. Buying a few extra is a good idea.
  4. $0Fans
    Luckily I had a friend with a few 40 mm fans that I could have. You’ll need 3 or 4 of them. They are available from alltronics or ultimachine.
  5. $30Power Supply
    ebay
    I got a 20 A 12 V power supply. Any power supply will work that has 12 V and at least 5 A or 15 A if you are going to run a hotpad.
  6. $66PLA Plastic
  7. $60Hardware Store Odds and Ends
    http://www.mcmaster.com/
    A couple metal rods and belts that can’t be printed.
  8. $200RAMP Complete Set Preassembled
    http://ultimachine.com/content/ramps-pre-assembled-kit-complete
    The RAMPS set is the guts of the Prusa, including the Arduino Mega microcontroller and the Pololu Stepper Motor Drivers
  9. $86Hot End Extruder Kit
    http://ultimachine.com/content/makergear-hot-end-kit-3mm-filament
    I got the the 36 mm length .35 mm diameter with the wooden mounting pieces.
Posted in 3D Printers | Leave a comment

Linux Starace Dark Theme Completed

Here’s a video of my finished Linux Starace Theme. If you have any comments about the setup or anything else linux leave a comment below.

Posted in ASUS G53SW Setup, Everything Penguin Related | Leave a comment

AE499

I’m in a quadrotor independent study class which will culminate into my first professional publication. More delineation later!

Posted in Quadrotors | Leave a comment

Change Login Sound Linux Mint, Ubuntu, Fedora – GNOME

If you ever feel like changing your login sound it’s a piece of cake. Go to Preferences -> Startup Applications. Look for an application called “GNOME Login Sound” and click edit. Delete the previous command and use vlc running in daemon mode (-d) to play the file of your choosing.

vlc /path/to/file.ext -d

This will work will almost any type of sound file (ogg, mp3, wav, et cetera.)

Posted in Everything Penguin Related, Uncategorized | Leave a comment

How to Import a Large CSV file to MySQL

I recently had to import a large csv file into mysql. Here’s how I did it. Also be sure that you have an ssh account/access to the terminal on the computer with the sql server.

1. Create the table you will store the items in.

Take a look at the top few lines of your csv file (using the head command makes this really easy). You might see something like this

Some Large Database
ID,Name, Phone, Address
1,James,505-234-2123,3456 Super St.
2,Mark,254-342-6732,7351 Roger Rd.
...

Notice that the csv file is set up with four columns.The first step is to create a table in a mysql database that has the three columns as fields in the table. I’m not going to show the specifics, but if you don’t know how to create a table in mysql google it. Remember if your database is big, be sure to put the index/primary/unique keys on before you upload the database.

2. Use the mysqlimport utility

Now comes the magic, here’s the command to upload your file.

mysqlimport  --ignore-lines=1 --fields-terminated-by=,
--columns='ID,Name,Phone,Address' --local -u root -p
Database /path/to/csvfile/TableName.csv


Ignore-lines skips the first line “Some Large Database.” The –fields-terminated by tell the utility that the commas separate the columns. The –columns is used to map the order of the data in the csv file to the SQL database table. –local is very important. I’m not sure why it’s there but importing a csv file won’t work without it. The Database is the name of the database in which your table is stored. You must put the absolute path of the csv file for it to register with the utility. The “TableName.csv” has to match the name of the table in your mysql database.

For more information on the mysqlimport utility take a look at it’s reference page.
http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html

Hopefully this makes someone’s life easier. Leave a comment below if it does.

Posted in Everything Penguin Related | Leave a comment

Step By Step How to get Hibernate Working for Linux (Ubuntu 11.04, Mint 11)

What Hibernation Is and Does

Hibernation takes all the data in your ram and stores it on your hard drive and then powers down the computer. The data is stored in a special type of partition called a swap partition (you can also have a swap file). When you power the computer on again the data stored from your old session is reloaded.

In the following article I am going to lead you through a systematic approach to diagnosing why Linux’s hibernation feature isn’t working on your computer and hopefully fix it. Here’s a Brief overview.

1. Not Enough Swap
2. Your Computer Isn’t Saving Your Session
3. You Computer Isn’t Reading your Saved Session on Boot
4. Your Computer Says “resuming from /dev/sdX” but freezes

1. Not Enough Swap

You should have as much swap as you have RAM plus some margin. If you try to hibernate and you are using more ram than you have swap the process will fail and sometimes hangs. Sometimes there is an error message that says “not enough swap” This is an easy problem to check for. Run the command in red.

chris@Starace ~ $ free -m
             total       used       free     shared    buffers     cached
Mem:         10005       9922         82          0       1647       5844
-/+ buffers/cache:       2430       7574
Swap:         8100          0       8100

The output shows the amount of swap and ram on my computer. As you can see I have 8005 Mb of RAM and I have 8100 Mb of swap. For a hibernate to work you have to have more swap than used RAM not counting cached), Also if you run out of RAM during your session your swap is used. To hibernate you must have free swap greater than the sum of your RAM and your used swap. As a general rule you should have a swap partition slightly bigger than your RAM (hopefully you aren’t using swap during your session, if you are it’s time for a RAM upgrade.)

If you don’t have enough swap or if you don’t have any swap, roll up your sleeves you need to repartition your hard drive.

Repartitioning to add more SWAP

Remember to be careful with your repartitioning, you can destroy your OS easily.

  1. Pull out your bootable CD/Jump Drive and boot It (we can’t repartition the drive we we are using it.)
  2. Run the “gparted” disk utility.
  3. If you have swap, right click -> Delete
  4. Right click on your linux partition -> Resize/Move
  5. Decrease the size of the partition by the amount of space you want to increase your swap. Click Okay
  6. Right click on the free space -> New
  7. Change the File System Type to “linux-swap,” click okay.
  8. Click the apply check mark in the top menu of gparted to apply the changes
  9. Right Click On the new swap partition -> Information
  10. Copy down the UUID value and /dev/sdXN value for later.
Linux Create Parition

Make Sure the File System is linux-swap

uuid info linux

Copy down the UUID and path values. We will use them later.

Note:Remember to be careful with your repartitioning, you can destroy your OS easily. After repartitioning you will need to edit your Linux Hard Drive file. Open up terminal and run the command.

chris@Starace ~ $ sudo gedit /media/NAME_OF_YOUR_COMPUTER/etc/fstab

If you had a swap partition before, look for the line that has the word swap and change the /dev/sdXN to the new /dev/sdXN value. You can also use the UUID instead of the path as shown in red. If never had a swap partition to begin with add the following line to the bottom of the “/media/NAME_OF_YOUR_COMPUTER/etc/fstab” file.


UUID=a453-Your-UUID-Number-ea33 none swap sw

The path variable can change depending on how you have your hard drive plugged in (ex /dev/sda1 -> /dev/sdb1). This usually isn’t a problem if you don’t move your hard drives around in your computer. However, Using a UUID is more reliable. The /dev/sdXN designator can change, but the UUID is unique to the storage device and doesn’t change even if you move to another computer.

After you’ve made the changes to the fstab file, shut down and boot your computer normally. To make sure this all worked run the following command in red. You should see your swap partition listed.

chris@Starace ~ $ cat /proc/swaps
Filename				Type		Size	Used	Priority
/dev/sdNX                         partition	8295420	0	-1

If you see this take you have successfully created/expanded your swap to accommodate hibernation.

2. Your Computer Isn’t Saving Your Session

If you’ve tried to get your computer to hibernate and it didn’t work it’s helpful to look at the hibernation log.

tail /var/log/pm-suspend.log

chris@Starace ~ $ tail  /var/log/pm-suspend.log
Running hook /usr/lib/pm-utils/sleep.d/00powersave thaw hibernate:

/usr/lib/pm-utils/sleep.d/00powersave thaw hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/00logging thaw hibernate:

/usr/lib/pm-utils/sleep.d/00logging thaw hibernate: success.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate:

/usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate: success.
Sun Jul 24 13:15:14 HST 2011: Finished.

If you see something that has a date and says “Finished” like the what is shown in blue, that means that your computer successfully saved the session. If you see a bunch of errors then get ready to roll up your sleeves again. Unfortunately this is the hardest error to fix. There could be dozens of reasons for this to happen, but in my case it had something to do with binding and unbinding peripheral devices. The following article explains what I did to fix the problem.

http://chriseiffel.com/everything-linux/how-i-got-suspend-and-hibernate-working-in-linux-ubuntu-11-04-mint-11/

One solution that I found that worked for a lot of people, but not me is this simple fix

http://www.ubuntugeek.com/fix-for-suspend-and-hibernation-problem-for-laptops.html/comment-page-2#comment-53547

Don’t lose hope if you get stuck in this step. Instead google everything you can on the problem. Google the errors you see in the log. Someone has solved the problem you just need to find the solution.

3. You Computer Isn’t Reading your Saved Session on Boot

So your computer successfully saves a session, but doesn’t resume the session upon power up? It acts as if it was rebooted rather than hibernated? Well the good news is that this is a fairly easy thing to fix. This is most likely because GRUB the bootloader doesn’t know to resume from your swap. Take a look at the GRUB profile.

chis@Starace ~ $ sudo gedit /etc/default/grub

Look for the line that starts with.

GRUB_CMDLINE_LINUX

Add the following option in red.

GRUB_CMDLINE_LINUX=”resume=UUID=a353e-Your-SWAP-UUID-34eda other-option=value”

Or

GRUB_CMDLINE_LINUX=”resume=/dev/sdXN other-option=value”

You may or may nor have other options. Be careful that you type in the correct path or UUID for the drive here. If you don’t then when you try to resume you will have to boot in safe mode to fix the drive name and re-run the update-grub script. Save the file and then update grub with the following command.

chris@Starace ~ $ sudo update-grub

In addition to grub we need to update/create one more file. Edit the following file.

chris@Starace ~ $ sudo gedit /etc/initramfs-tools/conf.d/resume

Add this line to the file.

resume=UUID=41e86209-3802-424b-9a9d-d7683142dab7

Then run this command to update.

chris@Starace ~ $ sudo update-initramfs -u

Now hibernate your computer and cross your fingers! It just might work.

4. Your Computer Says “resuming from /dev/sdX” but freezes

Linux is so close to hibernating and resuming successfully that it even says it is resuming. Fortunately this is another easy fix. The problem with this comes from two programs that are redundant. Removing them should fix the problem.

chris@Starace: sudo apt-get remove hibernate uswsusp

I know that the command may seem counterintuitive. but it worked for me so hopefully it will work for you.

All Done

Remember to check to make sure your USB ports work after the suspend/hibernate.

If you tried the steps above, please leave a comment below with your system setup (OS, Computer Hardware) so that we can create a reference that others can use.

Also I got a lot of my resources from the Ubuntu page on swap partitions. If you want to learn more about this subject read this article

https://help.ubuntu.com/community/SwapFaq

Happy Linuxing!

Posted in ASUS G53SW Setup, Everything Penguin Related | 12 Comments

How I got Suspend and Hibernate working in Linux (Ubuntu 11.04, Mint 11)

Suspend and hibernate have always been screwed up with Linux. Luckily if you absolutely need this feature there is hope. I got mine working after scouring google. In this tutorial I will share with you what I learned, and how I solved the “linux insomniac” problem for my laptop.

First, here’s what I’m running.
Linux Mint 11 (a derivative of Ubuntu 11.04)
Kernel Version 2.6.39.3
Asus G53SW (Very similar to any ASUS G73/G Series)

If you are running something different than I am above, don’t panic this still have a good chance of working for you. Regardless of what you do I encourage you to test your suspend and hibernate after everything you try. I know, you’ll have to hold the power button down a lot for a cold reset, but it’s worth it.

My Symptoms Before I got it Working

When I sent my computer in Hibernate the computer would look like it was doing what I told it to up until the part where the screen and the CPU fan turn off. I just got a screen of black that would not respond. The hibernate was very similar except there was a white cursor frozen at the top left of the screen. The only option I had was to hold the power button until it turned off.

An Easy Fix for Suspend

I scoured the web looking for something that might help me. I ran into an article which gives instructions on installing a script that may fix the problem. There are dozens of people who have left comment in the article as to whether it worked for them or not and what system they were running. Most of them left comments said that the script worked perfectly well for them.

The Fix
1. Create a new script. The scripts in the sleep.d directory get executed when your computer suspends and hibernates. The “20″ has something to do with the script load order and the name currently _custom-echi_hcd can be changed to anything you like

sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd


2. Enter the following script into gedit.

#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug
# tidied by tqzzaa :)
# Comments added by chriseiffel.com

VERSION=1.1.1
DEV_LIST=/tmp/usb-dev-list
DRIVERS_DIR=/sys/bus/pci/drivers
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
HEX="[[:xdigit:]]"
MAX_BIND_ATTEMPTS=2
BIND_WAIT=0.1

#This function executes when the computer is going
#into sleep/hibernation. It looks for all devices
#in /sys/bus/pci/drivers with the ehci_hcd, etc
#and adds them to the unbind list
unbindDev() {
  echo -n > $DEV_LIST 2>/dev/null
  for driver in $DRIVERS; do
    DDIR=$DRIVERS_DIR/${driver}_hcd
    for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
      echo -n "$dev" > $DDIR/unbind
      echo "$driver $dev" >> $DEV_LIST
    done
  done
}

#Executed on a resume/thaw attempts to rebind the stored drivers
bindDev() {
  if [ -s $DEV_LIST ]; then
    while read driver dev; do
      DDIR=$DRIVERS_DIR/${driver}_hcd
      while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
          echo -n "$dev" > $DDIR/bind
          if [ ! -L "$DDIR/$dev" ]; then
            sleep $BIND_WAIT
          else
            break
          fi
          MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
      done
    done < $DEV_LIST
  fi
  rm $DEV_LIST 2>/dev/null
}

case "$1" in
  hibernate|suspend) unbindDev;;
  resume|thaw)       bindDev;;
esac

3. You’re done. You shouldn’t need to restart your computer. Try a suspend. Cross your fingers. Remember to check to make sure that your USB devices are still working after a resume/thaw.

Unfortunately for me and some others it didn’t work perfectly. In my case it was bitter sweet, my suspend worked, but my hibernate still didn’t work. However, it did change the way that suspend didn’t work. Now instead of a black screen, the computer just acted as if it was a normal restart. On power up instead of continuing the session it just restarted. If you have this same problem continue on getting article on getting hibernation. working.

The website and the script I originally found are located here.
http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug/

Posted in ASUS G53SW Setup, Everything Penguin Related | 9 Comments

Linux is so Customizable — GL Matrix Cyan Color Screen Saver Mod

I have always liked the Matrix screen saver that is packaged with most linux distributions. However I have a blue backlight keyboard and when the green martix screensaver came on it really clashed with the keyboard. If only there was a way to change the color… wait this is Linux and Linux is all about being able to change anything!

The Old Green

Green Matrix

The Origional Green Matrix

The New Blue

Blue Matrix

The modded blue matrix.

I must thank thottingal.in for giving me the most crucial information I needed to create my screensaver. I basically followed his tutorial to figure out how to get the source code for the GLMatrix screensaver change it and compile it.

I had trouble getting the dependencies for the source installed. I got errors such as,

  • Note: The OpenGL 3D library was not found.

    Those demos which use 3D will not be built or installed.
    You might want to consider installing OpenGL and
    re-running configure. If your vendor doesn’t ship
    their own implementation of OpenGL, you can get a free
    version at . For general OpenGL
    info, see .

  • /usr/bin/ld: cannot find -lXext
  • `XmuPrintDefaultErrorMessage’”

I was able to fix all of these errors by tracking the following dependencies down and installing them using the synaptic package manager.

libxmu-dev, libgl1-mesa, bc, libglade2-dev, libjpeg8-dev

As for modifying the source code to make the cyan color, I edited the file hacks/glx/glmatrix.c and changed line 771 to g = 0xCC; b = 0xFF; essentially setting the color to #00CCFF.

It makes a great addition to my Starace Tron Theme.

Posted in ASUS G53SW Setup, Everything Penguin Related | 2 Comments

How to set up an SSD on Linux

I recently bought an awesome new ASUS G53SW and to go along with it I purchased a 128 Gb Plextor SATA III SSD. I wanted to use the SSD for the Mint Linux OS.

It seems that there are a ton of older articles that talk about getting an SSD correctly configured in Linux. I perused through them, and I found several conflicting and incorrect instructions. In the following tutorial I am going to try to present what I have learned, both how to configure and why it is configured that way.

These instructions should work for all Debian based Linux Distros (Ubuntu Mint). Some of the commands may need to be tweaked for Fedora or others.

Before I begin let me just gloss over the paradigms behind SSD drives. SSD drives are fast compared to the traditional hard drives. Traditional hard drives (7200 rpm) get less than 100 Mb/s read rate which degrade over time. SSD’s with SATA III have seen read and write speeds at 500 MB/s. So with SSD’s your application load times are reduced by 80%. However SSD’s are more expensive, smaller, and as they are written to they lose disc space, leading to a short life time if they are written to too much.

Sources
Hard Drive Speeds: http://answers.yahoo.com/question/index?qid=20110309132315AACvk6n
More on SSD Technology: http://www.storagesearch.com/bitmicro-art3.html

Before you Buy — Is the SSD compatible with your Hardware?

If your computer is new chances are it supports SATA III for its hard drives. If your computer is older check to see what SATA your computer supports. No sense in buying a SATA III device if your computer only supports SATA II. SATA III is completely backwards compatible with SATA I, II but will only get speeds at the SATA I, II levels.

Before you Install — Linux Partition Type

Before you install Linux you will want to consider the partition type. The partition types for a Linux install are ext2, ext3, ext4. There is a fair amount of dispute as to which is best. There are a lot of fans of ext2 and ext4. The default install of most (or all?) linux distros is ext4. Ext4 is a journaled file system. The journal is there for redundancy in the event of hard drive error/failure. It is a lot easier to recover your data with and ext4 system, however the journal adds writes to your SSD. The ext2 partition type does not have a journal so the life of the SSD is lengthened, but it loses the recovery features. Ext3 is a journaled file system with less features than ext4 so it is typically rejected in favor of ext4.

More info on ext2, ext3, ext4: https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions#Can_I_use_ext4_on_Solid-state_drives_.28SSD.29.3F

In the article listed below a pro ext4 person explains his viewpoint that the lifespan of the SSD is so long that having a journaled file system won’t be a big deal unless you plan on using the drive for more than 10 years. I would suggest that for any desktop user ext4 is a good choice. If you are installing the ssd for a server then you might think about ext2 as long as you keep good backups.

Ext4 suppoter: http://marc.info/?l=linux-ext4&m=125803982214652&w=2

After Linux Installation — Know Your Hard Drives

If you have multiple hard drives connected to your Linux machine you will want to know which hard drive the name of the hard drive. If you go to your terminal and type in “df -h” you should see something like this.


$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb6 89G 9.2G 76G 11% /
none 4.9G 588K 4.9G 1% /dev
none 4.9G 536K 4.9G 1% /dev/shm
tmpfs 4.9G 1.6M 4.9G 1% /tmp
none 4.9G 396K 4.9G 1% /var/run
none 4.9G 0 4.9G 0% /var/lock
tmpfs 4.9G 0 4.9G 0% /var/tmp
/home/chris/.Private 89G 9.2G 76G 11% /home/chris
/dev/sda2 466G 54G 413G 12% /media/Windows Starace
/dev/sdb1 26G 9.5G 16G 38% /media/Windows SSD
/dev/sda1 100M 25M 76M 25% /media/System Reserved

Looking at this screen you can tell that I have two hard discs and a couple partitions on each disc. The entries with /dev/sda and then some number are partitions that are on my 7200 rpm Seagate traditional hard drive while entries with /dev/sd2 are partitions on my 128 Gb Plextor SSD. Knowing that the the ssd’s name is “sdb” is important for the upcoming steps. Most people will probably have their ssd name be sda so I will use that in the rest of the tutorial.

After Installation – Benchmark Your Computer’s Speed

Benchmarking the capability of your computer is an important thing to to to know if the changes you made affected the speed.

A simple utility to benchmark the read speed of your ssd is under the administration Gnome menu and is called “Disc Utility.” You can start it from the command “palimpsest”. Click on the ssd and click benchmark.

Note that benchmarking the write speed of your SSD should be done sparingly, it will use up a lot of writes. If you are concerned then perhaps you should skip benchmarking your computer.

I recommend a utility called Bonie++ for testing the write speed of your ssd. It should be available under your package/software manager. Once it is installed run theses commands.


bonnie -d . >ssdtest.mark
#wait for the benchmark process to finish takes some time
bon_csv2html ssdtest.mark > ssdtest.html
firefox ssdtest.html

This should popup your bonnie++ specs in firefox.

After Installation — Changing the Linux Disc Scheduler

The hard drive scheduler attempts to organize hard drive requests in a way that is efficient. However organization is so old school. With SSD’s the memory access is instantaneous and many of the schedulers that were designed for spinning hard drives will only get in the way of SSD performance.

There are four types of schedulers in the Linux World. Anticipatory, Completely Fair Queuing, Noop, and Deadline. Anticipatory scheduling tries to arrange hard drive reads in a way that will maximize efficiency on a spinning disc. Completely Fair Queuing (cfq) is an anticipatory scheduler that adds in a ranking system for important disc reads. Neither of these are suited for an SSD.

The noop is a simple first in first out queue. The deadline is a biased noop queue that allows an application to get some access to the disc even if another application has already requested it.

The deadline is the best scheduler because it has more features than the noop and doesn’t worry about a rotating disc like cfq. To see what scheduler you are currently using go to your command line and look at this file

cat /sys/block/sda/queue/scheduler

You should get something that looks like this

noop deadline [cfq]

The option in brackets is the scheduler that is currently being used by your system, notice that this is currently the cfq. We want to change this to deadline. To do this we are going to edit the file /etc/default/grub. Type “sudo gedit /etc/default/grub” to edit the file. There should be a line of code that looks like this

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline"

To make the scheduler add in the elevator=deadline option that is highlighted in red. Be sure to put a space after the previous option. You may have more options than I do and that is perfectly fine. After you make this change reboot your computer. Run the “cat /sys/block/sda/queue/schedule” command and deadline should be bracketed.

Sources
Wikipedia on Schedulers: http://en.wikipedia.org/wiki/Noop_scheduler
Tombuntu on Grub: http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/

Changing Hard Drive Parameters

There are a slew of hard drive parameters to change. To change your hard drive parameters you can edit the file “/etc/fstab.” Some articles suggest adding several parameters to the drive options. However I only implemented the most common ones in my parameters. Edit the /etc/fstab file, and add the following parameters in red (this time separated by commas.)

/dev/sdb6 / ext4 noatime,nodiratime,discard,errors=remount-ro 0 1

discard
If your SSD supports trim, adding the discard option will enable the use of trim. Trim helps keep your SSD from fragmenting (yes you can fragment SSD’s read the article below for more info).

noatime, nodiratime
By default the ext4 partition keeps track of when files were las accessed. This is write intensive and bad for jump drives.
Below are links to blogs that have more information about several more of the hard drive parameters.

The hard drive parameters with the exception of the discard option for SSD’s that are on an ext4 partition. So if you chose ext2 then you only need to implement the discard option.

More Options: http://blog.loxal.net/2009/04/tuning-ext4-for-performance-with.html
What is Trim: http://www.bit-tech.net/hardware/storage/2010/02/04/windows-7-ssd-performance-and-trim/1

Moving Temporary Files to RAM – Less SSD writes

Temporary files such as images loaded from web pages or parts of files that are being download cause heavy disc usage. They are usually composed of many small files. Since we don’t care if temporary files disappear if we restart the computer it would be a good idea to move them to your RAM– as long as you have RAM to spare. There are two main directories that temporary files are stored in /tmp and /var/tmp.

So to make files stored in these directories get put into ram we are again going to edit the /etc/fstab file. At the end of the /etc/fstab file add the following lines of text.


tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0

Restart your computer. Enter the command “df” and you should see two tmpfs entries and their associated directories.

Results

I was hoping I would speed up my ssd a little after configuring it. Looking at the Bonnie++ tests it appears that there was very little change in the numbers. I do think that the effort to reduce ssd writes was beneficial. My final specs on the Plextor Sata III128 Gb SSD

Min Read Speed: 244.7 Mb/s
Max Read Speed: 423.1 Mb/s
Average Read Speed: 356.7 Mb/s

Bonnie++ Test Results



Version 1.96Sequential OutputSequential InputRandom
Seeks
Sequential CreateRandom Create
SizePer CharBlockRewritePer CharBlockNum FilesCreateReadDeleteCreateReadDelete
K/sec% CPUK/sec% CPUK/sec% CPUK/sec% CPUK/sec% CPU/sec% CPU/sec% CPU/sec% CPU/sec% CPU/sec% CPU/sec% CPU/sec% CPU
Pre Tweaks20G42199618218413166023229911357294230245316221414++++++++1409045802151++++++++2508671
20020us5124ms4921ms4624us12127us6762usLatency1118us4437us5323us452us101us2387us
After Tweaks20G42899551336426646024889910619991231742916797749++++++++2833588859552++++++++3116989
Latency19599us5122ms4123ms4156us11806us6443usLatency1250us5934us5743us586us102us2068us
Posted in ASUS G53SW Setup, Everything Penguin Related | 4 Comments