Linux Partition HOWTO: Partitioning requirements (2024)

What Partitions do I need?

<! Tony, 1 May 00>

Boot Drive:
If you want to boot your operating system from the drive you are about to partition, you will need:

  • A primary partition
  • One or more swap partitions
  • Zero or more primary/logical partitions
Any other drive:
  • One or more primary/logical partitions
  • Zero or more swap partitions

Discussion:

Boot Partition:
Your boot partition ought to be a primary partition, not alogical partition. This will ease recovery in case of disaster, but itis not technically necessary. It must be of type 0x83 "Linuxnative". If you are using lilo, yourboot partition must be contained within the first 1024 cylinders ofthe drive. (Typically, the boot partition need only contain the kernelimage.)
If you have more than one boot partition (from other OSs,for example,) keep them all in the first 1024 cylinders (AllDOS partitions must be within the first 1024). If you are using ameans other than lilo loading your kernel (for example, a boot disk orthe LOADLIN.EXE MS-DOS based Linux loader), thepartition can be anywhere. See the Large-diskHOWTO for details.

Swap Partition:

Unless you swap to files you will need a dedicated swap partition. Itmust be of type 0x82 "Linux swap". It may be positioned anywhere onthe disk (but see notes on placement). Either a primary or logicalpartition can be used for swap. More than one swap partition can existon a drive. 8 total (across drives) are permitted. See notes on swap size.

Logical Partition:

A single primary partition must be used as a container (extendedpartition) for the logical partitions. The extended partition can goanywhere on the disk. The logical partitions must be contiguous, butneedn't fill the extended partition.

File Systems

<!- Tony, 12 June 00>

Which file systems need their ownpartitions?

Everything in your linux file system can go in the same (single)partition. However, there are circ*mstances when you may want torestrict the growth of certain file systems. For example, if your mailspool was in the same partition as your root fs and it filled theremaining space in the partition, your computer would basicallyhang.
/var This fs contains spool directories such as those for mail and printing. In addition, it contains the error log directory. If your machine is a server and develops a chronic error, those msgs can fill the partition. Server computers ought to have /var in a different partition than /.
/usr This is where most executable binaries go. In addition, the kernel source tree goes here, and much documentation.
/tmp Some programs write temporary data files here. Usually, they are quite small. However, if you run computationally intensive jobs, like science or engineering applications, hundreds of megabytes could be required for brief periods of time. In this case, keep /tmp in a different partition than /.
/home This is where users home directories go. If you do not impose quotas on your users, this ought to be in its own partition.
/boot This is where your kernel images go. If you use MSDOS, which must go in the first 1024 cylinders, you need to at least get this partition in there in order to ensure that lilo can see it. If you have a drive larger than 1024 cylinders, making this your first partition guarantees that it will be visible to lilo.

File lifetimes and backup cycles as partitioning criteria

With ext2, partitioning decisions should be governed by backupconsiderations and to avoid external fragmentation fromdifferent file lifetimes.

Files have lifetimes. After a file has been created, it willremain some time on the system and then be removed. Filelifetime varies greatly throughout the system and is partlydependent on the pathname of the file. For example, files in/bin, /sbin, /usr/sbin, /usr/bin and similar directories arelikely to have a very long lifetime: many months and above.Files in /home are likely to have a medium lifetime: severalweeks or so. File in /var are usually short lived: Almost nofile in /var/spool/news will remain longer than a few days,files in /var/spool/lpd measure their lifetime in minutes orless.

For backup it is useful if the amount of daily backup issmaller than the capacity of a single backup medium. A dailybackup can be a complete backup or an incremental backup.

You can decide to keep your partition sizes small enough thatthey fit completely onto one backup medium (choose daily fullbackups). In any case a partition should be small enough thatit* daily delta (all modified files) fits onto one backupmedium (choose incremental backup and expect to change backupmedia for the weekly/monthly full dump - no unattendedoperation possible).

Your backup strategy depends on that decision.

When planning and buying disk space, remember to set aside asufficient amount of money for backup! Unbackuped data isworthless! Data reproduction costs are much higher than backupcosts for virtually everyone!

For performance it is useful to keep files of differentlifetimes on different partitions. This way the short livedfiles on the news partition may be fragmented very heavily.This has no impact on the performance of the / or /homepartition.

Swap Partitions

<! Kristan 3 Nov 97>

How large should my swap space be?

If you have decided to use a dedicated swap partition, which isgenerally a Good Idea [tm], follow these guidelines forestimating its size:

  • In Linux RAM and swap space add up (This is not true for allUnices). For example, if you have 8 MB of RAM and 12 MB swapspace, you have a total of about 20 MB virtual memory.
  • When sizing your swap space, you should have at least 16 MBof total virtual memory. So for 4 MB of RAM consider at least12 MB of swap, for 8 MB of RAM consider at least 8 MB ofswap.
  • <!-Tony 12 June 00>Currently, the maximum size of a swap partition isarchitecture-dependent. For i386 and PowerPC, it is approximately2Gb. It is 128Gb on alpha, 1Gb on sparc, and 3Tb on sparc64. For linuxkernels 2.1 and earlier, the limit is 128Mb. The partition may belarger than 128 MB, but excess space is never used. If you want morethan 128 MB of swap for a 2.1 and earlier kernel, you have to createmultiple swap partitions. See the man page for mkswap for details.

    <!-Kristan 3 Nov 97>

  • When sizing swap space, keep in mind that too much swap spacemay not be useful at all.

A very old rule of thumb in the days of the PDP and the Vax was thatthe size of the working set of aprogram is about 25% of its virtual size. Thus it is probably uselessto provide more swap than three times your RAM.

But keep in mind that this is just a rule of thumb. It iseasily possible to create scenarios where programs haveextremely large or extremely small working sets. For example,a simulation program with a large data set that is accessedin a very random fashion would have almost no noticeablelocality of reference in its data segment, so its working setwould be quite large.

On the other hand, an xv with many simultaneously openedJPEGs, all but one iconified, would have a very large datasegment. But image transformations are all done on one singleimage, most of the memory occupied by xv is never touched.The same is true for an editor with many editor windowswhere only one window is being modified at a time. Theseprograms have - if they are designed properly - a very highlocality of reference and large parts of them can be keptswapped out without too severe performance impact.

One could suspect that the 25% number from the age of thecommand line is no longer true for modern GUI programsediting multiple documents, but I know of no newer papersthat try to verify these numbers.

So for a configuration with 16 MB RAM, no swap is needed for aminimal configuration and more than 48 MB of swap are probablyuseless. The exact amount of memory needed depends on theapplication mix on the machine (what did you expect?).

Where should I put my swap space?

  • Mechanics are slow, electronics are fast.
    Modern hard disks have many heads. Switching between heads ofthe same track is fast, since it is purely electronic.Switching between tracks is slow, since it involves movingreal world matter.

    So if you have a disk with many heads and one with less headsand both are identical in other parameters, the disk withmany heads will be faster.

    Splitting swap and putting it on both disks will be evenfaster, though.

  • Older disks have the same number of sectors on all tracks.With these disks it will be fastest to put your swap in themiddle of the disks, assuming that your disk head will movefrom a random track towards the swap area.
  • Newer disks use ZBR (zone bit recording). They have moresectors on the outer tracks. With a constant number of rpms,this yields a far greater performance on the outer tracksthan on the inner ones. Put your swap on the fast tracks. (In general, low-numbered cylinders are associated lowpartition numbers. However, see Kristian's most recent comments on this issue. -Tony)
  • Of course your disk head will not move randomly. If you haveswap space in the middle of a disk between a constantly busyhome partition and an almost unused archive partition, youwould be better of if your swap were in the middle of thehome partition for even shorter head movements. You would beeven better off, if you had your swap on another otherwiseunused disk, though.

Summary: Put your swap on a fast disk with many heads that isnot busy doing other things. If you have multiple disks: Splitswap and scatter it over all your disks or even differentcontrollers.

Even better: Buy more RAM.

Linux Partition HOWTO: Partitioning requirements (2024)

FAQs

What is the recommended partition size for Linux? ›

It is recommended to make it at least 15 GB. Warning: your system will be blocked if the root partition is full.

How many partitions does Linux typically require? ›

You only need one partition to install Linux, however I recommend a second partition formatted ext2 for your pictures and music and what not files. The only thing left is the swap space that need a specific format. So, a workable linux system needs a minimum of 2 partitions.

What is the best partition structure for Linux? ›

The recommended partition type is ext4. 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.

How should I partition my Linux drive? ›

Process to Partition a Disk in Linux
  1. #1 Identify the Disk.
  2. #2 Start the Partitioning Tool.
  3. #3 Create a New Partition.
  4. #4 Specify Partition Details.
  5. #5 Save Changes.
  6. #6 Format the New Partition.
  7. #7 Mount the New Partition (Optional)
Oct 29, 2023

How do I choose partition size? ›

To create and format a new partition (volume)

Right-click an unallocated region on your hard disk, and then select New Simple Volume. In the New Simple Volume Wizard, select Next. Enter the size of the volume you want to create in megabytes (MB) or accept the maximum default size, and then select Next.

Is 20gb partition enough for Linux? ›

In line with my esteemed associates, I also recommend a Minimum of 30 to 40 GB for any main line Linux, the question is more of how much do you need for windows and all your programs and files, then double it, making sure when you partition your drive you leave at least that amount for windows.

Why only 4 primary partitions in Linux? ›

The limit on the number and types of partitions are a result of the partitioning scheme used. MBR limits you to either 4 primary partitions, or 3 primary partitions and 1 extended partition containing more logical partitions. GPT has a limit of 128 primary partitions. This because you are use MBR partition table.

What is the standard partition in Linux? ›

Partition NameDescription
/bootThis contains all the files that are needed for the booting process
/devThis stands for devices, which contain files for peripheral devices and pseudo devices
/etcThis contains configuration files for the computer and computer databases
/homeThis holds all the home directories for the users
16 more rows

What are the three types of partitions in Linux? ›

There are three types of partitions with which you will be dealing; Primary, Extended, and Logical partitions.

What format should I partition for Linux? ›

Understanding the Linux File System
File SystemSupported File SizeIdeal Usage
FAT32up to 4 GBFor maximum compatibility
NTFS16 EiB – 1 KBFor internal drives and Windows system file
Ext416 GiB – 16 TiBFor files larger than 4 GB
Dec 2, 2020

What are four common Linux partition formats? ›

The commonly used Linux file systems are ext2, ext3, ext4, JFS, ReiserFS, XFS, FAT (usually in Windows OS) and B-treeFS. Inorder to specify the file system to be used in each partition, we can use the mkfs (make file system) command.

How to increase Linux partition space? ›

Extending Or Shrinking a Linux Partition
  1. Step 1: Identify the Partition. ...
  2. Step 2: Back Up Your Data. ...
  3. Step 3: Start fdisk. ...
  4. Step 4: Delete the Partition. ...
  5. Step 5: Create a New Partition. ...
  6. Step 6: Save the Changes. ...
  7. Step 7: Resize the File System.
Mar 11, 2024

What is the minimum partition required to install Linux? ›

to the best of my knowledge, "/", "swap" & "/boot" are the essential partitions required for installing Linux, but i think linux should also work without "swap". If you have enough ram and if you don't use hibernate, swap will not be essential (although I'd still want to have at least a small amount of swap available).

How many partitions can a hard drive have in Linux? ›

3.1.

In an MBR partitioning scheme, we're limited to a maximum of four primary partitions. These partitions can serve various purposes, such as installing a different OS or organizing data into separate partitions.

How much space for an Ubuntu partition? ›

NameRecommended Partition Space
/usr20 GB at least
/var2 GB
/lib5 GB
/boot250 MB
11 more rows

How many GB should I allocate for Linux? ›

When allocating disk space for Linux, consider the minimum requirements (15-25 GB), essential applications (1-2 GB), experimentation (10-20% of total disk space), and future growth (10-12 months).

What is the best Linux boot partition size? ›

A boot partition size ranging from 100 to 500 MB is sufficient for most Linux distributions. However, if we plan to install multiple kernels or have specific requirements, it may need a larger boot partition.

What is the default partition size for Linux? ›

When the default partition layout is selected, the installer typically assigns 100 MB for /boot , 2 GB for swap, and the remainder is assigned to the root ( / ) partition. Oracle Linux requires a minimum of one partition for the root ( / ) file system.

What size should my partition be? ›

Windows partition

The partition must have at least 20 gigabytes (GB) of drive space for 64-bit versions, or 16 GB for 32-bit versions. The Windows partition must be formatted using the NTFS file format.

Top Articles
Does Renters Insurance Cover Jewelry?
USMCA Certificate of Origin Filling Software and How to Complete It
Hometown Pizza Sheridan Menu
Is Sam's Club Plus worth it? What to know about the premium warehouse membership before you sign up
Craftsman M230 Lawn Mower Oil Change
Www.politicser.com Pepperboy News
Get train & bus departures - Android
Comcast Xfinity Outage in Kipton, Ohio
Farmers Branch Isd Calendar
Craigslist In Fredericksburg
10 Great Things You Might Know Troy McClure From | Topless Robot
Rapv Springfield Ma
Nonuclub
Betonnen afdekplaten (schoorsteenplaten) ter voorkoming van lekkage schoorsteen. - HeBlad
How do you like playing as an antagonist? - Goonstation Forums
Learn2Serve Tabc Answers
Finger Lakes Ny Craigslist
Plan Z - Nazi Shipbuilding Plans
Azpeople View Paycheck/W2
Viha Email Login
Graphic Look Inside Jeffrey Dahmer
zom 100 mangadex - WebNovel
Dwc Qme Database
Dragger Games For The Brain
Wkow Weather Radar
Johnnie Walker Double Black Costco
Craig Woolard Net Worth
Spectrum Outage in Queens, New York
Pipa Mountain Hot Pot渝味晓宇重庆老火锅 Menu
Bursar.okstate.edu
Lehpiht Shop
Vanessa West Tripod Jeffrey Dahmer
Tal 3L Zeus Replacement Lid
Usf Football Wiki
Dadeclerk
Banana Republic Rewards Login
Kelley Blue Book Recalls
Arigreyfr
Pekin Soccer Tournament
18006548818
Charli D'amelio Bj
3 bis 4 Saison-Schlafsack - hier online kaufen bei Outwell
Sofia Franklyn Leaks
Sallisaw Bin Store
Gamestop Store Manager Pay
Xre 00251
8 4 Study Guide And Intervention Trigonometry
Sapphire Pine Grove
Congressional hopeful Aisha Mills sees district as an economical model
What Responsibilities Are Listed In Duties 2 3 And 4
Latest Posts
Article information

Author: Margart Wisoky

Last Updated:

Views: 6257

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Margart Wisoky

Birthday: 1993-05-13

Address: 2113 Abernathy Knoll, New Tamerafurt, CT 66893-2169

Phone: +25815234346805

Job: Central Developer

Hobby: Machining, Pottery, Rafting, Cosplaying, Jogging, Taekwondo, Scouting

Introduction: My name is Margart Wisoky, I am a gorgeous, shiny, successful, beautiful, adventurous, excited, pleasant person who loves writing and wants to share my knowledge and understanding with you.