2

A user got 512 GB SSD and 2 TB HDD. The person asked me to install the Ubuntu Desktop 20.04 LTS on SSD, keep 50GB as /opt, 32GB for /swap and remaining space as /home and the whole 2TB HDD as /work partition. Can I create /work partition? If so, how?

I pasted the text as I received. Regret the confusion. The user has to install some commercial software in /opt. Of course, he missed / partition that I have to consider anyways. The machine has 128gb memory. The user insists on swap. Hope the question's clear now.

Thanks

Vamshi
  • 143
  • 2
    You've not provided product & release details; latest stable version and latest LTS version are different, plus there is the Ubuntu Core product too. Also did you mean Ubuntu Server? or Ubuntu Desktop? as they use different installers. You can use the Something else option for ubiquity installer to create whatever scheme you like (adjust if you're using a different product & thus different installer; as you didn't provide particulars). – guiverc Mar 10 '22 at 12:44
  • 2
    If the person knows exactly what they want partition-wise, I'm surprised they're asking you to do it. That said, if you can [edit] your question to include which version of Ubuntu you plan on installing, someone can let you know exactly how to set /work to be the entire 2TB HDD – matigo Mar 10 '22 at 14:06
  • 2
    It's strange, that of the 512GB the user defines space for /opt, /swap and rest for /home. I'm missing /. Don't care about /work, it can be easily done after installation, adding it to fstab. – pLumo Mar 10 '22 at 14:17
  • I'm not sure the person knows what they want, really. This scheme seems absurd, especially the 32GB swap. Currently no swap partition is needed (Ubuntu uses swafile by default) and in any case the size seems excessive. Having a separated /opt doesn't make sense also. It would be great if both you and that person knew what you're doing but given this question, it doesn't seem to be the case. – ChanganAuto Mar 10 '22 at 14:24
  • 1
    @ChanganAuto I still do use swap partition, despite the possibility to use swapfile, and follow the "golden old rule" that size of the swap partition should be twice the amount of RAM in the machine. So 32 GB swap isn't absurd or strange at all. – raj Mar 10 '22 at 17:14
  • @raj It is absurd because the reason for that "old rule" no longer exists. The installation default actually makes a 2GB max swapfile. This can be changed, increased, if needed but rarely is. The more RAM you have the less you need swap. The old rule was from the time when RAM was tiny and many programs could exhaust it in a blink so having such amount of swap was needed to comfortably avoid freezes. It was never that much though, it was just a worse case scenario preparedness thing. (...) – ChanganAuto Mar 10 '22 at 17:22
  • 1
    (...) Nowadays the worse case scenario is if you need hibernation in which case swap file/partition needs to be at least as much as physical RAM, preferably a little more. – ChanganAuto Mar 10 '22 at 17:22
  • 1
    @changanAuto The user has memory intensive operations. So having swap is always good. Plus disk space is cheaper than memory. I think it's fine to have some swap as virtual memory. – Vamshi Mar 10 '22 at 17:30
  • @ChanganAuto The reason swap file is set to 2x RAM is not for swap, it's for hibernation. Still, I don't think you would need twice RAM in this case but that's generally what the rule is for afaik. – mchid Mar 10 '22 at 17:49
  • @Vamshi Swap isn't and never was a replacement for actual RAM. Please inform your customer accordingly. If they need 32GB of swap for their "memory intensive" the system is seriously underspec'ed. – ChanganAuto Mar 10 '22 at 17:58

1 Answers1

7

Of course, you can create a /work partition. A better wording, however, would be that you can create a /work directory, and mount a partition to it.

Making directories outside your home directory requires you to act as the root user. In Ubuntu, one can execute a command with root priviledges by preceding it with sudo. Thus

sudo mkdir /work

will create a directory work at the top level (/) of the directory structure.

Then you can mount a partition to that directory. That involves editing /etc/fstab. It is described in many places, including on this site. Alternatively, you can use the utility "Disks" to set up a partition to mount automatically during startup in a directory you choose (/work) in this case.

Once you mount that partition there, you want to learn about linux permissions and symbolic links. On the partition, you can create folders, which you then could give to the different users on your system. With symlinks, you can make these folders directly accessible from within the user's home directory, i.e., preventing the need for your users to navigate out of their own home directory.

vanadium
  • 88,010