• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Part 1: Partitioning system in Linux

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
We all have used Windows at some point in our life. There's C drive for most of the system files. Then we have couple of one or more drives for our "work" and other stuffs. This is partitioning in windows.

Now when we look at Linux(it can be anything Ubuntu, Centos, RHEL etc) operating system, we have similar partitioning but different nomenclature.

We will generally always have /boot, /, /home and swap partition by default if you go by automated install. These are like your C drive, you need to have them for your system files.

Now, you might think, when is this created?Can I alter it?
In Linux, so every time you install an operating system, it installs on the basis of kickstart file(anaconda.ks or .ks). In this file, either we can go for automated partitioning or manually tell the system to create xyz partitions.

Generally 2 types of partitioning are most popular. First one being lvm partition and the other one being plain partition.

Here's an example of lvm partition.


# System bootloader configuration
bootloader --location=mbr

# Clear the Master Boot Record
zerombr

# Initialize the disk and remove all partitions
clearpart --all --initlabel

# Partitioning: Create a small /boot and use the rest for LVM
part /boot --fstype=ext4 --size=1024

# Create a physical volume for LVM
part pv.01 --size=1 --grow

# Create a volume group
volgroup vg0 pv.01

# Create logical volumes
logvol / --fstype=ext4 --name=lv_root --vgname=vg0 --size=10240
logvol /home --fstype=ext4 --name=lv_home --vgname=vg0 --size=5120
logvol swap --fstype=swap --name=lv_swap --vgname=vg0 --size=2048

So, we create a physical volume and on top of it, we create volume group. So, it will be like a tree structure.

For reference


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Plain partition
This type of scheme works generally with ext4 and xfs filesystem. So, here instead of creating any physical volume or logical groups, we directly create partitions like we do in windows.

Here's a sample example how we do in kickstart


# Install OS on the first hard drive
bootloader --location=mbr
zerombr
clearpart --all --initlabel

# Create plain (non-LVM) partitions
part /boot --fstype=ext4 --size=1024
part swap --fstype=swap --size=2048
part / --fstype=ext4 --size=10240
part /piyush --fstype=ext4 --size=20480
part /home --fstype=ext4 --size=8192 --grow

So, i've created my own partition with 20Gb of size.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



So, now you can have your own partition with your own naming standard and your desired size.

I'll talk about the nitpicks of both partition schemes, which one to use and more on kickstart on the next part


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу