Score:0

How to share a disk partition between two ubuntu distributions

us flag

I have a dual boot with one ubuntu distro on each (18 and 20). Each ubuntu boots on a different partition, and are not related in any way. Now I have created an empty small ext4 partition outside of the 2 distros. I would like to share this partition between my distros. What is the best way to do it?

Here is what I tried:

mount the shared disk onto each distro. However, the folder seems to be locked, as I cannot create a folder. I tried unlocking using sudo chmod 777 to unlock it from Ubuntu18. Then I log onto my Ubuntu20 and do the same. However, if I log back onto Ubuntu18, it seems to be locked. This is understandable since chmod provides access to one user alone.

guiverc avatar
cn flag
By Ubuntu 18 & Ubuntu 20 (*no such release*) do you mean Ubuntu Core 18 & Ubuntu Core 20? as the *year* based releases are different products to the far more common *year.month* products, ie. 18 is not 18.04, and 20 is not 20.04 (the 18 & 20 represent *snap* only products, where as the 18.04 & 20.04 signify products that have aren't limited to *confined* apps & can use *deb* packages as well). Provide specific details of your releases, what file-system is involved & how it's mounted (ie. your `/etc/fstab` entry or other..)
user10489 avatar
in flag
I don't see how version affects the answer to this question at all.
user10489 avatar
in flag
Are you trying to run both distros at the same time or are you rebooting in between? What "folder" is locked and what command are you using to determine this is a problem? Does your user in each operating system have the same or different user IDs?
guiverc avatar
cn flag
@user10489 Ubuntu Core 18 & 20 both use *snap* apps which run confined and can only read specific directories on the real root file-system (with apps seeing a *fake* a *squashfs only* file-system instead) thus it's different to 18.04 & 20.04 systems where most apps can read the real file-system & aren't restricted to running *confined*.
OlorinIstari avatar
us flag
I am not running both distros at the same time. They are 18.04 and 20.04 Ubuntu desktops (apologies for being fairly vague, did not think this was important). How do I check if they have the same user ID? I presume they would be different? Also, I am willing to mount it any way. All I have done so far was format an unallocated space as an ex4 file system, that is all. I can clear the contents easily, they do not have any data yet.
guiverc avatar
cn flag
Please correct your question then, as Ubuntu uses the *year* format (18 & 20) to differentiate *specialist* products/releases that differ to the far more common 18.04 & 20.04; there are key differences between them that **can** make it more complex in the area you're asking about due to *confinement* that exists in 18 & 20 (but not 18.04 & 20.04). I would `mount` via *fstab* (file-system table) entries which should mean you have NO issues at all (I do it myself! ; it's a little more complex on one box due to partition encryption, but without encryption it's easy which I use on other boxes)
user10489 avatar
in flag
If your user is the first user on both systems, it's probably user id 1000 on both systems. You can check in /etc/passwd or with the `id` command. Also, please add to your question a better description of what "locked" means to you, including the error or other evidence that leads you to this conclusion.
oldfred avatar
cn flag
I have multiple Ubuntu installs and keep /home inside / as it is tiny with only mostly hidden user settings. And then all data folders normally in /home are in a data partition which I mount in every install. I had so many installs over time, I ended up scripting the fstab edit as UUID is always the same. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting & https://askubuntu.com/questions/1058756/installing-all-applications-on-a-ssd-disk-and-putting-all-files-on-hdd-disk
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.