LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-29-2024, 10:39 AM   #1
rzdndr
Member
 
Registered: Aug 2023
Distribution: Slackware 15.0 x86_64
Posts: 68

Rep: Reputation: 8
Sharing ext4 partition among different linux distros


Hello,

Would it be possible to share an ext4 partition among different linux distros?

For instance have a /dev/sdd4 and mount this to /mnt/data on each of the distros that is multi booted, and share data between these.

Would the attributes (permissions, groups, users) pose a problem?

Regards
 
Old 03-29-2024, 12:29 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
No issue at all. Just make sure you access it under the same user name or at least numeric user id from each distribution or system.

For instance here in every system I have this line in /etc/fstab:
Code:
UUID=47af727a-ecc4-4241-b5e0-c121302d8197 /data ext4 noatime 1 2
I prefer to name the partition by UUID, and create a /data directory in each system instead of mounting on /mnt/data.
 
4 members found this post helpful.
Old 03-29-2024, 12:42 PM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,306

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
UIDs & GIDs will be a problem. You can use 'usermod' to change them, but then you have to change each distro to match. Once you do that, you should be ok as long as you keep root off the disk. Alternatively, if only root has permission, that makes uid & gid identical.
 
2 members found this post helpful.
Old 03-29-2024, 12:53 PM   #4
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
It might be worth pointing out that the partition UUID is not the same as the user uid. The user uid is the number in field 3 in /etc passwd. Example:

Code:
henca:x:406:100:Henrik Carlqvist:/home/henca:/bin/tcsh
Above my username henca has the numeric uid 406. On file systems like ext4 ownerships are stored as those numeric uids. If you care about group permissions you might also want to sync the gid numbers from /etc/group.

Many years ago I thought that dual- or multi-boot was useful to keep different operating systems. In practice however I allways ended up only using one prefered OS. Rebooting the machine to run some application in another OS is rather annoying. Today, whenever I feel the need to run another OS I use some virtual machine instead. Usually I prefer qemu for that.

regards Henrik
 
1 members found this post helpful.
Old 03-29-2024, 11:06 PM   #5
rzdndr
Member
 
Registered: Aug 2023
Distribution: Slackware 15.0 x86_64
Posts: 68

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by Didier Spaier View Post
No issue at all. Just make sure you access it under the same user name or at least numeric user id from each distribution or system.

For instance here in every system I have this line in /etc/fstab:
Code:
UUID=47af727a-ecc4-4241-b5e0-c121302d8197 /data ext4 noatime 1 2
I prefer to name the partition by UUID, and create a /data directory in each system instead of mounting on /mnt/data.
Yes that is what I thought too. The numeric user id (or maybe group id) must be the same. Maybe can use root only for that drive as business_kid mentioned.
 
Old 03-29-2024, 11:06 PM   #6
rzdndr
Member
 
Registered: Aug 2023
Distribution: Slackware 15.0 x86_64
Posts: 68

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by business_kid View Post
UIDs & GIDs will be a problem. You can use 'usermod' to change them, but then you have to change each distro to match. Once you do that, you should be ok as long as you keep root off the disk. Alternatively, if only root has permission, that makes uid & gid identical.
Root user might be an alternative.
 
Old 03-29-2024, 11:10 PM   #7
rzdndr
Member
 
Registered: Aug 2023
Distribution: Slackware 15.0 x86_64
Posts: 68

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by henca View Post
It might be worth pointing out that the partition UUID is not the same as the user uid. The user uid is the number in field 3 in /etc passwd. Example:

Code:
henca:x:406:100:Henrik Carlqvist:/home/henca:/bin/tcsh
Above my username henca has the numeric uid 406. On file systems like ext4 ownerships are stored as those numeric uids. If you care about group permissions you might also want to sync the gid numbers from /etc/group.

Many years ago I thought that dual- or multi-boot was useful to keep different operating systems. In practice however I allways ended up only using one prefered OS. Rebooting the machine to run some application in another OS is rather annoying. Today, whenever I feel the need to run another OS I use some virtual machine instead. Usually I prefer qemu for that.

regards Henrik
Changing (synching user/group id's) would also require to change user/group id's of all the files on both systems I believe.

Virtual machine would be the other alternative.
 
Old 03-30-2024, 01:17 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,579
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
I've been doing that for years. I use my home directories only for configuration files and temporary storage, and have a universal data partition for documents.
 
1 members found this post helpful.
Old 03-30-2024, 06:56 AM   #9
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by rzdndr View Post
Changing (synching user/group id's) would also require to change user/group id's of all the files on both systems I believe.
Yes, but you really only have to care about those users storing files on the shared partition. Usually this will be limited to normal users who live below /home. Or do you intend to use the shared partition also for system users like ftp, mysql and apache?

The need to have synchronized uid and gid numbers are not limited to multi boot OS sharing partitions. The same applies to networked systems sharing an directory with NFS.

regards Henrik
 
2 members found this post helpful.
Old 03-31-2024, 12:33 AM   #10
rzdndr
Member
 
Registered: Aug 2023
Distribution: Slackware 15.0 x86_64
Posts: 68

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by henca View Post
Yes, but you really only have to care about those users storing files on the shared partition. Usually this will be limited to normal users who live below /home. Or do you intend to use the shared partition also for system users like ftp, mysql and apache?

The need to have synchronized uid and gid numbers are not limited to multi boot OS sharing partitions. The same applies to networked systems sharing an directory with NFS.

regards Henrik
I wanted to share only data, to keep the home directories clean. Mostly downloads, and backups that I have.

I did not think about the ftp, mysql, apache and other users actually. Good point. Maybe I would need them, maybe I can just keep them as is, and use a user (root probably) to move data from these accounts.
 
Old 03-31-2024, 07:14 AM   #11
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by rzdndr View Post
I wanted to share only data, to keep the home directories clean. Mostly downloads, and backups that I have.
For such a simple use case it is not even necessary to have uid and gid synchronized between the systems. Yes, it would be nice if they have the same point of view on users and groups, but not completely necessary. All you have to do is to make sure that chmod is used to give all users the access that you want to have from other booted systems. Something like:

Code:
chmod a+r some_file.tar.gz
...to be able to read that file from other booted systems. If you choose to go that simple route, a command like "ls -la" might show strange ownerships of files. Maybe files will seem to be owned by some other local user, maybe files will be seemed to be owned by a user with only a numeric uid.

regards Henrik
 
1 members found this post helpful.
Old 03-31-2024, 08:41 AM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,306

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
A data partition is better than a shared /home for one extra reason that hasn't been mentioned.

I installed Debian as a second OS, largely for those ungainly packages (e.g. Kicad, FPGA suites, etc) that are so messy to build in Slackware, but pre-built for Debian. But Debian shows a bundle of Desktop shortcuts for packages I don't have in Debian. If I put anything into Debian (which I haven't yet), that will not exist in Slackware.

Another issue is X settings, with Mate in Slackware and Cinnamon(?) in Debian. I mean to enter Debian some day and reassign /home, but it's near bottom of my priorities ATM.

Last edited by business_kid; 03-31-2024 at 08:43 AM. Reason: Spellings/Incomprehensibility, as usual /sigh.
 
Old 03-31-2024, 01:53 PM   #13
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Yes, there are more reasons that you might want to avoid sharing home directories between systems...

Usually different applications and desktop environments are "backwards compatible" with the configuration files that live below your home directory. However those applications not allways "forwards compatible". As an example, if you are running installation A with KDE 2 fine and then start installation B with KDE 3 using the same home directory everything will seem fine until you again log in to installation A with KDE 3 and find that much has become broken.

In environments where different installations or machines share the same home directory I often modify some environment variables. Example from /etc/profile.d/kde.sh:
Code:
#!/bin/sh
# KDE additions:
KDEDIRS=/usr
export KDEDIRS
PATH="$PATH:/usr/lib64/kde4/libexec"
export PATH
if [ ! "$XDG_CONFIG_DIRS" = "" ]; then
  XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/etc/kde/xdg
else
  XDG_CONFIG_DIRS=/etc/xdg:/etc/kde/xdg
fi
export XDG_CONFIG_DIRS

# Added by henca to allow different versions of KDE to coexist
KDEHOME=$HOME/.kde_slack142
export KDEHOME
regards Henrik
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Working among different distros hamurabi Linux - Newbie 3 10-02-2013 11:22 AM
application for sharing screen among windows and linux stations? jaymz69 Linux - Newbie 6 03-07-2010 07:25 PM
Multibooting: Can I share one Firefox and one Thunderbird among several Linux distros brjoon1021 Linux - Software 2 10-03-2007 10:18 AM
Sharing a kernel among two distros vash_stewy Linux - Newbie 1 08-09-2004 03:23 AM
Looking for a way to Share Home Partition among Distros Huddlebum Linux - General 1 03-31-2004 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration