- Ubuntu Documentation
- Partition design
- Use Gparted to create/manage partitions
- Examples
- Basic Partitioning Scheme for a 2TB Desktop HDD
- Partitioning Scheme for Multiple systems
- Partitioning Scheme for SSD
- Other resources
- Landoflinux
- Linux Disk Partitioning Schemes and Layout
- Things to consider
- Simple Disk Layout with separate home area
- Standard Partitioning Scheme
- Ubuntu Documentation
- Overview
- Root partition (always required)
- Swap (very recommended)
- Separate /boot (sometimes required)
- BIOS-Boot or EFI partition (required on GPT disks)
- Optional partitions
- Partition for sharing data with Windows, MacOS. (optional)
- Separate /home (optional)
- More Complex Schemes
- Note about /sbin
- Sizes For Alternative Schemes
- Space Requirements
- Absolute Requirements
- Installation on a small disk
Ubuntu Documentation
Partition design
Most PC operating systems still work with an ancient disk partition scheme that historically makes distinction between primary and extended partitions. It also places a limitation for four primary partitions or three primary partitions and one extended partition. When present, an extended partition can then be divided into any number number of logical partitions.
However, many recent (since 2011) machines use a different and incompatible scheme known as «gpt» which allows many more primary partitions. Search these pages for UEFI to learn how to tell which scheme your system is using; applying techniques for one scheme to a system that uses the other will definitely lead to possibly serious problems.
Each Windows installation will need to be installed on a primary partition. Windows systems commonly assign a drive letter to each individual (Windows) partition.
Linux operating systems need a minimum of one partition: one for the OS itself (and data files) and optionally one for a swap area (to be used as an extension for RAM memory) if preferred over a swap file.
While these two partitions can be primary partitions, more flexibility is afforded when logical partitions (within the extended partition) are used. In this manner, as many partitions can be created as is desired. Multiple (Ubuntu Linux and Mac) operating systems can be installed, each in its own partition, and data can also be more easily compartmentalized when it is placed within individually separate logical partitions. (The swap partition can also be located on a logical partition.)
Use Gparted to create/manage partitions
The easiest way to do this is to use the GParted Live CD as a partition manager, or the GPartEd utility on the Ubuntu LiveCD.
Examples
Basic Partitioning Scheme for a 2TB Desktop HDD
- Primary Partition — 1Gb (1024Mb) of Free Space — bootstrap files, boot loaders and stuff you’ll may need to run multiple operating systems
- Extended Partition
- 10Gb (10240Mb) — swap
- (0.5% is not much, and 10Gb is double the memory size of typical 4Gb system)
- 30Gb (30960Mb) — root /
- (for Ubuntu system files and applications)
- 100Gb (102400Mb) — /home
- (system/application dependent config, data and other files)
- 10Gb (10240Mb) — swap
- 1850Gb free for another operating system, your system-independent media files, virtual machines and stuff
Partitioning Scheme for Multiple systems
This most versatile partitioning scheme allows for both Windows and Linux (and/or Mac) operating systems:
- one primary partition for each Windows OS
- an extra small primary partition (which can be resized later, in case it is needed). If there is a Windows recovery partition already installed, leave it alone (as the second partition).
- one primary partition for the small boot partition (for storing a set of GRUB bootloader files)
- an extended partition for the Linux (or Mac) OSs (must be the last partition on the hard drive)
Here is an example partitioning scheme:
- the Windows partition 20 — 30 Gb — filesystem type NTFS (or can even be FAT32) and with the boot flag checked
- an «extra» partition 2 Gb — can be formatted as ext3, ext4, or FAT32. If this already exists as a Windows recovery partition, leave it unchanged.
Temporary Edit xxxx a GRUB boot partition 100 Mb, formatted to filesystem type ext3 xxxx Unless you want to end up in Ubuntuforums asking for help with a package manager that is complaining about a full boot partition, DO NOT create and use a separate boot partition. For 99% of home installations it is totally unnecessary.
Partitioning Scheme for SSD
- Better leave all read-only files on SSD and use hard disk for everything else
https://wiki.debian.org/ReadonlyRoot should clarify which parts of the filesystem tree can be read-only: moving /usr to read-only would be the most significant thing (greatest space required) I guess but you have to ensure it is remounted as required when doing apt-get install or remove. See that page for more info.
Other resources
PartitioningSchemes (последним исправлял пользователь rautamiekka 2014-11-07 19:27:44)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
Источник
Landoflinux
Linux Disk Partitioning Schemes and Layout
The layout of your partitioning scheme on Linux is fairly dependant on how you plan to use your system. Firstly, there is no correct solution to your layout, however, there are some simple best practice rules that you can apply that will be of benefit. By default, many Linux distributions will create a default layout normally creating partitions for «/», «/boot» and «swap». Although this will probably work quite well, it is not the ideal layout to use. Most distributions will give you multiple options at installation time regarding the layout of your disk. Many of these will also offer LVM (Logical Volume Manager) as a method of controlling your disk space.
Things to consider
As mentioned earlier there is no de-facto layout for a Linux installation. However you should consider some of the following factors before you start.
Firstly, what distribution are you planning to install? Does the distribution have any size recommendations on its home page?
What will be the primary function of your server installation? (Web server, File Server, Database Server, Media Server, print server or family computer)
How many people will be using this system? (Single user, multi users, small office, call centre)
What is your backup strategy? (Are you using a custom rsync script, local to remote server backups, full data dump or incremental, synchronising automatically to the cloud)
What frequency of backups will you take? (Daily, weekly, monthly)
How important is your data?
What is your anticipated disk usage?
What strategy will you use if you need more space?
Simple Disk Layout with separate home area
A popular option when creating a disk layout is to have your «/home» area on a separate partition. The advantage of this is that you can at a later date upgrade or move to a different Linux distribution without having to delete your existing «/home» area. By separating filesystems away from the «/» area of your system, you system can continue to run if your home area becomes completely full. Another advantage to having a separate home area is that if you are unfortunate enough to experience a corrupted «/» system, your home area has a far greater chance of not being corrupted and can then be easily retrieved or used after the main system has been repaired. Below is an example of a single disk installation with a separate «/home» area:
The above is a very small installation, with a single disk environment with a separate «/», «/boot» and «/home» partition. We have also used LVM for the «/» partition and also the «/home» area. If we need more space in the future, we can then assign more disk to the relevant Volume Groups. (See LVM Explanation).
Standard Partitioning Scheme
A standard approach often used with a Linux system is to use a partition scheme similar to the following:
Directory | Size |
---|---|
/ | 25GB |
/home | 50GB |
/var | 4GB |
/tmp | 2GB |
swap | 2 x Physical RAM |
The above should be used as an example only and the sizes will differ depending on how big your initial hard disk is. In the above example the «/» root area contains the main operating system. «/home» is where all your downloads, documents would be stored for all users. This is the equivalent to the Windows «Documents and Settings» area. You may want to increase this area if multiple users will be using this system. «/var» is the area used by most applications for storing log files. It is always best to keep this area on a separate partition. This is a precautionary measure. If «/var» shared the same partition space as «/» and a program encountered a serious problem, it is possible that «/var» could become filled quickly. This could eventually lead to «/» filling up. «/tmp» is a temporary area that can be used by all users on the system. This area doesn’t have to be too big as any data stored here is generally removed on boot. You should also keep in mind that larger Linux systems may only get booted once a month. This should be taken into consideration.
Most Larger systems will use LVM (Logical Volume Manager) to manage disk space. Using LVM gives the System Administrator the ability to add or reduce space quickly and efficiently. This method is often used within Enterprises in conjunction with a SAN storage configuration. Here disk can be quickly deployed to servers and added with LVM where necessary. For examples of LVM see our LVM Guide.
During installation time of a Linux distribution you will assign or the installation will assign what is known as a «Swap Partition». This is an area of disk space that is used to store programs that do not need to be kept in physical memory. If the system requires more physical memory than is available, then programs are paged out to this swap space. This is also called «Virtual Memory». As a rule of thumb, the swap space partition should be around two times the amount of Physical Ram.
For example, if your system has 1GB of memory, you should create a Swap partition of 2GB.
Note: On some systems with large amounts of physical memory, it is not uncommon to see no SWAP area.
Источник
Ubuntu Documentation
The goal of this page is to offer advice and strategy on partitioning a Linux system.
Overview
The easiest partitioning scheme, on a non-GPT disk, is simply a root partition and a swap partition.
Name
Size
size of RAM
the rest of the disk
If the disk is GPT type (this can be checked via the «sudo parted -l» command), you must also add a BIOS-Boot or an EFI partition depending on the boot mode of your BIOS.
Name
Size
BIOS-boot or EFI
see below
size of RAM
the rest of the disk
On some computers, a separate /boot partition may also be required.
See paragraphs below.
Root partition (always required)
- Mount point: /
- Type: Linux type (generally EXT4)
- Description: the root partition contains by default all your system files, program settings and documents.
- Size: minimum is 8 GB. It is recommended to make it at least 15 GB. Warning: your system will be blocked if the root partition is full.
Swap (very recommended)
Description: see SwapFaq.
Separate /boot (sometimes required)
Some computers can’t see boot files (/boot) if located far (>100GB) from the start of the disk. This is why it is sometimes necessary to create a separate /boot partition at the start of the disk. Remark: don’t use the same /boot for several Linux distributions, as it may mix up their kernels. See this tutorial if you want to create a separate /boot after installing Ubuntu.
Name
Size
at least size of RAM
minimum 8 GB, at least 15 GB recommended
BIOS-Boot or EFI partition (required on GPT disks)
If you want to install Ubuntu on a GPT disk (you can check it via the ‘sudo parted -l’ command), you will need either an EFI partition (if your BIOS is set up in EFI mode) or a BIOS-Boot partition (if your BIOS is set up in Legacy mode).
BIOS-Boot partition:
- Mount point: none
- Type: no filesystem
- Description: the BIOS-boot partition contains GRUB 2’s core. It is necessary if you install Ubuntu on a GPT disk, and if the firmware (BIOS) is set up in Legacy (not EFI) mode. It must be located at the start of a GPT disk, and have a «bios_grub» flag.
- Size: 1MB.
EFI partition:
- Mount point: /boot/efi (no need to set up this mount point as the installer will do it automatically)
- Type: FAT (generally FAT32)
Description: the EFI partition (also called ESP) contains some boot files. It is necessary if the firmware (BIOS) is set up to boot the HDD in EFI mode (which is default on more and more modern, > year 2011 computers). It must be located at the start of a GPT disk, and have a «boot» flag.
Size: 100
Optional partitions
Optionally, some other partitions can be created for specific usages. Be careful, these partitions reduce the flexibility of your disk space, they must be considered only if you are sure not to fill completely your root partition (which would block your system).
Partition for sharing data with Windows, MacOS. (optional)
- Mount point: /media/thenameyouwish
- Type: to share data with Windows, choose NTFS. To share data with MacOS, choose HFS+. To share data with another Linux system, choose EXT4.
- Description: other operating systems (Windows, MacOS..) cannot read nor write in the Ubuntu partitions, but Ubuntu can read and write in any partition. If you want to share files between Ubuntu and the other systems, it is recommended to create a data partition. It is not recommended to share files directly into the Windows system partition (eg files may be overwritten by hibernation).
- Size: as you wish
Separate /home (optional)
- Mount point: /home
- Type: Linux type (generally EXT4)
Description: see HomeFolder. When your hard disk is big enough, a separate /home allows to separate your settings (and also your data if you don’t use a data partition, see previous paragraph) from the rest of the system. A separate /home does not allow to share data with Windows nor MacOS (see previous paragraph).
More Complex Schemes
For more information on what various directories are used for, see The Linux Filesystem Hierarchy.
More complex schemes could involve creating a separate partition for any number of the default folders used by Ubuntu. System critical folders are important to protect, and since drives, and / or partitions do fail, it is often useful to have your file system broken down into as many small parts as possible. This can be over done however. Installing every core directory to its own partition could cause a noticeable degradation of performance.
Bearing that in mind, the following directories should NEVER be placed in their own separate partitions:
Name
Description
This directory stores the system wide executables that are accessible by most users.
This directory holds the executables used for core system functions, and used by the system administrator
to maintain the system. See Note Below
This is a system use directory containing process information. Almost never accessed by a user.
This directory contains system created links to your installed hardware, and like /proc is almost never accessed directly.
Note about /sbin
It can be argued, and reasonably so, that moving this directory to its own partition is a wise choice. If any of your partitions or drives should fail, then this directory / partition will be the one that most likely contains the tools you will need to repair it. So while moving this would decrease performance marginally, it could also be considered a wise move.
Sizes For Alternative Schemes
On a six month old installation of Ubuntu 10.04.3 LTS the disk usage could resemble something like this: (examples taken from my own system with many extra packages installed)
Actual
Name
Size
Recommended Partition Size
Everything not used elsewhere, or separate drive.
500 MB to 5 GB This directory is not used by mainline software packages, but mostly from packages coming from the universe repositories. If you do not use the universe repositories often, you probably will not need much space here.
DO NOT PARTITION
Unless you plan on installing web served data here, or are using a Server version of Ubuntu, this will not often need to be larger than 100 MB. If you are running a server, or plan to expand it yourself, plan ahead when sizing this.
This can get fairly large, but not larger than your swap space as a rule, so size this to match /swap
8 kB (do not partition)
This is just an empty directory that serves as a mount point for temporary file systems, e.g. a rarely used network filesystem.
8 kB (do not partition)
This contains subdirectories that are mount points for removable media like CDs and USB flash drives.
The above recommendations assume you are using large modern hard drives and can afford the space.
Space Requirements
Absolute Requirements
The required disk space for an out-of-the-box Ubuntu installation is said to be 15 GB. However, that does not take into account the space needed for a file-system or a swap partition.
It is more realistic to give yourself a little bit more than 15 GB of space. Give yourself 15-25 GB to have some space left for actually doing things. If your file-system is full to the brim, you will feel some performance loss.
A certain percentage of an ext3 file-system is dedicated to root, as a way of preventing a rogue process from filling the disk to the point that the system is unusable. This dedicated portion is 5% by default. Also, the anti-fragmentation strategies used by Linux file-systems require that the disk is not close to full. A rule of thumb is to keep them less than 90% full.
Installation on a small disk
(This section is out-of-date & may need research for sizes) During a normal install, the installer copies the packages from the CD to the hard drive (in addition to actually installing them). If you are short on disk space before you install, you can tell the installer not to use extra disk space. The packages take up about xxx Mb. You will be able to install a full Ubuntu system with less than xx GB of hard drive space.
At the installation prompt (just after you boot from CD) type:
DiskSpace (последним исправлял пользователь ckimes 2017-09-02 19:35:04)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
Источник