A
A
athacker2017-05-12 11:52:54
linux
athacker, 2017-05-12 11:52:54

How to Feng Shui Partition a Disk in Linux?

Forced to learn linux here. In this connection, the question is - is there any fundamental importance in what sequence to place partitions on a disk? This mainly concerns the relative position of boot, swap and root. In theory, swap at the beginning of the disk is faster, can swap be placed first? Or is /boot desirable first, and then swap and / ?
And the second question. Do I understand correctly that if you use LVM on the system disk, then you can resize other partitions without the need to move data? That is, under the classical scheme, if you have a /var partition between (for example) /usr and /home (i.e. physically there are /usr partition blocks on the disk, then /var, and then /home), then with If you need to expand /var, you will first have to shift the beginning of the /home partition (and transfer data there from /home to the new beginning of the partition), and only then it will be possible to expand /var on the space freed up by the /home shift. I understand correctly that if you have LVM, you don’t need to transfer anything, and /var can be expanded simply if there is free disk space, I don’t care what LBA it will start with?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
X
xmoonlight, 2017-05-12
@athacker

We are watching at the bottom of the page

R
Ruslan Fedoseev, 2017-05-12
@martin74ua

since you are just starting out - entrust the partitioning of the disk to the system installer.

X
xotkot, 2017-05-12
@xotkot

Is there any fundamental importance in what sequence to place partitions on the disk?

As I understand it, you are not interested in using a virtual machine and SSD, but a specific placement on the HDD hardware?
if yes, then keep in mind that the read speed of the HDD , approximately, falls by half from the beginning to the end of the disk . Hence the strategy of placing frequently used information closer to the beginning of the disc. True, you also need to take into account the resources spent on head offsets when reading / writing.
In general, if we lose it a little , we can come to the conclusion that at the very beginning we should place the boot partition that we need at the start of the system. The necessary files will be sequentially, quickly and once read from the disk.
If you rarely use swappartition, then place it after boot , which will allow you to work with it quickly, though to the detriment of increased disk wear due to more intense mechanical loads (constant snooping of the head to the beginning of the disk).
If you often use a swap partition, then it is better to place it closer to the center of the disk, right after the root , which will allow you to work with it almost as quickly but with less wear and tear.
And yes, if there are several disks available, then place the swap and the system on different disks.

V
Valentine, 2017-05-19
@ProFfeSsoRr

If you are just starting to learn Linux, create one partition for everything and don't bother with anything. When you master it and you have some real need to single out something separately, then you yourself will understand why you are doing it and what makes you feel better about it. In the meantime, do not understand - and do not share. 1 section, without any LVM - the simpler, the clearer it is for you and the less headaches.
Swap may not be needed at all, depending on how much RAM and what tasks. If the desktop and RAM are at least 8GB, the swap is unlikely to come in handy.

E
Evgeny Bukharev, 2017-05-12
@evgenybuckharev

Swap is recommended to be moved to a file and not to a separate disk partition, also in the new version of ubuntu swap is located in the file by default

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question