2

I want to fresh install Kubuntu 22.04.3 LTS any my HD is 500GB.

Are there guidelines for what sizes to use per partition (and what mounts) e.g. best size for swap, best size for EFI partition etc?

E.g. does it make sense to create a partition and mount for each e.g.

/home ext4
/root ext4
/usr ext4
/tmp ext4
/var ext4
/var/log ext4
/swap
/efi

Is the following from Dell a good reference? enter image description here

I am confused about this because based on this Dell table I would need to give half of my disk space (256GB) to /swap/ and /tmp (RAM = 64GB)

Update: During the manual partition somehow the USB bootable stick got corrupted

During installing with LVM encrypt when I got the warning that all will be wiped out and pressed GO BACK after abandoning the installation the existing system was completely messed up. Kubuntu installer seems to have corrupted HD and did not boot. I think that's a bug in the Kubuntu installer

Jim
  • 127
  • No. If you have to ask, then you should stick with the default being one partition for / and no other partitions except boot – Daniel T Feb 10 '24 at 09:48
  • @DanielT:But isn't the performance better with multiple partitions? – Jim Feb 10 '24 at 09:50
  • I've never heard about multiple partitions utilized to improve performance. Ext4 should be quite smart these days with one partition. Wrongly partitioned, the performance will suffer if there is an imbalance in disk space utilization. You will also have a hard time if you want to move space from one partition to another – Daniel T Feb 10 '24 at 09:56
  • @Jim no. Only if you have an ssd + hdd. – Rinzwind Feb 10 '24 at 09:56
  • @DanielT:I see. I thought that smaller partitions allow for better access patterns but I get what you mean.By the way I see now that if I follow the Dell's article I would need to assign half of my HD to swap and tmp – Jim Feb 10 '24 at 09:58
  • @Jim here you go ;) below is how I setup my system (I am using an ssd as boot device and a hdd for my own files though) – Rinzwind Feb 10 '24 at 10:02
  • 1
    Keep it simple is usually best. If you have only a single partition (excluding required such as ESP); you don't need to worry about getting sizes right. If you have specific use cases (esp. on servers) other partition(s) are useful but you do mention Kubuntu or a desktop install! You can non-destructively re-install Kubuntu when using a single partition; so a separate /home is useful if you plan going to a non-Ubuntu OS that can't non-destructively install without a separate /home, but Kubuntu/Ubuntu doesn't require this. Swap partitions add complexity; use swapfile as easier. – guiverc Feb 10 '24 at 10:13
  • 1
    Also be very aware that /root and the root partition (ie. /) are very different things. The /root/ partition is usually only KB or at most MB in size.... where as the root partition being / is very critical. (/root is the user account for the root user) – guiverc Feb 10 '24 at 10:16
  • @guiverc: but you do mention Kubuntu or a desktop install! It is Kubuntu on a laptop – Jim Feb 10 '24 at 10:31
  • The directories in your dell reference relate to server installs.. If you look at the desktop pages (eg. https://www.dell.com/support/kbdoc/en-au/000131391/how-to-install-ubuntu-with-multiple-custom-partitions-on-your-dell-pc) you'll note only 3 partitions are mentioned; / or the root partition, /home (which is optional) and swap which can be used too, but using swapfile allows you to easily increase/decrease size at will instead of planning ahead which swap partition requires... KISS is usually best. – guiverc Feb 10 '24 at 10:36
  • @guiverc: So if I have only / and swap is not required and also /home is optional isn't that the same as choosing the option of Using the entire disk during the installation process? Also using swapfile is that an option to explicitly select or it is installed by default? – Jim Feb 10 '24 at 10:38
  • FYI: I do like the idea of /home partition as an escape route if I decide some day in the future that I want to leave Ubuntu and go elsewhere (given many GNU/Linux systems cannot preserve files unless there is a /home partition) however this system doesn't have a separate /home, as I have no intention of leaving Ubuntu GNU/Linux here. FYI: You mention Kubuntu, but gave no release details thus we can't be specific, as some install details can change over time (ie. between releases) but most recent releases create swapfile by default UNLESS you specifically create swap partition. – guiverc Feb 10 '24 at 10:39
  • @guiverc: Kubuntu 22.04.3 LTS – Jim Feb 10 '24 at 10:50
  • 1
  • @DanielT: you were right. I tried to do manual partition and even though the system booted the USB bootable stick got corrupted. Also I saw that if I select encrypted LVM and then on the warning of deleting everything and press GO BACK the existing installation is fully corrupted. I think that's a bug in Kubuntu – Jim Feb 10 '24 at 14:20

1 Answers1

3

You are listing a setup for a SERVER and one that has long ago been abandoned.

  • no swap, we use a swap file
  • /tmp and /efi are not for you to setup; the installer takes care of it. /var only if you use a server and even then there are better option: you edit mysql conf and log conf to use your data partition and not /var/ (you want to keep those files after a re-install anyways).

The only one you need is a data partition: so / for --a minimum-- of 25Gb (add a few if you want) and the remainder as a named partition (I called mine /discworld/, You can use NTFS -if- you have a dual boot; otherwise stick to EXT4).

Edit ~/config/users-dirs.dirs to point to the partition, Then "move" the directories in /home/$USER/ to /discworld/.

This has nothing to do with speed but with convenience:

  • easy backup of personal files
  • re-install means formatting / and mounting your data partition.

So during the installation in the create new partition menu. Define a partition mounted at / and ext4. Then a second partition e.g. mounted on /home or /jim?

I would use /jim myself and keep /home/ on / and empty except for the hidden (/config) files in there . You can use /home but that has to be ext4 so if you have another OS (ie. Windows) you can not see those files.

Why only 25GB for /?

For a desktop this is more than enough, You will not reach 20.

Can I use e.g. 100GB instead?

Sure. You can always change it using gparted the shrink and enlarge options.

Edit ~/config/users-dirs.dirs to point to the partition... is this something to do after the installation?

Afterwards.

Examples from my system with all the fluff removed:

rinzwind@discworld:~$ df -H
Filesystem      Size  Used Avail Use% Mrun
/dev/nvme0n1p2   41G   17G   23G  43% /
/dev/nvme0n1p3  462G  275G  164G  63% /discworld

(17G is due to using snap but in all my years it never went over 20Gb; I always check just before reinstalling to a new version)

and

inzwind@discworld:~$ more .config/user-dirs.dirs 
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="/discworld/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="/discworld/Desktop"
XDG_DOWNLOAD_DIR="/discworld/Downloads"
XDG_TEMPLATES_DIR="/discworld/Templates"
XDG_PUBLICSHARE_DIR="/discworld/Public"
XDG_DOCUMENTS_DIR="/discworld/Documents"
XDG_MUSIC_DIR="/discworld/Music"
XDG_PICTURES_DIR="/discworld/Pictures"
XDG_VIDEOS_DIR="/discworld/Videos"

Also: the smart thing to do is to add all alterations you do into a textfile or copy files to your own partiton. If you do that you follow up a re-install by executing that text file and the system itself sets itself up (instead of you editing the same files every 6 months ;))

