Linux отдельный раздел boot

DiskSpace

The goal of this page is to offer advice and strategy on partitioning a Linux system.

Required partitions

Overview

The easiest partitioning scheme, on a non-GPT disk, is simply a root partition and a swap partition.

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.

On some computers, a separate /boot partition may also be required.

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.

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.

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).

  • 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.
  • 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~250MB

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).

Читайте также:  Linux mint как настроить прокси

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:

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)

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.

Читайте также:  Angry ip scanner kali linux

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:

linux archive-copier/copy=false

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

Источник

Зачем держать /boot на отдельном разделе.

Интересует как практическая, так и эволюционно-историческая сторона вопроса в ретроспективе (середина девяностых, конец «нулевых»). З.Ы. Просто в мануале манджаро для новичков они учат как создавать и монтировать раздел в /boot,хотя и сам давненько намеревался спросить. З.З.Ы. Вместо бубны поставил Дебиан, но и эту школоло поделку хочется потестить

GRUB не с каждой ФС умел грузиться, поэтому делали /boot на ext2. Да и сейчас делают, если rootfs на каком-нибудь ZFS.

+ отмонтировать после успешной загрузки или более мягкий вариант поставить на него кучу опций монтирования типа noexec, ro и т.д.

недавно пришлось так делать. Ядро уже умеет f2fs, а вот lilo пока ещё не умеет. Точнее lilo плевать откуда грузить, но настраивать его надо ручками, в hex редакторе. Да ну его нафиг, проще /boot/ сделать.

А вообще, с initrd boot не нужен, даже если FS поддерживается только модулем. ИМХО разумно сделать маленкую rootfs в EXT4. На 1Гб например.

В общем понял, респект. Другие варианты также принимаются. Да и еще: что-то анонов давно не было слышно. В отпуске что-ли? Ау!

отмонтировать после успешной загрузки или более мягкий вариант поставить на него кучу опций монтирования типа noexec, ro и т.д.

зачем? Если твою систему порутали, то хоть обставься, ты труп. А если не порутали, то ничего с boot ты не сделаешь.

И да, у меня оно ВООБЩЕ не монтируется, только для тестов. Отмонтировать его НЕ нужно.

Читайте также:  Проверить загруженность cpu linux

Тонкий троллинг

анонов вообще не слышно. Измельчал анон нынче.

Вот ведь любители в крайности впадать. Можно убивать плохо защищенную систему и без рута. Вот прикинь есть у тебя фс в которой ты можешь файлы создавать. А на этой фс у тебя еще и /boot и /log висит. И начинаешь ты создавать 100500 файлов-однобайтников и директорий внутри директорий и так пока ноды не кончатся или фс не начнет подыхать. Вот что тогда будет с системой?

Самая маленькая проблема, это если процессы не смогут писать в лог. Но знаешь ли ты что после этого начинается с системой?

Slackware Kung-Fu. Понравилось. Ъ

Я всегда так делаю. Скорее по привычке, но можно в этом и всякие плюсы найти.

Да и сейчас делают, если rootfs на каком-нибудь ZFS.

только те, у кого криокамера вышла из строя, и болезнь снова прогрессирует.

А еще так типа безопаснее — read-only /boot дополнительно защищает от бут-китов.

bootkit’ы под Туксом?! Пруф в студию, а то бродит по Европе призрак, призрак secureboot.

Иметь ядро и initrd на случай подыхания ФС

Зачем держать /boot на отдельном разделе.

Абсолютно незачем. Это удел некрофилов и идиотов.

Исторически он происходит от загрузчика, который умел грузиться только с регистрового пульта и содержал в себе драйвер накопителя на перфокартах или на магнитной ленте. Потом появился юникс, и он стал грузиться с ленты и содержал драйвер винчестера, с которого шла основная загрузка системы, а поскольку в юниксах раздел для работы куда-то должен быть примонтирован, ему отвели /boot. Вообще, это позволяло оперативно менять конфигурацию компьютера при минимальных затратах на изменение начального загрузчика.

Вот ведь любители в крайности впадать. Можно убивать плохо защищенную систему и без рута. Вот прикинь есть у тебя фс в которой ты можешь файлы создавать. А на этой фс у тебя еще и /boot и /log висит. И начинаешь ты создавать 100500 файлов-однобайтников и директорий внутри директорий и так пока ноды не кончатся или фс не начнет подыхать. Вот что тогда будет с системой?

ничего не будет. Будет работать, но не очень хорошо.

Ты другое скажи: при чём тут /boot/? Туда ВООБЩЕ ничего не пишется, и не читается. Там запись/чтение только при обновлении/пересборке ядра/настройки загрузчика. У меня так вообще система не пострадает, ежели этот /boot/ прибить нафиг. Да, будет так загружаться. Без /boot/. Ненужный каталог.

На загрузке там есть чтение ядра, но в lilo не из /boot/, а с того места, где БЫЛ этот /boot/.

Самая маленькая проблема, это если процессы не смогут писать в лог. Но знаешь ли ты что после этого начинается с системой?

K.О. докладывает: система не сможет писать в лог. Да, я знаю, неприятно и неудобно. Но таки не фатально.

PS: и по поводу «убивать без рута», то просто не нужно неруту прав давать куда ненужно.

drBatty ★★ ( 22.07.13 20:49:20 MSK )
Последнее исправление: drBatty 22.07.13 20:50:36 MSK (всего исправлений: 1)

Источник

Оцените статью
Adblock
detector