PDA

View Full Version : 20.04 LTS - .To Partition or not Partition?



Tim_Johnson
March 7th, 2021, 01:48 AM
Having used ubuntu since 2007, I have always installed with separate partitions for home and root. However, I have always done fresh installs.
I now have a computer with 20.04 pre-installed without partitioning. If I wanted to perform a new upgrade install of 22.04 presumably next year,
would re-installing the current OS with separate partitions for /home and / be helpful?

If so, should I add a swap partition? I read that the latest ubuntus install by default with a partition file, but I see that it is a matter of discussion.
After all, Linus T seems to favor continuing with swap partition ...

I should note that I am a happily retired programmer and although I'm still doing a little coding, the target machine is meant to be a workstation
for only a slightly higher level than casual use.

As an addendum, I am unable to edit my signature. I getting a permission denied message when I attempt to post changes.

grahammechanical
March 7th, 2021, 03:11 AM
If we have just one Linux partition it means that the home directory is in the same partition as the root directory. That is not a good situation to be in when re-installing as the re-install will format the partition taking out any data in the folders in /home .

So, it is much better to have 2 partitions. One partition for root ( / ) and another partition for home (/home). Then when we re-install we can instruct the installer not to format the /home partition.

In my opinion, the best solution is to have a root partition and a home partition and also a third partition in which we copy all our data to. Then when we re-install we can clear out by formatting both the root partition and the home partition without touching the data partition.

If you intend to do a fresh install then I do not see the purpose of doing a fresh install of 20.04. Just do a fresh install of 22.04.

Regards

Impavidus
March 7th, 2021, 12:01 PM
You can create a /home partition on your current system. See https://help.ubuntu.com/community/Partitioning/Home/Moving

Make sure you've got backups. If you want to shrink your current root partition, use a live disk.

Tim_Johnson
March 7th, 2021, 05:14 PM
Thanks for the replies. That is how is was in the past and I can now see that the same strategies are still recommended.

How about a swap partition? Should I create one too, given the current implementation of a swap file?

Cheers

Hagar Delest
March 7th, 2021, 05:31 PM
I've a slightly version of grahammechanical way: I've 2 partitions for / and I keep the /home in / (no dedicated partition). However, my data are in another dedicated partition (in fact I've more than 3 partitions).
The advantage is that the /home configuration also is brand new at each upgrade. I install alternatively on one and then on the other / partition.

AS for the swap, I've always used a swap partition. The rationale being that nowadays machines are quite powerful so and I'm not sensitive to swap performance. And using the SSD drive (with limited R/W cycles) may be a waste of lifetime for swapping.

And +1 for creating the partitions right now. Especially if you move your data only (without the whole /home).

SeijiSensei
March 7th, 2021, 05:38 PM
On the swap partition: https://ubuntuforums.org/showthread.php?t=2458900

I usually have separate primary partitions for /boot and /, with /home and the swap partition in the extended area.

Having a separate /boot partition is good if you have multiple operating systems on the drive. Otherwise it's probably not needed. If you do allocate a partition to /boot, make sure it is at least 512 MB in size.

oldfred
March 7th, 2021, 09:18 PM
I like to do new install to another / (root) partition and use 30GB. But do not use snaps which seem to be larger.
I do keep /home inside my /, but have all data in separate data partition(s) including some large hidden folders like Thunderbird & Firefox profiles. Then I just link data into my install. and all installs then have same data.
I then can boot old install or new install when upgrading in case of issues.
http://ubuntuforums.org/showthread.php?t=2315714
Splitting home directory discussion and details:
http://ubuntuforums.org/showthread.php?t=1811198 &
http://ubuntuforums.org/showthread.php?t=1901437