Saturday, August 23, 2008

Considerations before you install

I think many of us could truthfully say that if we had known a bit more about the basics of Linux installs, we would have installed a little more wisely than we did initially. My intention here is call attention to some of these basics and make a few helpful suggestions that may aid new users in their first journey into Linux.

Things that could/should influence your partitioning layout:

1) Partitions closer to the outside of the hard drive disk, ie. at the top of your partition table and to the left in the Gparted graphic, are faster than partitions on the inside of the hard drive disk, or closer to the bottom of the partition table.

2) Smaller partitions are faster than larger partitions.

3) Swap partitions don't need to be any larger than 2X your system ram. And, the sum of system ram and swap shouldn't exceed 4 Gig. If it does, reduce the swap partition size to get back to 4 Gig. or less. If you have 4 Gig. of ram on a 32 bit system like Mint, make a very small swap partition anyway, as the kernel expects to have a swap partition available. Not having a swap partition slows the kernel down in certain situations. For this purpose, there is no need for the swap partition to be over 256 KB at most.

4) If you have more than one hard drive, split your swap partition up between all your drives, creating a small swap partition on each drive. Linux will recognize and combine them all and your swap will be much much faster when you need it. It is almost like a raid 0 set-up. Swap will strip across drives.

5) Journaled file systems like ext3 are much better at maintaining read/write data integrity in case of power failure or some other unexpected crash or failure.

6) Journaled files systems also represent more overhead to the kernel and take more space on the hard drive for the file system structure itself. There is no advantage to using a journaled file system on a partition that will rarely be written to. /boot is a good example of this. It is almost never written to, so if you use a separate /boot partition, it should be ext2 and not ext3.

7) If you use a separate /boot partition, it doesn't need to be more than about 256 MB. This still leaves plenty of space for extra kernels and boot notes.

8) Your data should be isolated from your main install to protect it and easily enable upgrades and reinstalls.

The truth of the matter is that all the installer routines that I am familiar with do a pretty poor job of doing a default install. They just aren't very smart. They work, and serve the purpose of enabling a successful install in most cases. But they don't install very smart. They usually put everything in one partition and spread it out across all the available space. Looking at the above list you can see this is a bad idea for a variety of reasons.

I guess due to natural curiosity and the understandable lack of familiarity with Linux, most new users will break their installs at least once in the first six months and need to reinstall. As most are aware, this leaves you in a position to loose your data or jump through lots of hoops trying to save it, if you have done a default install.

I am going to suggest two very basic partitioning schemes for general purpose desktops that will give you good speed, conserve hard drive space, and provide reasonable data integrity and isolation, and a safe upgrade path.

The first is the well know method of using a separate /home partition. All the user's data is in /home so putting /home on a separate partition effectively isolates it from the rest of the install, the part that most often breaks. This eases upgrades too, although it isn't a perfect solution.

swap -----Formatted as swap ----per above rules
/ -----------Formatted as ext3 -----10 – 12 Gig.
/home ---Formatted as ext3 ------Whatever you need

The other method uses dedicated data partitions that aren't part of the Linux install at all. This is the safest, fastest and most flexible method, and makes for almost painless reinstalls and upgrades, but is a little more difficult to set up initially.

swap ----Formatted as swap -----per above rules
/ ----------Formatted as ext3 ------10 – 12 Gig.

Data Partition1 ----Formatted as ext3 -----sized for data
Data Partition2 ----Formatted as ext3 -----sized for data
Data Partition3 ----Formatted as ext3 -----sized for data

You can have as many or as few data partitions as you see fit. You would mount them in your /home directory, let's say as Multimedia, Pictures, and Documents, as an example. They would be easily available in your /home folder but the data itself would be safely on its' own partition or partitions. If you had a Windows XP install, one of your data partitions could be formatted NTFS so that it could be easily shared.

You could of course combine the two methods I showed above, but I see no advantage in doing so. You could also have a separate /boot partition, which would make either install slightly faster, but with modern equipment you probably wouldn't notice the difference.

This was not written to give you step-by-step instructions on how to accomplish these set-ups but to give you something to think about before you jump into your first install, or perhaps your first reinstall. :-)

Fred

No comments: