Mar 12 2009

Testing Ubuntu Jaunty and Ext4 WITHOUT Trashing Your Data

Tag: linux, software, ubuntuScott Wegner @ 11:00 am

Trash Thank YouUbuntu 9.04 “Jaunty Jackelope” is set for release in less than two months, and is currently in the “Alpha 6″ testing stage.  Arguably the hottest new feature is stable support for Linux’s new filesystem, ext4.  The new filesystem has been shown to have significant performance gains over any other Linux filesystem to date.  But think twice before you upgrade to ext4–many users have been reporting considerable data loss.  From a user’s comment:

This has happened to me twice, the first time erasing Firefox settings, and the second time erasing gnome-terminal settings. Both cases were caused by a kernel panic locking up the system. Also, both times the program whose settings were affected was in use during the kernel panic.

This has been a wide-spread problem, particularly for Ubuntu users testing the new Jaunty alpha releases.  It manifests itself after a system crash, where open files will simply be emptied and erased.  It is particularly prevalent in users’ settings files, such as those used for GNOME or KDE.  Fortunately, there cause of the bug is relatively well-known, as kernel developer Theodore Ts’o explains in his detailed comment:

OK, so enter ext4 and delayed allocation. With delayed allocation, we don’t allocate a location on disk for the data block right away. Since there is no location on disk, there is no place to write the data on a commit; but it also means that there is no security problem. It also results in a massive performance improvements; for example, if you create a scratch file, and then delete it 20 seconds later, it will probably never hit the disk. Unfortunately, the default VM tuning parameters, which can be controlled by /proc/sys/vm/dirty_expire_centiseconds and /proc/sys/vm/dirty_writeback_centiseconds, means that in practice, a newly created file won’t hit disk until about 45-150 seconds later, depending on how many dirty pages are in the page cache at the time. (This isn’t unique to ext4, by the way — any advanced filesystem which does delayed allocation, which includes xfs and the in the future, btrfs, will have the same issue.)

Essentially, the data for truncated and overwritten files is often cached in memory before actually hitting the disk, for performance reasons.  However, the file truncation doesn’t get cached, and if there is a system failure between the two operations, your files will simply be wiped clean with all previous and new data gone.  This happens frequently for desktop settings because hundreds of small hidden files are updated to maintain user preferences.  As a result, there is a relatively high probability that a truncation and rewrite operation could be happened at any time– including during a system failure.

By POSIX definition, this isn’t really a bug in ext4.  The state of a file after this type of crash isn’t clearly defined.  According to Theodore, it’s really a bug in the way desktop environments are writing their settings files:

[...] If your application is stupid, and has hundreds of dot files in your home directory, each one taking up a 4k disk block even though it is only storing 4 to 12 bytes of data in each singleton dot file, and you have to [write to disk] for each of your one hundred dot files — and worse yet, your application for some stupid, unknown reason is writing all of these hundred+ dot files every few seconds, then [writing to disk] will be very painful. But it is painful because the application is stupidly written — not for any fundamental filesystem fault. It’s like if you had a robot which was delivering mail to mail box numbers 1, 2, 3, 4, 5, and crossing the street for each mail box; on a busy road, this is unsafe, and the robot was getting run over when it kept on jaywalking — so you can tell the robot to only cross at crosswalks, when the “walk” light is on, which is safe, but slow — OR, you could rewrite the robot’s algorithsm so it delieveres the mail more intelligently (i.e., one side of the street, and then cross, safely at the crosswalk, and then do the other side of the street).

Regardless of what a permanant solution should include, there are a series of patches which are set to be included in the final Jaunty kernel to address this issue.  The patches are set to handle the crash situation similar to ext3– keeping the original version in-tact.  However, it comes at a price of performance.  Ext4 won’t be any slower than ext3, but the patch will negate many of the performance gains that ext4 previously achieved.

Once again, ext4 will likely be patched and fixed by the official Ubuntu Jaunty release.  However, it isn’t present in Jaunty Alpha 6, and hasn’t been pushed as an update yet (as of 3/12/09).  There is lengthy and ongoing discussion in the original bug report about possible long-term solutions.  In conclusion, be very careful if you choose to test out the new ext4 filesystem until it is patched.


Feb 26 2009

Linux For Computer Science Majors

Tag: linux, software, ubuntuScott Wegner @ 12:00 pm

TuxMy name is Scott Wegner, and I’m a Computer Science major at the University of Illinois, Urbana-Champaign.

I’ve had Linux installed as my primary OS for about 3 years, and as a computer science major, it’s certainly my environment of choice.  Not only does Linux deliver a rich desktop environment, but also the command-line and its vast number of utilities are indespensible for any sort of development.  It still suprises me, then, when I see other CS majors at my university who are so unfamiliar with Linux, and who cringe when any programming assignment requires Linux for one reason or another.  It got me thinking.

Our computer science department also has a number of computer labs with Linux machines, accessbile remotely and for physical access.  There are also a few Windows machines for those who prefer Visual Studio, although these machines are generally inferior when it comes to speed and stability.  So why do students still flock to them?  I think it’s because the courses at our university only give a terse introduction to Linux and the utilities that the course will require.  What we need is something that will really show students the ease and the power of Linux.  Maybe a 1-hour tutorial, perhaps a half-day workshop, or even a 1-credit hour introductory course.  Yes.

This wouldn’t be the sort of tutorial you see on the internet that praises Ubuntu for it’s robustness and claims that users should never need the terminal.  CS majors need to embrace the terminal and its utilities.  I asked earlier on identi.ca / twitter what people would talk about, and received a number of great responses.  There’s a whole list of tools that students need to be familiar with to really be productive.

  • grep, less, head, tail
  • vim, emacs
  • make
  • svn, cvs
  • ssh
  • man
  • awk,  sed
  • diff,  sdiff, colordiff

There’s also a lot of tools that would simply make their experience more pleasant, such as screen, rsync, latex, etc.  Having an understanding, or at least a crude familiarity of these utilities would certainly improve a student’s experience on projects which require them.  It may even convince them to try the faster Linux machines next time they visit the computer labs.

But how would one structure such a course?  I think a 1-hour weekly lab workshop would be the best setting.  The course could revolve around some simple in-class project that utilizes each of these tools.  Each week could introduce a new command, looking into it’s basic syntax and functionality, as well as providing links and resources to explore its advanced usage.  The majority of class time would be spent working on the project, trying each new command and using it to solve some basic problem.  The hands-on section would be crucial, as this is will instill the basic familiarity that students will hold with them for later courses.  I also think it would be useful to have extra time after class for “install-fests”.  This would give students the opportunity to install Linux at home and see if they would like it– either in a virtual machine, via Wubi, or on a physical drive.  They should be offered, optionally of course, once at the beginning of the semester, half-way through, and towards the end.

So what do you think– could something like this work?  Would it be helpful?  Have you heard of a university that provides something similar?  And what applications would you add to the list?  Let’s hear it in the comments.


Jan 03 2009

Hello 2009 and New Years Resolutions

Tag: blogging, execise, holidayScott Wegner @ 3:32 pm

Champagne CorkI’m a couple days late, but Happy New Years!  2008 was our inaugural year for automaticable, and it has been a huge success.


Let’s look back with some stats:

  • Total Posts: 147
  • Total Comments: 376
  • Total Visitors: 54,679
  • Number of Visiting Countries: 154
  • Number of Sites Linking Here: 364
  • Busiest Traffic Day: Sept. 21 (10,285 views)

Here are some of the most popular posts from our first year:

And as the New Year is upon us, I’d also like to make some personal goals for myself.  I don’t believe in New Years resolutions, but I do have a few things I’d like to improve in the upcoming year:

  • Run More: Last year I started excersing and running regularly, and even did a half-marathon in the Fall.  I’d like to keep it up, and push even harder this year.  If all goes well, I’ll be running the Chicago Marathon with a friend later this year.
  • Study More: I’m coming up on my last semester as an undergraduate, but it really doesn’t end there for me.  I just applied for graduate school, and hope to pursue a Masters in machine learning starting next Fall.  I want to end this year strong, and get ready for harder classes and more research in graduate school.
  • Revive automaticable: You may have notices lulls in posting during our first year.  This is mostly due to my own lack of time and motivation, but I’d like to fix that in 2009.  Brian has already alluded to a few changes we are planning in the site layout, and there’s a few other things we have planned as well.  Stay tuned.

These are my goals for 2009.  Have you made any for yourself?  And as we begin a new year for automaticable, what would you like to see more of on the blog?  Leave your thoughts in the comments.


Sep 22 2008

Purchase Non-Free (MP3, DVD) Media Codecs For Ubuntu Linux

Tag: deep thoughts, opinion, shopping, software, ubuntuScott Wegner @ 11:00 am

In this week’s Ubuntu Weekly Newsletter, there’s a link to an article on the Canonical Blog about their new offering of proprietary media codecs available for purchase.  Canonical has partnered with Fluendo and Cyberlink to give Ubuntu users a legal option for viewing and listening to their media.  This is similar to those who purchased a computer with Ubuntu preinstalled– generally there is a small premium factored in to have the media codecs pre-bundled.

This is a wise move by Canonical.  Giving their users a legal option for playing their media will encourage more software and companies to also invest in Ubuntu and all Linux media alike.  The announcement doesn’t quite make it clear, but it sounds like the Medibuntu repository will still be available with instructions for Ubuntu users to download similar codecs for free– illegally in many countries.  The adoption of the legal, non-free software will depend largely on how it is marketed inside Ubuntu.  That is, when you try to play an MP3 for the first time, will a dialog prompt you to purchase MP3 support, or offer an easier link to Medibuntu and the ubuntu-restricted-extras package?

