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 |
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 |
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.
|
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 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 |
Quote:
|
Quote:
|
Quote:
Virtual machine would be the other alternative. |
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.
|
Quote:
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 |
Quote:
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. |
Quote:
Code:
chmod a+r some_file.tar.gz regards Henrik |
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. |
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 |
All times are GMT -5. The time now is 10:41 AM. |