Answer the question
In order to leave comments, you need to log in
How to organize disk partitions for Linux?
I'm about to switch from Windows to Linux. While I'm getting used to it in the virtual machine. Before putting it on a working machine, I want to ask how best to partition a disk into sections?
In Windows, everything was simpler - one system drive C and drive D, where all data is stored. If you need to reinstall the OS, you can simply format the C drive and re-roll the system there.
Question: how to properly separate user data from the Linux OS, so that in which case you can safely reinstall the same (or another) distribution without worrying about the safety of your files?
I found the corresponding manual for Ubuntu, but it did not help much.
Answer the question
In order to leave comments, you need to log in
A matter of taste.
On home machines, I do this:
/ - for the system (80 gb is enough, as a rule, for the eyes)
/ tmp - 2 gb
/ home - the maximum amount of
swap space - 2-4gb
Well, along the way.
If there are two drives, then nothing prevents you from pointing /home to the second drive, while everything else is on the first.
Those. if the experiment failed and you really want to reinstall the system (why?), then /home will remain on the second disk.
But in general, everything is possible on one disk.
We format the partitions only those that we want to format.
Why format the /home partition?
In this case, these partitions ( / , /tmp , swap , /home ) are drives c:, d:, e:...
ext4 / ~2G
ext4 /var ~4G
ext4 /var/log ~1G
ext4 /home >=40G
ext4 /usr >=16G
* ext4 /tmp ~2G - if RAM is low
** tmpfs /tmp - if RAM allows
swap ~2xRAM (about 2 times the available memory).
We format the rest of the place for whatever we want and mount it separately (example):
cat /etc/fstab
/dev/disk/by-uuid/2389db43-e74d-431c-a33e-ac57f6faaf49 /mnt/DATA auto nosuid,nodev,nofail,comment="x-gvfs-show,x-gvfs-name=DATA 0 0
The most correct thing is to use LVM, now almost any installer allows this. Advantages - you can resize partitions on the fly, take snapshots, etc. My system volume has never grown more than 100Gb, so you can, for example, split a terabyte HDD like this: 100 Gb - LV for the system, 750 Gb - LV for home, the rest is a service space for snapshots, etc.
In Windows, everything was simpler - one system drive C and drive D, where all data is stored.In Windows, everything was even simpler: one C drive. The data is on it. Why share?
Question: how to properly separate user data from the Linux OS, so that in which case you can safely reinstall the same (or another) distribution without worrying about the safety of your files?I would use four partitions for a basic fast drive as mentioned by Nadz Goldman .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question