Skip to content

Appendix B. Partitioning for atomeOS

Sai Vittal B edited this page Jul 12, 2020 · 2 revisions

Appendix B. Partitioning for atomeOS

B.1. Deciding on atomeOS Partitions and Sizes

At a bare minimum, GNU/Linux needs one partition for itself. You can have a single partition containing the entire operating system, applications, and personal files. Most people feel that a separate swap partition is also a necessity, although it's not strictly true. In fact, since atomeOS 1.0 a swap file rather than a swap partition is now used by default. “Swap” is scratch space for an operating system, which allows the system to use disk storage as “virtual memory”. Linux may use a separate swap partition more efficiently compared to a swap file, but on the other hand side, a swap file wastes less disk space compared to a permanently allocated swap partition.

Most people choose to give GNU/Linux more than the minimum number of partitions, however. There are two reasons you might want to break up the file system into a number of smaller partitions. The first is for safety. If something happens to corrupt the file system, generally only one partition is affected. Thus, you only have to replace (from the backups you've been carefully keeping) a portion of your system. At a bare minimum, you should consider creating what is commonly called a “root partition”. This contains the most essential components of the system. If any other partitions get corrupted, you can still boot into GNU/Linux to fix the system. This can save you the trouble of having to reinstall the system from scratch.

The second reason is generally more important in a business setting, but it really depends on your use of the machine. For example, a mail server getting spammed with e-mail can easily fill a partition. If you made /var/mail a separate partition on the mail server, most of the system will remain working even if you get spammed.

The only real drawback to using more partitions is that it is often difficult to know in advance what your needs will be. If you make a partition too small then you will either have to reinstall the system or you will be constantly moving things around to make room in the undersized partition. On the other hand, if you make the partition too big, you will be wasting space that could be used elsewhere. Disk space is cheap nowadays, but why throw your money away?

B.2. The Directory Tree

atomeOS adheres to the Filesystem Hierarchy Standard for directory and file naming. This standard allows users and software programs to predict the location of files and directories. The root-level directory is represented simply by the slash /. At the root-level, all atomeOS systems include these directories:

Directory Content
bin Essential command binaries
boot Static files of the boot loader
dev Device files
etc Host-specific system configuration
home User home directories
lib Essential shared libraries and kernel modules
media Contains mount points for replaceable media
mnt Mount point for mounting a file system temporarily
proc Virtual directory for system information
root Home directory for the root user
run Run-time variable data
sbin Essential system binaries
sys Virtual directory for system information
tmp Temporary files
usr Secondary hierarchy
var Variable data
srv Data for services provided by the system
opt Add-on application software packages

The following is a list of important considerations regarding directories and partitions. Note that disk usage varies widely given system configuration and specific usage patterns. The recommendations here are general guidelines and provide a starting point for partitioning.

  • The root partition / must always physically contain /etc, /bin, /sbin, /lib and /dev, otherwise you won't be able to boot. Typically 150–310MB is needed for the root partition.

  • /usr: contains all user programs (/usr/bin), libraries (/usr/lib), documentation (/usr/share/doc), etc. This is the part of the file system that generally takes up most space. You should provide at least 500MB of disk space. This amount should be increased depending on the number and type of packages you plan to install. A standard atomeOS desktop requires a minimum of 1.5GB here.

  • It is now recommended to have /usr on the root partition /, otherwise it could cause some trouble at boot time. This means that you should provide at least 600–750MB of disk space for the root partition including /usr.

  • /var: variable data like news articles, e-mails, web sites, databases, the packaging system cache, etc. will be placed under this directory. The size of this directory depends greatly on the usage of your system, but for most people will be dictated by the package management tool's overhead. If you are going to do a full installation of just about everything atomeOS has to offer, all in one session, setting aside 2 or 3 GB of space for /var should be sufficient. If you are going to install in pieces (that is to say, install services and utilities, followed by text stuff, then X, ...), you can get away with 300–500 MB. If hard drive space is at a premium and you don't plan on doing major system updates, you can get by with as little as 30 or 40 MB.

  • /tmp: temporary data created by programs will most likely go in this directory. 40–100MB should usually be enough. Some applications — including archive manipulators, CD/DVD authoring tools, and multimedia software — may use /tmp to temporarily store image files. If you plan to use such applications, you should adjust the space available in /tmp accordingly.

  • /home: every user will put his personal data into a subdirectory of this directory. Its size depends on how many users will be using the system and what files are to be stored in their directories. Depending on your planned usage you should reserve about 100MB for each user, but adapt this value to your needs. Reserve a lot more space if you plan to save a lot of multimedia files (pictures, MP3, movies) in your home directory.

B.3. Recommended Partitioning Scheme

For new users, personal atomeOS boxes, home systems, and other single-user setups, a single / partition (possibly plus a separate swap) is probably the easiest, simplest way to go. However, if your partition is larger than around 6GB, choose ext3 as your partition type. Ext2 partitions need periodic file system integrity checking, and this can cause delays during booting when the partition is large.

For multi-user systems or systems with lots of disk space, it's best to put /var, /tmp, and /home each on their own partitions separate from the / partition.

You might need a separate /usr/local partition if you plan to install many programs that are not part of the atomeOS distribution. If your machine will be a mail server, you might need to make /var/mail a separate partition. Often, putting /tmp on its own partition, for instance, 20–50MB, is a good idea. If you are setting up a server with lots of user accounts, it's generally good to have a separate, large /home partition. In general, the partitioning situation varies from computer to computer depending on its uses.

For very complex systems, you should see the Multi Disk HOWTO. This contains in-depth information, mostly of interest to ISPs and people setting up servers.

With respect to the issue of swap partition size, there are many views. One rule of thumb which works well is to use as much swap as you have system memory. It also shouldn't be smaller than 16MB, in most cases. Of course, there are exceptions to these rules. If you are trying to solve 10000 simultaneous equations on a machine with 256MB of memory, you may need a gigabyte (or more) of the swap.

B.4. Device Names in Linux

Linux disks and partition names may be different from other operating systems. You need to know the names that Linux uses when you create and mount partitions. Here's the basic naming scheme:

  • The first floppy drive is named /dev/fd0.

  • The second floppy drive is named /dev/fd1.

  • The first hard disk detected is named /dev/sda.

  • The second hard disk detected is named /dev/sdb, and so on.

  • The first SCSI CD-ROM is named /dev/scd0, also known as /dev/sr0.

The partitions on each SCSI disk are represented by appending a decimal number to the disk name: sda1 and sda2 represent the first and second partitions of the first SCSI disk drive in your system.

Here is a real-life example. Let's assume you have a system with 2 SCSI disks, one at SCSI address 2 and the other at SCSI address 4. The first disk (at address 2) is then named sda, and the second sdb. If the sda drive has 3 partitions on it, these will be named sda1, sda2, and sda3. The same applies to the sdb disk and its partitions.

Note that if you have two SCSI host bus adapters (i.e., controllers), the order of the drives can get confusing. The best solution, in this case, is to watch the boot messages, assuming you know the drive models and/or capacities.

Linux represents the primary partitions as the drive name, plus the numbers 1 through 4. For example, the first primary partition on the first drive is /dev/sda1. The logical partitions are numbered starting at 5, so the first logical partition on that same drive is /dev/sda5. Remember that the extended partition, that is, the primary partition holding the logical partitions, is not usable by itself.

B.5. atomeOS Partitioning Programs

Several varieties of partitioning programs have been adapted by Debian and atomeOS developers to work on various types of hard disks and computer architectures. Following is a list of the program(s) applicable for your architecture.

partman

Recommended partitioning tool in atomeOS. This Swiss army knife can also resize partitions, create filesystems (“format” in Windows speak) and assign them to the mountpoints.

fdisk

The original Linux disk partitioner, good for gurus.

Be careful if you have existing FreeBSD partitions on your machine. The installation kernels include support for these partitions, but the way that fdisk represents them (or not) can make the device names differ. See the Linux+FreeBSD HOWTO.

cfdisk

A simple-to-use, full-screen disk partitioner for the rest of us.

Note that cfdisk doesn't understand FreeBSD partitions at all, and, again, device names may differ as a result.

One of these programs will be run by default when you select Partition disks (or similar). It may be possible to use a different partitioning tool from the command line on VT2, but this is not recommended.

Remember to mark your boot partition as “Bootable”.

B.5.1. Partitioning for 64-bit PC

If you have an existing other operating system such as DOS or Windows and you want to preserve that operating system while installing atomeOS, you may need to resize its partition to free up space for the atomeOS installation. The installer supports resizing of both FAT and NTFS filesystems; when you get to the installer's partitioning step, select the option Manual and then simply select an existing partition and change its size.

The PC BIOS generally adds additional constraints for disk partitioning. There is a limit to how many “primary” and “logical” partitions a drive can contain. Additionally, with pre 1994–98 BIOSes, there are limits to where on the drive the BIOS can boot from. More information can be found in the Linux Partition HOWTO, but this section will include a brief overview to help you plan most situations.

“Primary” partitions are the original partitioning scheme for PC disks. However, there can only be four of them. To get past this limitation, “extended” and “logical” partitions were invented. By setting one of your primary partitions as an extended partition, you can subdivide all the space allocated to that partition into logical partitions. You can create up to 60 logical partitions per extended partition; however, you can only have one extended partition per drive.

Linux limits the partitions per drive to 255 partitions for SCSI disks (3 usable primary partitions, 252 logical partitions), and 63 partitions on an IDE drive (3 usable primary partitions, 60 logical partitions). However the normal atomeOS system provides only 20 devices for partitions, so you may not install on partitions higher than 20 unless you first manually create devices for those partitions.

If you have a large IDE disk and are using neither LBA addressing, nor overlay drivers (sometimes provided by hard disk manufacturers), then the boot partition (the partition containing your kernel image) must be placed within the first 1024 cylinders of your hard drive (usually around 524 megabytes, without BIOS translation).

This restriction doesn't apply if you have a BIOS newer than around 1995–98 (depending on the manufacturer) that supports the “Enhanced Disk Drive Support Specification”. Both Lilo, the Linux loader, and atomeOS's alternative mbr must use the BIOS to read the kernel from the disk into RAM. If the BIOS int 0x13 large disk access extensions are found to be present, they will be utilized. Otherwise, the legacy disk access interface is used as a fall-back, and it cannot be used to address any location on the disk higher than the 1023rd cylinder. Once Linux is booted, no matter what BIOS your computer has, these restrictions no longer apply, since Linux does not use the BIOS for disk access.

If you have a large disk, you might have to use cylinder translation techniques, which you can set from your BIOS setup program, such as LBA (Logical Block Addressing) or CHS translation mode (“Large”). More information about issues with large disks can be found in the Large Disk HOWTO. If you are using a cylinder translation scheme, and the BIOS does not support the large disk access extensions, then your boot partition has to fit within the translated representation of the 1024th cylinder.

The recommended way of accomplishing this is to create a small (25–50MB should suffice) partition at the beginning of the disk to be used as the boot partition, and then create whatever other partitions you wish to have, in the remaining area. This boot partition must be mounted on /boot, since that is the directory where the Linux kernel(s) will be stored. This configuration will work on any system, regardless of whether LBA or large disk CHS translation is used, and regardless of whether your BIOS supports the large disk access extensions.

0. atomeOS Compared to Other OSs

1. Welcome to atomeOS

2. System Requirements

3. Installing

4. Next Steps and Where to Go From Here

A. Installation Howto

B. Partitioning for atomeOS

C. Random Bits

D. Administrivia

E. GNU General Public License

Clone this wiki locally