Partitioning¶
Disks and partitions under Linux¶
If you are not familiar with the Linux naming scheme for devices and partitions, or the concept of filesystems and mount points, read:
Dedicated /home partition¶
In Linux, the /home directory is used to store user data and preferences.
This directory contains one subdirectoy for each user account. Say your username is john , your home directory is /home/john , your downloads are in /home/john/Downloads , your documents in /home/john/Documents , your Firefox bookmarks somewhere in /home/john/.mozilla and so on…
By giving /home its own dedicated partition, you separate the user data from the rest of the operating system.
The advantage is that you can wipe the operating system and replace it without affecting the user data.
When installing Linux Mint:
- Assign the / mount point to the partition dedicated to the operating system, and tell the installer to format it.
- Assign the /home mount point to the partition dedicated to the user data, and if it contains user data already, make sure to tell the installer not to format it.
This is not recommended for novice users. A misstep during the installation could wipe all your data. Always make backups, make sure to select the right partitions and to carefully review formatting options.
A Linux Mint operating system takes about 15GB and grows as you install additional software. If you can spare the size, give it 100GB. Keep most of your free space for the home partition. User data (downloads, videos, pictures) takes a lot more space.
© Copyright 2017, Linux Mint Revision 11740971 .
Winaero
At the edge of tweaking
You may not republish any content as your original work or without credits. © Winaero
How to partition your hard drive to install Linux Mint
Starting today, I would like to cover Linux here at Winaero! There’s no need to panic. It will not replace our regular Windows articles and we will not shift the focus from Windows to Linux manuals and tutorials. However, it will be a nice addition for everyone who wants to give Linux a try for the first time if they are not satisfied with Windows. We will show on our blog how to prepare your PC to install Linux in a dual boot configuration. Today’s article is about how to partition the disk drive and optionally make it use a single partition. If you plan to switch to Linux in the future, or if you are just curious about this operating system, you will enjoy it.
Although I prefer Arch Linux for daily use, and it is my primary operating system, here we will cover Linux Mint because it is easy to use and is perfect for anyone familiar with Microsoft Windows. Linux Mint is one of the most popular distros at the moment of this writing. It combines the benefits of the popular Ubuntu Linux with the classic Desktop usability of Windows.
These days, more and more users are interested in trying out some alternative OS besides Windows. The latest Windows versions have become unsatisfactory even for people who were in the Windows camp for many years.
Today, Linux has made huge strides in end user usability and aesthetics. Previously, it was a bit geeky and installation wasn’t that simple. You were given too many choices and still had to resort to the command line for some operation. Modern Linux distros have a simple graphical installer which makes installation a breeze. It is as easy as installing Windows.
How to partition your hard drive for Linux Mint
It is a myth that Linux requires many partitions on the hard drive. Actually, there is no reason to have lots of partitions. When installing, you can omit most of them and have only a single partition where your Linux distribution will be installed.
Personally, I prefer having the following partition layout:
/boot — 300MB
/ — root partition of 20 GB
/home — the largest partition.
/swap — 2 x size of RAM
The boot partition has the boot loader files. The root partition contains the operating system files, logs and configuration files. The swap partition is used when your system needs to move memory pages between the RAM and the disk. And the Home partition contains all the user data, that is why it has the largest size.
But there is no actual reason to have a separate /boot partition unless you have some exotic or encrypted file system for the root (/) partition which cannot be read by the Linux kernel directly.
The reason I made a separate /home partition is for data safety. That way, you can unmount the /home partition and perform system maintenance without risk of data loss. You can even reinstall the operating system and format all the other partitions and keep your /home partition with all your data and app preferences intact!
As I said above, you can omit all these separate partitions and you can have only the /root partition. As for the swap partition, you can instead have a swap file. A swap file is slightly slower than a dedicated partition but is still quite usable. If you worry about slowdown issues, then just create the swap partition 2 x the size of your RAM.
To create the desired partition layout when installing Linux Mint, switch the installer’s page to «something else»:
It will show you the partitions on your hard drive. Mine has no partitions:
Press the «+» button to add a new partition. Adjust the partition size you want to give to Linux Mint, set the mount point to «/» (root) and leave the file system as ext4:
If you decide to separate the home partition, create it now as a primary partition with the desired size:
You can get something like this:
To create the swap partition, you need to create a new primary partition and select «swap area» as its file system:
In my case I created the following layout:
It has one root partition which contains all the user and system data, and the swap partition as well.
The swap file
If you decided to not create a swap partition and use the swap file instead, you need to do the following steps after the installation:
- Open the terminal app.
- Type the following:
- Adjust permissions for the /swapfile file using the following command:
- Format the file to be used as a swap file:
- You just created a ready-to-use swap file. Now you need to make it active. Open the /etc/fstab file with any text editor. Nano text editor is pretty good for this task:
- Type the following line in Nano:
- Press Ctrl + O to save the /etc/fstab file.
- Press Ctrl + X to exit Nano.
Type your current password to get root privileges. The prompt will change from the
symbol to #:
Type the following in the terminal:
This will create a new file, /swapfile with 1 GB of size. Adjust the size to the desired value.
You are done. After rebooting, the operating system will use the file /swapfile as the swap file. To check how your operating system is using the swap partition or the swap file, type the following command in the terminal:
It will show you which device, partition or file you are using for swapping purposes and how it is used at that moment:
That’s it. So, it is possible to use only one partition to run the Linux Mint operating system smoothly.
You are here: Home » Linux » How to partition your hard drive to install Linux Mint
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
For your convenience, you can subscribe to Winaero on the following web sites and services.
5 бесплатных программ для разметки разделов диска в Linux
Наш рекомендуемый список утилит для разметки жесткого диска в дистрибутивах Linux, которые позволят вам удалять, добавлять, настраивать или изменять размеры разделов диска.
Andrew E.
Read more posts by this author.
Andrew E.
Представляем вам наш рекомендуемый список утилит для разметки жесткого диска в дистрибутивах Linux, которые позволят вам удалять, добавлять, настраивать или изменять размеры разделов диска.
Обычно вы изменяете разделы диска при установке ОС. Но что делать, если вам нужно изменить разделы через некоторое время после установки. Вы не сможете уже вернуться к экрану настройки. Именно здесь вам пригодятся менеджеры разделов (или, точнее, менеджеры разделов дисков).
В большинстве случаев нет необходимости отдельно устанавливать менеджер разделов, поскольку он обычно предустановлен в системе. Также стоит отметить, что вы можете выбрать либо менеджер разделов на базе команд терминала, либо что-то с графическим интерфейсом пользователя.
Внимание! Играть с разметкой диска — рискованная задача. Не делайте этого без особой необходимости. Если вы используете инструмент разметки из терминала, вам необходимо сначала изучить конкретные команды. Иначе можно запросто просто стереть весь диск.
GParted
Возможно, это самый популярный менеджер разделов на основе графического интерфейса пользователя, доступный для дистрибутивов Linux. Возможно, вы уже устанавливали его в некоторых дистрибутивах, но если вы этого не делали, просто найдите его в программном центре и установите.
При запуске программе необходима аутентификация с правами root. Таким образом вам нет необходимости здесь использовать терминал. После успешной аутентификации выполняется анализ устройств, а затем производится настройка разделов диска. Также в программе есть функция «Попробовать восстановить данные», используемая в случае потери данных или случайного удаления файлов.
GNOME Disks
Менеджер разделов с графическим интерфейсом, который поставляется в комплекте с Ubuntu или любыми дистрибутивами на базе Ubuntu, такими как Zorin OS.
Позволяет удалять, добавлять, изменять размер и настраивать разделы. Также поможет вам в форматировании USB в Ubuntu, если есть какая-то проблема с носителем.
С помощью этого инструмента можно даже попытаться восстановить раздел. Параметры также включают редактирование файловой системы, создание образа раздела, восстановление образа и тестирование раздела.
KDE Partition Manager
KDE Partition Manager должна быть предварительно установлена на дистрибутивы Linux на базе KDE. Но если ее там нет, установите из центра приложений.
В случае, если она не предустановлена вы можете получить уведомление о необходимости получения прав администратора при запуске. Без прав ничего не удастся сделать, поэтому лучше запускайте ее такой командой:
После запуска программа сканирует устройства, затем вы сможете перемещать, копировать, удалять и изменять разделы. Также есть возможность импорта/экспорта таблицы разделов и другие функции.
Fdisk [Command Line]
Fdisk — утилита командной строки, которая используется во всех Unix-подобных ОС. Не волнуйтесь, хотя и требуется от вас запуск терминала и ввод команд — это не так уж и сложно. Однако, если вы слишком запутались при использовании текстовой утилиты, вам следует придерживаться упомянутых выше приложений с графическим интерфейсом пользователя. Они все делают одно и то же.
Чтобы запустить fdisk, вы должны обладать правами root пользователя и указать устройство для управления разделами. Вот пример команды:
Вы можете подробнее ознакомиться со списком команд на соответствующем ресурсе.
GNU Parted [Command Line]
Еще одна утилита командной строки, которую вы можете найти предустановленной на вашем дистрибутиве Linux. Для начала достаточно ввести следующую команду:
Заключение
Я бы не забыл упомянуть QtParted в качестве одной из альтернатив списку менеджеров разделов. Однако она не поддерживается уже много лет, поэтому я не рекомендую ее использовать.
А что вы думаете о менеджерах разделов, упомянутых здесь? Я пропустил какую-нибудь из ваших любимых? Дайте мне знать, и я обновлю этот список менеджеров разделов для Linux с вашими предложениями.