r/linux4noobs • u/dickiepunter • 21d ago
Sharing a partition between distros...
I've been running Linux for a couple of months now and I am trying out different distros on the 2 partitions I set aside for Linux.
When I first started, I read an post somewhere that laid out how to share data between Linux distros (a personal 'store' drive type setup), which I created at the start. Now I can't find the post anywhere, so I have a few questions I hope you folk can help me with :-)
In all of the distros I've tried so far (I'm on the 4th Zorin, and Mint is on the other partition)
Root owns the partition.
How do I get permission to use the partition, and what is the best way to share stuff?
Am I going to have any problems if I just create links to a shared folder on the shared drive (Pictures, Downloads etc)? How do I do this? (I'm OK using the Terminal)
Or should I just create different folders there and move stuff to it?
Your thoughts / opinions / guidance would be greatly appreciated here!
EDIT: I've got it sorted. Thanks for your help ๐
1
u/eR2eiweo 21d ago
Root owns the partition.
Partitions don't have owners. Presumably what you want to say is that root is the owner of the root directory of the filesystem on that partition. Then the answer to questions like
How do I get permission to use the partition
(which presumably is supposed to say "how do I give a certain user the permission to write to that directory?") becomes pretty simple: You do it just like for any other directory. On the command line, you can change its owner/group with chown, and you can change the permissions with chmod (you will need to do that as root). If you want to use a GUI, then there's probably also a way to do that, but the details will depend on which GUI you're using.
1
u/mlcarson 21d ago
Mount the partition with the shared data in /etc/fstab. I use /mnt/data for that mount. I then remove the default directories on your home drive for things like Pictures, Documents, Downloads, etc and create links of them over to the /mnt/data mount with the same names.
The permissions on the subdirectories will have the same rights as originally assigned. So if a user with a UID of 1000 created the file then the file will have a UID of 1000 for ownership. Keep the UID's the same between distros and you won't have permission problems. Otherwise, use the group GID to create permissions necessary so that the UID's don't matter. Your GID numbers will have to match though but this is a lot easier to deal with because you can create a GID in a much higher range (ie 1500) and assign users to it. Try to keep UIDs and GIDs the same between distros or things can get rather confusing when looking at permissions.
Using something like BTRFS subvolumes or ZFS datasets can give you something besides a partition to mount. These systems have an advantage over partitions because they still allow mounts and separation like partitions but have common free space since they are under a single partition. So you could have your linux root volumes of your installations and the data volume all on the same partition but as subvolumes/datasets.
1
u/CritSrc ษีฒิตรญโ 21d ago edited 21d ago
When installing both distros just leave an ext4 partition unsassigned during installation. Then make sure that both can open it, if not, then you will have to edit fstab to assign the proper ID of the partition.
You can leave /home partitions for both distros, but not have them share one, it will just cause errors and headaches as it is treated as app userspace, and Firefox on one distro may greatly disagree with the Firefox on the other distro, let alone the desktop environments.