0

I’m still in the learning stages with Linux. I’m running a virtual server with Ubuntu 22.04 Server. I have a 500GB disk, but I only used 200GB for the boot partition (300GB free). I am logged in as an admin user. Whenever I create a partition using the free space and format it as ext4, it mounts as /media/username/volumename. Other users cannot see that partition.
I want to use this second partition to place mysql databases and website root folders on it, so I need this partition to behave like a system partition (Like having a D: drive in windows).

I have used the “Disks” utility, as well as fdisk/mkfs.ext4 commands. I have run this with sudo, and also logged into terminal as root. I am able to create the partition and access it with the user I was logged in as when I created it, but not other users. Am I going about this the right way?

Rich701
  • 103
  • 3

1 Answers1

2

/media is used to mount external disks.

If you want to mount an internal disk create a mountpoint in either / (the current more accepted method) or /mnt (old school method) and add that and its UUID to /etc/fstab. See for instance How to make partitions mount at startup? on how to do that.

One of the options is to set a user and a group. See for instance How to create a group, add users to the group, and have that user access all folders in files in that directory? Set it up with a new group that holds on your users and do a

sudo chown $USER:{your_new_group} /{mountpoint}

where {your_new_group} is your group and {mountpoint} the mountpoint for the partition. You can also do a

sudo chmod 770 -R /{mountpoint}

to make files executable, if appropriate, for the user and the group.

Rinzwind
  • 299,756
  • Forgive me, I'm sure I used incorrect Linux terminology all throughout my original question (I'm coming from the Windows world), so when I say "boot partition", I was referring to the volume where the OS was installed. But the link in the first paragraph gave me what I was looking for, so thank you! In the GUI application "Disks", I edited the partition, clicked "Edit Mount Options", and turned off "User Session Defaults". now I can create folders for all users to access. Thank you! – Rich701 Apr 19 '23 at 15:00
  • 1
    that is the root partition (or /) :) – Rinzwind Apr 19 '23 at 15:02
  • 1
    My /boot partition has been 256MB for years, which was how it was originally setup with my 12.04 server installation. I haven’t had a problem until recently when I attempted to upgrade from 20.04 to 22.04. There simply wasn’t enough space, even after deleting all the older kernels and unneeded files. To do the upgrade, it needed 144MB. So I think nowadays that the recommended size for /boot has increased. In fact, if I recall, the installer default is now 1GB. Anyway…FYI. :) – mpboden Apr 19 '23 at 17:38
  • removedi it; will add it after I looked into it; I never bothered with a boot partition and let it sit in /. I always do a re-install and never do an upgrade :D – Rinzwind Apr 19 '23 at 17:59