• I have a dual boot system with Mint 17.1 and Centos 6.6
  • I want to access a file in my CentOS user's home directory from Mint.
    • (I cannot boot CentOS right now.)
  • What is a clean/standard method for permissibly accessing files in a non-bootable foreign Linux partition?

  • I can mount and access the CentOS partition
    • The partition is encrypted; Mint allows me to enter the LUKS password through the user session, so that should not be a problem.
  • A Mint/Mate specific option is not preferable, but it would be al-right.)
  • Can you describe what's happening after you mount and try looking at the files? where exactly are you stuck, and what is the error message or non-desired behavior? – JDługosz Mar 18 '15 at 8:27

You can can mount a Centos partition in Mint

mkdir -p /mycentos/home
mount /dev/sdaX /mycentos/home

Where sdaX is the name of the partition

If you don't know the partition names - but you will need to know which one it is

fdisk -l
  • That is not an answer. "I can mount the CentOS partition..." he writes. – JDługosz Mar 18 '15 at 5:33
  • @JDługosz Good point - Should have not skim read. What is the question - he can mount/read the partition but cannot access a file? – Adrian Mar 18 '15 at 5:36
  • permissivly that's what I gathered. Either permissions because the uid isn't the same, or because of the encryption, or both. – JDługosz Mar 18 '15 at 8:20

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.