One of the reasons that I moved to Ubuntu in the first place was so I could have software I wanted, free and legally.  It’s nice to finally have the option of legal media codecs as well.  What do you think of the announcement?  Will you pay the $40 for most non-free media codecs, or the additional $50 for DVD support?


Sep 20 2008

Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity

Tag: linux, open source, software, ubuntuScott Wegner @ 10:29 am

A couple weeks ago I bought a bluetooth adapter for my computer in hopes that I could easily backup my cellphone contacts on my computer.  I haven’t yet found a program to sync my cellphone data, but I did find a program to use your phone to lock and unlock your screen when you leave and come back to your desk.  With BlueProximity, your cellphone acts as a wireless “key” to your desktop.

Continue reading “Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity”


Sep 15 2008

Easy Subversion GUI for Nautilus and Ubuntu

Tag: how-to, software, ubuntuScott Wegner @ 4:47 pm

Just about every software project uses some sort of versioning control system, and subversion is arguably the most popular tool.  Having your files versioned and backed up in a central repository is essential.  I’ve written about how to set up your own subversion repository, but you can go a step further and install a graphical interface to use subversion right within Nautilus.

Installing and setting up the subversion GUI is as simple as three commands.

  1. Install the nautilus-script-collection-svn package:
    sudo aptitude install nautilus-script-collection-svn
  2. Enable the plugin (this is required to access the plugin from nautilus):
    nautilus-script-manager enable Subversion
  3. Restart Nautilus:
    killall nautilus

Afterwards, Nautilus will have a new entry in the context menu when you right click.  You can now access most basic subversion commands without touching a terminal.

The interface isn’t quite as pretty as some Windows clients, such as TortoiseSVN.  However, it is still a nice alternative for users who prefer a GUI and only need basic functionality.  There doesn’t seem to be any support for merges, and other commands will use the default parameters.


Sep 12 2008

Organize Your ToDo List in Ubuntu with Remember The Milk and Tasque

Tag: how-to, linux, open source, productivity, software, ubuntuScott Wegner @ 8:22 pm

I am a big fan of the previously mentioned Remember The Milk productivity webapp.  It does one thing– manages your Todo list– and it does it very well.  Remember The Milk offers a clean web interface, as well as integration inside Gmail, Google Calendar, and even has an iPhone app.  The only thing that was missing for me, though, was a simple interface for the Linux desktop.  Enter Tasque.

Continue reading “Organize Your ToDo List in Ubuntu with Remember The Milk and Tasque”


Sep 11 2008

I Owe You Some Updates

Tag: commentsScott Wegner @ 9:30 am

I’m thinking about writing about 5 new posts this weekend.  Any requests?


Jul 25 2008

Peace Out, Illinois

Tag: competition, holiday, travel, vacationScott Wegner @ 6:35 am

Woo, we’re on vacation!  That’s right, the bro’s drove down from Downers Grove last night, and we’re Georgia-bound this morning.  The next 8 days are to be spent hiking, fishing, swimming, canoeing, and all-around have a good time.  We’ve got a few competitions laid out so far, but I think the whole week will be competitive craziness.  I’m talkin’ watermelon seed spitting contest, Euchre tournament, and “who will-jump-over-the-fire-naked” bets.  Anything goes this week.  We are on the road in less than 35 minutes.  Later, automaticable.

PS: In case you weren’t following, yes, Kyle does owe me 22.22 beers this vacation.  And yes, I did make my 50 mile goal.  And yes, I am doing the Chicago Half Marathon in September (more on that later).  I’m not really sure what kind of beer it’ll be yet– any suggestions?


Jul 06 2008

Cooking Cheap Snacks 101: Granola Bars

Tag: cookingScott Wegner @ 9:34 pm

Tonight Stacy and I decided to make our own granola bars, and they turned out pretty darn good.  I had been wanting to try making them for a while now, and finally got around to it.  It’s a great snack to make because it’s relatively easy to make, pretty healthy, you can throw in whatever you want, and really cheap.  We made a 9″ x 13″ tray of granola bars for around $5 in ingredients (not to mention they were mostly organic).  And the best part, is they’re delicious.  We’re talking:

  • Rolled Oats
  • Flour
  • Brown Sugar
  • Raisins
  • Chocolate Chips
  • Walnuts
  • Almonds
  • Honey
  • Sunflower Seeds
  • Vanilla
  • Salt, canola oil, etc.

I mean, it sounds great, doesn’t it?  And now I have snacks for the next couple weeks– cool.  I can’t wait to make it again, there’s already a few other things I want to try (namely, peanut butter, mmmm).

Does anybody else have a tasty they like to make?  Or perhaps the missing ingredient to my nearly-perfect granola bars?  Let’s hear it in the comments.


Next Page »