Thursday, January 01, 2009

4 Ways to Make a Linux Reinstall Easier

I tend to grow dissatisfied with my current Linux distribution from time to time, and start looking around at other distributions. As I've done this, I've learned a few tricks that make it a lot easier and faster to get the new setup running and working for me.

1) Separate partition for /home


I can not stress this point enough. All of your configuration settings are stored in your user account under /home. All of your documents, downloads, wallpapers, etc. are stored in your user account. Any program settings are stored in /home. Generally, all files that you have created or worked on live somewhere in /home. If you have a separate partition for /home then you can reinstall Linux and have it configured (on a user level) the same way the old install was.

If you don't currently have a separate partition for /home, then you should make sure to create one during your next Linux install. It will make all future installs a lot easier.

If you have any important files elsewhere in your filesystem (like a webpage you've put in /var/www) then you might want to consider making that a separate partition as well, or at least have backups.

The only issue I've ever had with this is with the default user id the distributions use. You need to make sure that the your users have the same uid as they had on the previous distribution, or chown their home directories so that they belong to the proper users.

2) Multiple partitions for installing


This one is a little less obvious, but it has been very good to me. I like to have more than one partition for installing Linux. I alternate which partition I use for every install so that I always have my previous install to go back to. If something isn't working in my latest Arch install, I can just boot back into Debian. If the latest Ubuntu install has issues then I can boot into the previous version.

I like to have 10 GB partitions for linux installs. I usually only use about half of that, but it leaves room for growth without eating up too much disk space. The rest of my disk is usually reserved for my home partition.

3) Keep a list of your commonly installed packages


If you're switching from one Debian based distro to another, then a combination of dpkg and dselect can be very useful. Look here for more information: http://mybrainrunslinux.com/node/2

Whether you're using yum, rpm, yast, pacman, or dpkg you can get a list of installed packages and use that as a guide for what you'll need to reinstall in your new distribution. If you do this very often you will probably become very familiar with the packages you need to get everything back to normal.

4) Use Foxmarks (if you use Firefox)


Ok, this one isn't very useful if you're reinstalling on the same computer and using a separate partition for home, but it is very nice if you are installing on a different computer or if you don't have a separate home partition. Foxmarks is a Firefox extension that synchronizes bookmarks. If you use it then all you have to do in a fresh install is install the plugin and synchronize your bookmarks. Where this plugin really shines for me is multiple computer use. Whether I'm using my work computer, my home computer, or any other computer where I have an account, I have the same set of bookmarks. I love it. If you're concerned about hosting your bookmarks on somebody else's server, you can always configure Foxmarks to save its file on your own server.

Conclusion


I titled this post "4 Ways to Make a Linux Reinstall Easier", but most of the points in here could equally apply to making it easier to move to a new computer. Some of them make it easier to simultaneously use multiple computers that all have the same user settings and data. Hopefully some of these tips can make the process a lot easier for you.

If all you want to do is try out a new distribution, you do have an alternative--Virtual Box (or VMWare, or etc). You can install Linux in a virtual machine (whether you're running Linux, Windows, or Mac) and run it without having to worry about partitions and without erasing your current operating system.