::upgrade vs. clean install–bad idea

5 11 2009

There’s a post on Slashdot today linking to an article from The Register, talking about how throngs of people are having difficulties upgrading from Ubuntu 9.04 to 9.10.  I’m a little surprised that the Register article has what I think is a very misleading title–Early Adopters Bloodied by Ubuntu’s Karmic Koala.

When you read into the article a bit, you quickly learn that the early adopters being referred to here are people who are doing inline upgrades using the Ubuntu Update Manager.  Personally, I can’t think of any time I’ve ever had a good experience that ended with a solid, glitch-free machine when doing an upgrade over a clean install.  I can’t think of a single good reason to do an upgrade over a clean install.  Not one.

There are reason, mostly incorrect, that people think they should do an upgrade over  a clean install from the CD.  Most often, people think they will lose their documents and settings, or that saving these will be a pain.  First off, if you have a separate /home partition, this is absolutely wrong.  And if you don’t have a separate /home partition, this is as good a time as any to save your stuff the old fashioned way one last time, and do an installtion with a /home partition. The other reason people don’t want to do a clean install is they don’t want to lose their apps.  There are very simple ways to document installed applications and then automatically install them on a freshly installed machine–I did it just a couple of days ago and it took 2 minutes of typing and then less than an hour to install everything.

I’m gonna go out on a limb and just say it:  upgrading an OS–any OS–instead of doing a clean installation is a stupid idea.  It takes longer, core functions break, you don’t get full the full functionality of the OS (in the case of Ubuntu 9.10, you don’t get the upgrade to GRUB 2.0) and some programs just don’t work right.  Ubuntu.com reports that an online upgrade takes about 2 hours on average, depending on your Internet connection speed.  By comparison, it takes less than 20 minutes from start to finish for an installation via CD, and that includes the scary process of manually setting the partitions that makes so many people opt to go for an online upgrade instead.

And on that subject, setting the partitions really isn’t that big of a deal.  The installer’s warning makes it seem like a very intimidating process, but it’s totally straight forward.  All you have to do is pay attention to what you’re doing.  If you already have a /home partition, the hardest part is setting the same partition to be /home, and making sure you don’t put a check mark in the format box.  If you’ve ever installed a Windows OS, you can install Ubuntu in less time and with no headaches.





::fun with signature files

30 11 2007

Fortune is an itsy bitsy program in just about every Linux distribution that will give you a random quote when run.

jim@ingsoc:~$ fortune
Q: What do they call the alphabet in Arkansas?
A: The impossible dream.

This can make for minutes of fun if you’re staring at a command line wondering what to do next, but what if you want to do a little more with it?

I sometimes like to have a little fun with my email signature file, and a few months ago I thought it might be cool if I could generate a fortune for my email signature. Like a lot of people, I sometimes write a lot of email, and having to copy and paste a fortune every time I wrote an email would make the novelty quickly wear off. Instead, I decided to utilize the incredible power of bash scripting for this completely pointless endeavor. Following these simple steps can let you be as eL33t as me. Really.

And you know you want to be that cool.

So, here’s what I did.

First off, I made a directory in /home called sigs. This is just a handy place to put all of this coolness. Then inside that directory, I created a file called sigs. There’s some standard text that I want in all of my signatures, so I inserted that text. So far, that’s this:

jim@ingsoc:~$ mkdir sigs
jim@ingsoc:~$ cd sigs
jim@ingsoc:~/sigs$ nano sig

then you just insert your static text. In my case, that’s:

g o t j i m ?

Now here’s where it gets really cool. Ready?

Fire up your favorite text editor–in my case, this is nano. Insert the following text:


#Create a sig file based on fortune.

cp ~/sigs/sig.original ~/sigs/sig.new
/usr/games/fortune >> ~/sigs/sig.new
mv ~/sigs/sig.new ~/sigs/sig

Save the file and give it an obvious name. I chose sigmaker, but you can name it whatever you damn well please. I’m flexible like that.

Now, save the file and make it executable with chmod +x sigmaker.

Run it with a simple .sigmaker, and view the output with less sig.

g o t j i m ?


Please remain seated until the ride has come to a complete stop.

Ohh, ahh.

Now you simply point your email program to your signature file. In the case of Thunderbird, you do this by going to Edit/Account Settings, and point to /home/you/sigs/sig. Open a new message to compose, and see your awesome skills in action.

But we’re not done here. Oh no. If you stop here, then the file never changes, and that defeats the point. So we’ll add this little slice of pimpness to our crontab for some real fun.

jim@ingsoc:~/sigs$ crontab -e

And do a little something like this:

# m h dom mon dow command
* * * * * /home/jim/sigs/./sigmaker

This will run sigmaker once every minute, giving you a new signature file with just about every email you write. You, of course, can change the timing however you like.

And there you have it, kids. A complete waste of time that’s good and good for you.



