Score:0

Trying to understand how partitions function…

kn flag

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?

Score:2
cn flag

/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.

Rich701 avatar
kn flag
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!
cn flag
that is the root partition (or `/`) :)
mpboden avatar
do flag
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. :)
cn flag
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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.