What is linux home partition

Partitions: Planning Your Linux Installation¶

This article will explain some of the terms involved with partitioning your hard drive, as well as some concepts you will need to understand before installing Linux, and will help you determine what partitions you need to create for Linux.

What is a partition?В¶

Imagine your company is moving into a new building that is set up like a warehouse. There are no internal walls, it’s just one big room for everybody to work in. Chances are, the first thing the boss is going to do is build himself an office (he wouldn’t want to associate with you workers), so he’ll have a partition set up, an internal wall to separate him from you. Next, each worker will get a cubicle in the big room with smaller partitions to separate you from the person next to you.

Hard drives work the same way. The disk gets partitioned into smaller, separate pieces which can belong to different owners. In our case, Windows might own some and Linux will own others. On hard drives though, the word “partition” does not refer to the wall itself, it refers to the separated space. So we say Linux is installed “on” the first partition.

What is a file system?В¶

Ever go looking for a book in the library? In order to find what you’re looking for, you must understand the library’s file system, or method of organization. Fiction books are easy, they use a simple type of file system commonly known as alphabetical by author. Nonfiction books can be tougher because they use a different type of file system, the Dewey Decimal System. What if you don’t understand the Dewey Decimal System? What if you only know the title of a book and you don’t know whether it’s fiction or non-fiction? How can we find our book now? Luckily there is a librarian to help us, and she has created a card catalog (or in most libraries now, a computerized catalog) listing all the books available and where to find them.

Now, picture your hard drive as the library. Like the library, your hard drive can have different file systems. The operating system is your librarian, who has provided the directory tree (sometimes also referred to as “the file system”, with a slightly different meaning) as a catalog of the files available.

Unfortunately, the world of computers is not as standardized as our libraries. In computers, every librarian or operating system has its own type of file system, and other operating systems often don’t know how to read it. Lucky for us, Linux is a versatile operating system and it does understand the file system used by Windows 95 and Windows 98, as well as many others.

Planning your partitions¶

Each distribution’s installation guide contains (or should contain) a section on partitioning your hard drive. I have noticed, however, that the manuals often include far more detail than is necessary in a typical desktop installation, and can be confusing to new users.

Personally, I favor the KISS principle (Keep It Simple, Stupid), especially for beginners. If you are installing a server that will serve multiple user’s simultaneously and provide myriad services, you will want to read these manual sections as well as the Partition Mini-HOWTO, an excellent document detailing the reasons one might want to create the seven or more partitions sometimes recommended in these primers.

For a single-user desktop system, you can ignore just about all of that. Desktop systems for personal use don’t have most of the complications that require so many partitions. For a healthy Linux installation, I recommend three partitions: swap, root, and home.

Swap¶

You need one partition that will be used as Linux swap space. This is space on your hard drive that can be used as virtual memory. Virtual memory allows your computer to run large programs and perform complex tasks even if it does not have enough physical RAM to do the job. (It is a lot slower, but it works.)

The amount of swap space required is a matter of religious argument among geeks and hackers, and entire volumes could be written about the subject. To keep it simple, create one swap partition that is 50% to 100% the size of the physical RAM in your system. If you are short on RAM with plenty of drive space, go large. If you’re short on drive space and have lots of RAM, go small.

root (/)В¶

The root file system is represented by a forward slash (/). It is the top of the directory tree, and contains Linux and everything that you install with Linux. (See The Linux (Virtual) File System for details). This is roughly equivalent to your “C:” drive under DOS or Windows. You must create a partition for the root directory. (Don’t confuse this with the “root” user account, who is the administrator of the system. That’s a different kind of root!)

Читайте также:  Half time vst mac os

The size of your root partition will vary depending on what you install or plan to install. Check your distribution’s documentation, and reserve enough space for a maximum installation, plus at least 100MB more for temporary space and installation of new software. If you plan to download and try out lots of software, leave more space. If you have a small hard drive, you can trim back on your installed packages to save space.

In general, you should be fine with a root partition between 2GB and 8GB.

/home¶

The third and final partition you should create will hold your /home directory. This is the place where all the user-specific files, your data in other words, are stored. It is roughly equivalent to the “My Documents” folder on a MS Windows desktop (if you have MS Office installed). On a multi-user system, each user will have her own directory under /home .

Strictly speaking, it is not necessary to create a separate partition for /home . If you do not, it will reside on the root partition like everything else. If you are cramped for space, you may need to configure your machine this way.

The reason I recommend creating a separate partition is that you are a new user. You are going to want to play with things, experiment, push the limits of your system. Before long, you will break something so badly that you will need to reinstall, or you’ll just want to reinstall with different options, or try a different Linux distribution. Having /home on a separate partition makes it very easy to wipe out and reinstall Linux without losing any of your data.

Don’t think to yourself, “I’ll be careful, I won’t need to reinstall.” Wrong. You will definitely hose up your system at least once, and for the novice, reinstalling is often the easiest way to fix it. I had ten years of computer experience and worked in technical support when I started with Linux, so I knew my way around a PC, and I had to reinstall twice. Just plan on it and make it easy on yourself. Keep your data on a separate /home partition, or keep it backed up on some other medium, and be sure to create the boot floppies when prompted to do so during the installation process. They have saved my system more than once.

And don’t get the wrong impression here. This reinstall problem is only because you are a new user, still learning. Six months from now your system will be purring like a nursing kitten, and you’ll go weeks or months without rebooting, let alone reinstalling.

Источник

Do You Need a Home Partition When Using Linux?

A home partition offers an additional degree of protection for your files

Most Linux distributions support, by default, reorganizing disk space into three partitions during the Linux installation process:

  1. Root: Non-swap partition where the filesystem goes and required to boot a Linux system.
  2. Home: Holds user and configuration files separate from the operating system files.
  3. Swap: When the system runs out of RAM, the operating system moves inactive pages from RAM into this partition.

Of these, the home and swap partitions have, in recent years, become more controversial.

Do You Need a Separate Home Partition?

If you’ve installed Ubuntu and chose the default options while installing Ubuntu, you won’t have a home partition. Ubuntu generally creates just two partitions—root and swap.

The main reason for having a home partition is to separate your user files and configuration files from the operating system files. By separating your operating system files from your user files, you’re free to upgrade your operating system without the risk of losing your photos, music, videos, and other data.

Other reasons it’s better to create a separate home partition:

  • Migrating to a large home partition later is much easier.
  • If you store a very large number of small files in your home folder, it could slow overall access to the root filesystem files as well.
  • If the home partition completely fills up, the file system won’t crash.
  • In the case of a failed system upgrade, all data on your home partition remains safe.
  • Reinstalling the OS is much faster when all data files are on a separate home partition.
  • Some swap and file system areas like temporary files or swap files are accessed frequently. Storing the home partition on a fast SSD drive and keeping swap and root partitions on a standard drive can extend the life of your SSD drive. Be aware, however that dependent upon use, this can also substantially slow down the system—ruining a LOT of the benefit of a solid state drive, and the whole reason for putting one in.

The Ubuntu Default Partition Structure

So why doesn’t Ubuntu give you a separate home partition by default?

Ubuntu instantiates a home folder and under the home folder, you’ll find sub-folders for music, photos, and videos. All your user-specific configuration files store in your home folder. (They’re hidden by default). This structure matches the documents-and-settings setup that has been part of Windows for so long.

Not all Linux distributions behave similarly and some might not provide a consistent upgrade path. Some may require you to re-install the operating system to get to a later version. In this case, having a home partition is useful as it saves you copying all of your files off the machine and then back again afterward.

Читайте также:  Windows terminal default font

Just because you have a separate home partition doesn’t mean that you no longer need to do backups. Any partition can fail, and maintaining a backup protects all of your important files on the home partition.

How Big Should the Home Partition Be?

If you only plan to install one Linux distribution on your computer, then your home partition can be set to the size of your hard drive minus the size of the root partition and the size of the swap partition.

For example, if you use a 100-gigabyte hard drive, create a 20-gigabyte root partition for the operating system and an 8-gigabyte swap file. This allocation leaves 72 gigabytes for a home partition.

However, remember that your root partition must also have enough space for any programs you’re planning to install. For a home system with (web browser, music player, word processor),

25-30GB should be fine—but with modern drives being relatively cheap, why not do 50-60GB?

Also, it’s probably a good idea to have a swap partition that’s about equal to the size of your RAM. This way, you know there’s room in the swap partition for things like hibernating your computer.

If you have Windows installed and you are dual booting with Linux then you might choose to do something different.

It’s difficult to read Linux partitions using Windows. Accordingly, creating a massive home partition is not the way to go. Instead, create a modest home partition for storing configurations files (say a maximum of 1 gigabyte). Then, create a FAT32 partition for the rest of the disk space to store music, photos, videos, and other files. This FAT32 partition can be accessed from either operating system.

What About Dual-Booting Linux with Linux?

When you dual-boot several Linux distributions, you can share one home partition among them all if you accommodate a few technical provisions. The biggest? Software versions. Different distributions use different versions of major applications. Because user-specific configuration files write to the home directory, using distributions with out-of-sync applications may lead to the corruption of files or to their outright loss.

Источник

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.

Description: see SwapFaq.

  • Size: size of your RAM.
  • 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).

  • Size: as you wish
  • 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

    Источник

    Читайте также:  Server which linux distribution
    Оцените статью