::Dell Linux Projects

9 02 2007

A lot has been made in the Linux community about the support, and\or lack thereof, that Dell provides to the Linux community. You’ve been able to get RedHat installed out of the box on some servers for a few years now, and there’s been talk on and off of Dell providing Linux installation options on their desktops and laptops, but this has never come to pass. Maybe someday they will at least drop the Microsoft tax and give users the option of not having any operating system installed out of the box.

Not many folks know, however, that Dell does quietly support the open source community with a set of projects designed to make life easier for enterprise sysadmin and home user alike.

I stumbled across the main project page while looking for a method of upgrading my laptop’s as-shipped version A00 BIOS version to the current A08 version and found a cool project called Biosdisk that did the job nicely.

Here’s the thing that I love about the Open Source community in general, and what I found to be really cool about Dell’s Linux support: I tried running the program and ran into some problems. I tried on my own to figure them out and failed, and didn’t think there was much hope. The last release of Biosdisk was back in 2004–probably not likely that anyone would devote any time to a random dumbass with a problem.

But I emailed the project maintainer explaining my problem. I got a response back in less than two hours correcting my syntax. This didn’t work, and I emailed back the results. He took it home and tried it on his own Ubuntu box, found a problem, and sent me a revision.

The revision worked fine, and he even thanked me for finding the bug!

So if you own a Dell, go over and poke around a little. And if your OEM doesn’t have much public Linux support, check out their site anyway and poke around a little. Maybe they support it on the downlow.



::excellent speed tweaks

15 01 2007

The other day I stumbled across this page on digg that purported to have some excellent speed tweaks for Ubuntu. I usually check out these pages, but I don’t typically follow their recommendations, just because I’m a little skeptical.

For some reason, I decided to try a couple of things listed.


Significant improvement.

I didn’t do everything, and your mileage, as always, may vary.  I highly recommend that you check it out and give it a try.  You will very probably be happy about the results.

And, as has been pointed out extensively on Digg, these tweaks are not specific to Ubuntu.  Linux users of just about any distribution can benefit form these steps.




5 01 2007

So, this morning I was working with a script I wrote yesterday that I was having some problems with.  I decided to troubleshoot it, so I copied it from /bin to my home directory and decided to remove the execute permissions from the copy in /bin rather than removing it entirely.

I would swear that I type: sudo chown -x /bin/sigmaker, sigmaker being the name of the script.

Apparently, I typed something else.

Because immediately after that, I couldn’t execute any commands.

ls? command not found.

cp? command not found.


command not found.

So, I reinstalled.

And I am once again very happy that /home is it’s own partition.  If you don’t have /home on it’s own partition, I highly recommend it.




::got root?

14 11 2006

One of the most common questions posed by people new to Ubuntu has to do with root.  Brand new users usually know enough about Linux in general that they wonder why they didn’t have to create a root password, and experienced Linux users catch it right off the bat. 

Ubuntu disables the root account by default, opting instead to use sudo for administrative or root-like functions.  Since Ubuntu 6.06, users who attempt to perform an administrative function are prompted for their own password.  Prior to 6.06, users would be prompted for the root password, but this was a terminology bug–what the system was really looking for was that user’s password.

While this works well for 99.9% of the people out there, there are times when you don’t want to throw sudo at the start of every line to get something done.  If you would like to enable the root account and set a root password, all you do is:

sudo passwd root

You’re prompted for your password (because you invoked sudo), then you’re asked to enter a password for root, and confirm it. 

If you want to disable root, enter this at a command prompt:

sudo passwd -l root (that’s a lower-case L for lock)

Can I login graphically as root?

You can, but it is really not a good idea to enable this functionality.  It’s such a bad idea, in fact, that I’m not going to tell you how to do it.  If you really want to know, you can look here.

Starting graphical apps as root

I’ve mentioned it before, but it’s worth mentioining again.  If you need to run a graphical application as root to, for example, update a configuration file or something, you don’t want to use sudo, as this will cause permissions problems later on that will prevent you from logging into your X session. 

Instead, you’ll use a slight modification of sudo.

In Ubuntu (gnome), Edubuntu, and Xubuntu, use gksudo appname

In Kubuntu, use kdesu appname

And that’s all there is to it. 



::getting ready for edgy, part duex–backups

21 10 2006

In this exciting episode, we’ll talk about the incredibly mundane and unsexy topic of backing up your key files and folders prior to making the move to Edgy. If backups are a normal part of your life, you can skip this. If not, they should be. I’ll do an entry at some point in the future talking about how to do regular backups. For this entry, though, I’m making a few assumptions:

  1. You don’t do regular backups of any kind.
  2. You have important files that you want to retain.
  3. You don’t have a second computer with linux installed, or it doesn’t have adequate space for your purposes.
  4. You have space enough to back up your data without having to wrestle for space.