Rinzwind
  • 299,756
  • So during the installation in the create new partition menu. Define a partition mounted at / and ext4. Then a second partition e.g. mounted on /home or /jim? Why only 25GB for /? Can I use e.g. 100GB instead? 2) Edit ~/config/users-dirs.dirs to point to the partition... is this something to do after the installation? When am I supposed to do that? By the no dual boot and no data on disk. – Jim Feb 10 '24 at 10:07
  • @Jim I added it to the answer – Rinzwind Feb 10 '24 at 10:17
  • s/setuo/setup first line (abandoned also spelt incorrectly) FYI: 25/20 GB for / isn't enough for anyone; my personal minimum for my desktop is 32GB & I prefer larger as so I'm wasting less time trying to clear space so I can login... It'll depend on how the machine is used (my usage is likely atypical; most will fit in 25GB which is the recommended minimum for modern Ubuntu Desktop) – guiverc Feb 10 '24 at 10:17
  • 1
    If jim wants 100Gb we aint stopping Jim ;) It is a guideline anyways. If you want to use all snaps and flatpaks instead of apt 100Gb might not even cut it :X – Rinzwind Feb 10 '24 at 10:23
  • keep /home/ on / and empty but I have seen that when I do a pwd on any linux install that shows /home/jim. So I thought all users are under /home – Jim Feb 10 '24 at 10:36
  • they are. and in there are all the config files too for each user (in hidden dirs). THIS setup is rather 'global': it works for users using more than 1 OS that want to share the files over those OS's (you format your /jim to a filesystem all accept) and for 1 OS (if Linux you pick ext. Just do not use ntfs if you do not have windows ;) ) – Rinzwind Feb 10 '24 at 10:41
  • So basically the steps are: 1) In the partition window in installation define a partition mounted at / and ext4 and size at least 25GB. 2) Create a second partition /jim for the rest of the size and ext4. Do the installation. After the system starts, update the .config/user-dirs.dirs to point to the partition. Is this correct? Also this file .config/user-dirs.dirs part of the Kubuntu installation or is it for my reference? – Jim Feb 10 '24 at 10:49
  • Yes and yes. There are some things to do I skipped ;-) You need to chown the partition (it will be owned by root) and you can then 'mv" the directories in /home/$USER/ to /jim/ (and then edit your file manager to use those locations). – Rinzwind Feb 10 '24 at 11:01
  • Going with this approach is it possible to also have encrypted LVM? – Jim Feb 10 '24 at 12:39
  • It asks for EFI partition when trying to create the partitions and proceed with the install – Jim Feb 10 '24 at 13:17
  • So I tried to do that but turns out I also corrupted the bootable USB stick in the process – Jim Feb 10 '24 at 14:08