Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Symlink conflict between 2 OS's?

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Redrock3
Posts: 2
Joined: 2024-04-13 03:38

Symlink conflict between 2 OS's?

#1 Post by Redrock3 »

I'm dual-booting with Debian and Manjaro on separate partitions. Each has its own /home partition as well. Rather than trying to keep the files coordinated between the 2 /home partitions, I would like to create a third storage partition that I can access from each OS. That means each OS would have to mount the common partition. I'd like to create symlinks in each OS to that storage partition, but I have a couple of questions before I screw things up:

1. can that separate partition be the target of multiple mounts and links to different OS's at the same time? Obviously, only one OS would be functional at a time, but would multiple links cause a problem? Using one mount point and sharing it with each OS shouldn't be a problem if only one OS is mounting it at a time. Is the same true of symlinks?

2. I believe you can't create a symlink that has a source that's already in the source directory (such as Documents in /home/username). If I create a new source file in the link such as /home/username/link_to_Documents, will it automatically add that file to my /home directory?

3. I've seen several comments cautioning about creating a common storage partition. There can be conflicts over file permissions, configuration files, and more. How manageable are these, and is there an increased risk here because while Debian is Debian-based, Manjaro is Arch-based? An alternative to my plan may be to re-install Manjaro as a virtual machine, but would this Deb-Arch conflict still apply there if I try to access a storage partition in Debian from the VM Manjaro?

Any advice for a cautious newbie who's tired of re-installing OS's when things go awry? Thanks!

peter_irich
Posts: 1406
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: Symlink conflict between 2 OS's?

#2 Post by peter_irich »

I don't see the problems with third partition. You mount it independent in each /etc/fstab, in third partition you create directory with any name, for example, nobody, enter as root commands

Code: Select all

chown nobody:nogroup nobody
chmod 775 nobody
an in both systems add user in group nogroup.

User avatar
pbear
Posts: 384
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

Re: Symlink conflict between 2 OS's?

#3 Post by pbear »

Redrock3 wrote: 2024-04-13 17:10 I've seen several comments cautioning about creating a common storage partition. There can be conflicts over file permissions, configuration files, and more.
The first sentence sounds like a data partition; the second sounds like a home partition. A data partition can be shared easily, a home partition not so much (for the reason described in the second sentence). FWIW, I use a data partition on all my systems. As I'm the only user, there are no permissions issues. If you have multiple users, the only trick is to make sure everyone has the same uid/gid on each system. Not sure I understand the symlink question. For comparison, I mount the data partition to /data/files, then symlink the various folders (Documents, etc.) into Home. If that's what you have in mind, yes, works fine. If you have something else in mind, please clarify.

Redrock3
Posts: 2
Joined: 2024-04-13 03:38

Re: (SOLVED) Symlink conflict between 2 OS's?

#4 Post by Redrock3 »

Thanks to both responders. The separate data storage partition was set up with /Documents and /Downloads sub-directories. It was mounted in
/etc/fstab in both OS's. Ownership was set with chown. Symlinks were created from the Desktops in each OS to the Documents and Downloads sub-directories after a little experimentation on exactly how to write out the script. It was easiest to link the 2 sub-directories to ~/Desktop, and it all worked. The links show on the Desktop as I had hoped.
I renamed the pre-existing Documents and Downloads sub-directories to specify that they're for temporary use only, but their parent, /home, will continue to contain all the configuration files. There shouldn't be any conflict between the OS's that way. Thanks for the reassurance that this would work! :)

jmgibson1981
Posts: 308
Joined: 2015-06-07 14:38
Has thanked: 11 times
Been thanked: 36 times

Re: Symlink conflict between 2 OS's?

#5 Post by jmgibson1981 »

I'd like to reinforce that this works for all kinds of things. As long as your config .folders and .files are separate you can do this with any and all data. some stuff though like flatpak .var and .steam folders will need to be fully bind mounted though. they don't seem to work correctly with a symlink at this point in time. I've found this across all distros I've messed with recently. Can't speak to snaps though but I'd surmise a similar thing

User avatar
pbear
Posts: 384
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 63 times

Re: Symlink conflict between 2 OS's?

#6 Post by pbear »

@redroses, not sure I understand your symlink strategy, but if it works for you, great. FWIW, what I do is a little different. My symlinks replace the data folders in Home, which I think is the usual method.

Post Reply