Planning what you want to back up and how you want to do it is very important in terms of time taken to do your back up, the ease in getting it back, and storing it for the long term, if you want to. It is not necessary to back up your entire system, but you could do that if you wanted to and had the resources. My emphasis here will be in backing up your /home directory, as that is where most people store their personal files that they would want to keep.

Not everyone does this, though, and it is important that you take an inventory of your system before your upgrade to make sure you’re not missing anything. Be sure you look for directories on other paths to make sure you’re not missing anything. Where do you keep your writing? Your web site? Your mp3s? Your photos? Here’s how I plan out my backups:

What to Back Up?

  • Make a list of the types of files you want to save. Not necessarily the file types, but the category they would fall into. For example; music, photos, writing, ebooks, movies, and so on as you see fit. Don’t forget your email address book and your browser bookmarks.
  • Go through your /home directory and document where each file type is stored. If there are multiple users on your system, it would be a good idea to do this for each one.
  • Go through the rest of your hard drive and make sure you don’t have those files elsewhere, as well.
  • Write down all of directories that have files you want to keep. If your organization is spotty, you might want to take this opportunity to put your files into some logical order. If you move things, be sure to update your list.
  • Make a list, check it twice. You don’t want to do a back up only to discover you forgot that one really important set of files.
  • Get a rough estimate on how much space all of this is going to take up.

Where to Put it?

Now you need to plan out where you’re going to put all of this stuff you want to save. In a perfect world, you’ve got a spare disk (maybe external?), with enough space for everything you want to save. If this is the case, it makes life a lot easier. If not, hope is not lost.

Most likely, you’re going to end up putting your data on a spare disk or on some static media like a DVD or CD. A spare disk is probably the easiest way to go, but if you don’t have one, DVDs or CDs are still viable options. Depending on the total amount of data you’re retaining, you might end up using a lot of DVDs\CDs.

How to Back Up

There are a slew of ways you can back up your data. Some are easier than others, some are more complicated than others. For this example, I’m going to use rsync. Rsync is a simple and robust tool that you can use now and with your regular backups.

  • Backing up to a Spare Disk

So, let’s say you’ve want to save your /home directory (about 5GB, let’s say) and your music directory, which is actually off of the root tree in /mp3. You’ve got a 200GB external USB drive with plenty of space.

Sweet. This will be easy.

Once your external drive is plugged into the system, you’ll most likly find a new mountpoint in /media, called something like /usbdrive. The full path would be something like /media/usbdrive. For the sake of organization, I would create separate destinations for each unique path. So in /media/usbdrive, I’ll make a directory called /home_backup and another called /mp3_backup.

cd /media/usbdrive

mkdir home_backup

mkdir mp3_backup

Now we start the back up:

rsync -avrc /home/yourusername/ /media/usbdrive/home_backup

Here’s what we did:

The switches:

  • -a does the transfer in archive mode, so your permissions, symbolic links, etc. are preserved.
  • -v does the transfer in verbose mode, so rsync will tell you what it is doing. This is optional; I like to have it around.
  • -r does the transfer recursively into all subdirectories.
  • -c forces a checksum to make sure there were no errors in the copying process.

The rest:

  • /home/yourusername is the source directory
  • /media/usbdrive/home_backup is the–that’s right, you guessed it–destination directory.

This is going to take a while, most likely, and is incredibly boring to watch. Really. Once it is complete, you’ll do the same thing for the other data you want to back up, changing the source and destination as appropriate.

Backing up to a directory on the same partition

This is just as easy as backing up to an external drive, with a few extra steps and a little more time.

Navigate to the root directory and make a back up directory, then take ownership of it.

cd /

sudo mkdir backups

sudo chown yourusername:yourgroupname backups

Now again, we want to have separate directories for each destination.

cd backups

mkdir /home_backup

mkdir /mp3_backup

And now for the backup itself:

rsync -avrc /home/yourusername/ /backups/home_backup

Repeat for any other directories you want to save.

many hours later….
Your backups are complete, now what?

Verifying Your Backups (either method)

Now that you’ve got your backups completed, you’ll want to double-check them and make sure that your data has been preserved.  The -c switch did this for you, making sure that all of the file sizes matched up okay, but I’m paranoid and always want to check for myself.

Do this by simply browsing the files and checking them at random, maybe 20-30.  If there’s anything that’s really important, you might want to check the whole directory.
Moving Your Backups to Other Media

Now that you’ve got everything backed up and verified, it is time to move everything to your (hopefully) DVDs or (ick) CDs.  I’m sure there are better ways to do this that are far more elegant, but I just select blocks of files and burn them using k3b (or Gnomebaker, if you go that way).

Once you’ve moved your data to your DVDs, be anal and verify them again.  It would lame to go to all this trouble, only to find there was an error and you’ve lost your shit.  That, I think, would make me lose my shit in a big way.

Next time…on to the upgrade!