If possible, pick the same user IDs for the same users on both systems. Filesystems identify users by their numerical user IDs. If you mount the CentOS home directory on Mint, the filesystem records CentOS user IDs, but user IDs may have been assigned differently on Mint.
Let's say your CentOS user ID is 500 and your Mint user ID is 1000, and Mint has no user 500. After mounting the CentOS home directory on Mint, you'll see the files as belonging to user 500. To access them, you have three possibilities:
- Access them as root. Simple. Do this unless you have a prolonged need to access the foreign filesystem (in which case you should think seriously about aligning user IDs).
- Create a user
centoswattahay
on Mint with user ID 500, and use that account to access the file. This is obviously only an option if Mint doesn't already have an account with that user ID.
Create a view of the CentOS home with user ID translations. YOu can use bindfs for that. Let's say your CentOS partition is /dev/sdc1
:
mkdir -p /media/private/centos-raw /media/centos
chmod 700 /media/private
mount /dev/sdc1 /media/private/centos-raw
bindfs --map=500/1000:@500/@1000:501/65533 /media/private/centos-raw /media/centos
This snippet creates a mount point for the CentOS partition that only root can access. It then creates a view that anyone can access, but files owned by user ID 500 will be shown as owned by user 1000, files owned by group ID 500 will be shown as owned by group 1000, and files owned by user ID 501 will be shown as owned by user 65533.