LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ignore permission when copy from a hfs+ drive on CentOS (https://www.linuxquestions.org/questions/linux-newbie-8/ignore-permission-when-copy-from-a-hfs-drive-on-centos-4175481389/)

DrTek 10-19-2013 05:38 AM

Ignore permission when copy from a hfs+ drive on CentOS
 
Hi, there:

I've been messing around with CentOS for a couple of weeks now, and I'm loving it, but I'm still clueless on some aspects. One of them is how to properly manage data around. It happens that I need to service hfs+ drives, and I was expecting that this wouldn't be an issue. After a google search I found ksmod-hfsplus and installed it. Now I can read those hfs+ drives, but I can'r write them. Then I wanted to copy some files to the CentOS server for backing up, so I can access them from anywhere with an nfs share.

The problem came there. Some of the files on the drive can't be read because of permissions, and since I can't write on the drive I can't change them. What can I do to make linux ignore permissions and just copy them?

Also, I can't get the nfs accessible from the mac. If I invoke showmount -A 192.168.1.2 from the mac CLI I can see the nfs share, but when I try to mount it, I can't. I read some tutorials, and I can make the share on the server (still some confusion on the permits I shuld give to it) but I simply can't get the share to mount on the client. What would be a nice checklist for debugging this sort of issues?

Thaks, people!

j;e

lleb 10-19-2013 10:12 AM

getting the Mac to access to NFS share you need to put insecure in your exports file and you need to set your NFS server to run on static ports.

i use the following script on my OSx boxes to mount my NFS share on my CentOS 6.x server:

Code:

imac:~ user$ cat NFS
#!/bin/bash
#[! -d "/Users/user/Desktop/LVM/" ] && mkdir /Users/user/Desktop/LVM/
mount -t nfs jackknife:/exports/ /Users/user/Desktop/LVM/

here is my exports on my server:

Code:

[user@centos ~]$ cat /etc/exports
#
#        /etc/exports

#        NFS4
/exports *(rw,insecure,subtree_check,crossmnt,fsid=0)

#        NFSv3
/exports/centos/public *(rw,insecure,no_subtree_check,fsid=3010)
/exports/NFS_TV_Shows *(rw,insecure,no_subtree_check,fsid=3020)

note the bolded section under my NFSv3 export. OSx is not capable of connecting to NFSv4 as far as I can tell.

as for the permissions, thats just a nasty issue with Apple locking down their modified BSD file system. Your best option might be to put the Apple drive back into the Apple computer and transfer the files via scp, rsync, or once you get your NFS working via the GUI with click n drag.

DrTek 10-19-2013 11:02 AM

Thanks! That's been very helpful :)

As a matter of fact, connecting the drive to the Mac and then moving the files to the nfs share over ethernet was what I wanted to achieve once I started to find problems reading the drive directly via USB. I'll be servicing mac computers a lot, so I really appreciate the tip on using nfsv3 and the helpful script. Cheers!

j;)e

lleb 10-19-2013 06:32 PM

hope it all helps.

for what ever reason the centos support for afs+ is very very sketchy. last time i tried to mount and copy files like you were doing i ended up with a kernel crash. thankfully it nothing to my centos box, but still had to remove the drive and move the data via LAN instead of internally as i had wished.

DrTek 10-20-2013 07:16 AM

It helped, a lot, thanks! I'm moving now the files to the nfs over LAN. It is tedious, as I've got close to 2TB of data, and even it's a gigalan connection, it's taking its time. I've got one question, though: why is CentOS using the 502 GUID for the files I'm transferring? It's not a big deal, since I can read them from the Mac, but I'm curious. Also: how can I secure this nfs? When I share a folder on OS X Server, I can tell who can and who can't connect to that server using user accounts. How can I achieve something similar here? Once that files are tidied up, I want to share them with some users on the WAN so I'll need some level of security. In the end, I'm just building a lab for learning, and I want to simulate the environment that I could find in a real life SMB. Thanks for your help.

lleb 10-20-2013 08:55 AM

that is coming from your OSx. I would venture to bet the GUID of your user on the Mac is 502. mine was 501, i went in and change both my CentOS user and my OSx user to GUID 1000.

the securing of the NFSv3 is done via GUID/UID in the exports. you can add specific UID/GID to your exports. i THINK the link below will have some info to guide you towards it.

http://www.vanemery.com/Linux/NFS-Van.html

DrTek 10-20-2013 10:00 AM

Thanks for the link, mate :) As soon as I end moving the files around (and making a second copy, just in case) I'll start securing the share. I think I'll make a "share" group and then make an account for every user. I don't know yet if I'll be using local accounts on the server or I'll be configuring the LDAP service. Probably the second, as it is closer to a real life scenario.

Yep, you're right 502 is the UID on my Mac. Last time I reinstalled OS X I've set up a "ladmin" account before my usual account, and I completely forgot about it. That and the "games" group on CentOS completely confused me. You've been very kind, thanks for your help!

j;)e

lleb 10-20-2013 01:39 PM

no worries. i went through a lot of what you are facing now about a year and a half ago. it is not easy to find a lot of that info.

DrTek 10-20-2013 02:59 PM

I think you're right. The problem I've found with linux is that there's info everywhere, but it's scattered, so you've got to read from a lot of sources to find the solution you need. In one side that's great because you learn things along your way to solve your problem, but on the other side, it makes for a slow and disperse learning path. It's like when you start to grasp on a concept you've got to move to another, and you end up a little confused because you don't really know what would be the milestones you should be achieving first in order to follow a logic learning path. I suppose that in a year and a half I'll be a lot less confused and a lot more "enlightened". Cheers!

j;)e

DrTek 10-22-2013 02:00 PM

Hey, I just wanted to comment you that Apple is defaulting to SMB2 for Mavericks, instead of AFP. Also, that it can connect to NFSv3 and v4. Take a look at the pdf. Cheers!

http://images.apple.com/media/us/osx...y_Overview.pdf

j:)e


All times are GMT -5. The time now is 01:46 AM.