A Quick Guide to Linux Partition Schemes
What partition setup should you use when dual-booting Windows and Linux? Should you have a separate partition for /home? Why do some people put /boot into its own partition? These are the questions that have plagued mankind since the dawn of time (or thereabouts). This guide aims to answer some of those questions and demonstrate some partition schemes that may save you some space, hassle, or data loss down the line.
I should note that we won’t be covering the “how” of partitioning, but the “why”. There are multiple reasons for this. For one, the specifics of how will vary widely from system to system and there is no way I can know what would work best for your particular setup. Also, in all honesty, I don’t want to be responsible if the partitioning goes wrong and you lose that video file with the alternate ending to Quantum Leap.
If you would like a detailed guide on the “how” aspect, take a look at Damien’s article How To Resize And Create Partitions With Gnome Partition Editor.
Note: For the sake of simplicity, all the charts in this guide will be based on a 100GB drive, and will not show the swap partition. If you follow any of the schemes shown here, you’ll probably want to add a small swap partition in there somewhere. I usually stick mine at the end of the drive.
Windows Dual Boot
With the right partition setup, dual booting with Windows is a breeze. With a poor setup, it can be an infuriating pain. The most important thing to note when planning a dual-boot setup is that many versions of Windows expect to be the one and only OS on the system. Often, Windows doesn’t like being on anything other than the first partition of the first drive, and will not hesitate to wipe out anything in its way. You’ll save yourself a LOT of trouble by knowing this ahead of time and allowing Windows to occupy that slot before installing Linux.
In this example, we’ve created a 50GB Windows partition as the first partition on the drive. Install Windows first, and once it’s all finished, go ahead and install your Linux of choice on the remaining space. Just about any modern Linux will see the Windows installation and automatically add it to your boot menu.
/home
One of the most common setups for Linux is to separate /home partition. There are several advantages for this. The first is that it lets you limit the amount of space that can be taken up by user files (this will be a common theme among the setups discussed here). More importantly, keeping these files separate means whatever may happen to your system files (in “/”) your home will be left alone. This means that you could reinstall your entire OS, but leave your application and desktop settings exactly the way they were.
For example, let’s say you’re running Ubuntu 9.04 with /home as its own partition. You’ve got lots of files saved in your home along with all your desktop settings, Firefox bookmarks, conky config, etc. If you decide to reinstall or upgrade, you can wipe the whole system while leaving your home intact. Once the reinstall/upgrade is done, you’ll have all your files and settings just the way you left them.
You can, of course, adjust the sizes of the partitions to meet your needs. If you don’t plan to install many programs in the root partition, you can drop that down to 10 or 20 GB and leave the rest for user files, or vice versa.
/boot
Many people set up a small boot partition separate from the root. In my experience, this comes in handy if you’re running multiple distros on the same machine. Since the /boot partition is where Linux stores the kernel and GRUB menu, this lets you share boot information across both distros. If you like to build custom kernels (more fun and easy than it sounds) you can place your custom kernel in the boot partition, and let both distros run off a single custom kernel.
The /boot partition does not need to be large. Unless you plan on loading up tons of kernels, 100MB should probably do the trick just fine.
/usr
Another common technique is to give /usr a partition of its own. A lot of things live in /usr, like most of the binaries you’ve added after the initial install. If you want to put a limit on the amount of space that can be taken up by user-installed programs, this is one way to do it.
Since so many things live in /usr, you’d want to give it a fair amount of space.
/var
A common practice on servers is to put /var into its own partition. This is usually done to keep a lid on the amount of space that can be taken up by things like log files.
Exactly what size to make the /var partition can vary widely depending on how you use your system. Most desktop Linux users probably shouldn’t need to worry about a /var partition.
What NOT to Partition
There are some parts of the filesystem you want to keep in root. Items in /bin, /lib, and /etc are often needed immediately at boot time, and if they’re on separate partitions, they may not be mounted before they’re needed. For example, /lib usually contains some kernel modules that will likely be needed immediately upon booting the kernel. If the partition is not yet loaded, things could get nasty.
Some say that /usr could fall in this same category. I’ve personally never had a problem with a /usrpartition, but that may be something to keep in mind before you start chopping up your drive.
Nguį»n: http://www.maketecheasier.com/quick-guide-to-linux-partition-schemes/
Post a Comment