Solved Read and write permissions of mounted drive
#1
Hi all.
A big change happened today... I purchased a MacBook Pro! My first OS X machine. The best thing that i can say so far is that it looks and feels nice... but that is about it!
Here's the issue... I have a usb drive connected to my Pi, which seems to mount itself, that works perfectly with the Pi (running RaspBMC Gotham), and is also visible to all of my windows machines (via \\<local.ip.address> with the username of: pi and the password of: raspberry).
After a bit of messing about, i finally managed to access the USB drive on the mac (via cmd&k - smb://<local.ip.address>). The USB had to be formatted in MAC OS Extended (Journaled) to have permission to read it (Fat32/exFat would show a folder with no read rights) which is a pain.
Now what i really want is read and write permissions to the USB drive connected to the Pi, via Windows or OS X. I've looked at dozens of sites, but i can't fathom it out. I have tried logging into the Pi as Root after enabling it, but the Pi will not let me.

Sorry if this has been asked before but i have looked and I'm still struggling!

Previously i had the USB drive connected to my router, but again, the Mac cannot communicate with the router and says something like "The version of the server you are trying to connect to is not supported".

I would like to go back to the USB being connected to my router, but i have made more progress connecting it to the Pi, thus far.

Any ideas?

Thanks
Reply
#2
You cannot log in as root, because that is the way the underlying OS in raspbmc is configured.
If you want access to the devices via SMB remotely, then you need shares suitably defined in /etc/samba/smb.conf in addition to having the device suitably configured - which I find happens automatically when any partitions are labelled

I hope this helps - do hunt around and ask further questions if something isn't clear (and include detailed examples, please, to clarify).
Derek
Reply
#3
Thanks Dandnsmith. That's a start. I'll have a look at this file and see what I can do with it.
Reply
#4
Right... I thought there would be more to this file than there is. It reads...


[global]
workgroup = WORKGROUP
#usershare allow guests = yes
#security=share
security=user
follow symlinks = yes
wide links = no
unix extensions = no
lock directory = /var/cache/samba
[pi]
browsable = yes
read only = no
#guest ok = yes
valid users = pi
path = /home/pi
#force user = pi (no longer needed)
[devices]
browsable = yes
read only = no
#guest ok = yes
valid users = pi
path = /media
force user = root


Does anything look untowards here? The USB drive appears under 'Devices', so i assume there is a line of text to add here?
Reply
#5
That looks to be in order (without really close check) - no additional lines needed.
A USB device should get mounted automatically, and the files be visible under /media
Derek
Reply
#6
Right... progress has been made. I continued to search for things to change in this smb.conf file, but nothing seemed to have any impact on permissions. What i then tried was this... (I hope links to other forums is not against the rules)

http://www.raspberrypi.org/forums/viewto...28&t=48349

Basically i used the line

sudo mount -o uid=pi,gid=pi /dev/sdb1 /

and so far so good! I now have a Fat32 formatted USB connected to my Pi that i can read and write to via Finder on my Mac. The portion highlighted in the command is the location of the connected USB on the Pi (this can be found by navigating to System>System info>Storage within XBMC)

It seems that the way in which RaspBMC auto-mounts the drive somehow hinders Mac permissions. I now need to find how to get the Pi to do this automatically, as if i remove the drive, it needs to be re-mounted it again.

Is there a config file for how RaspBMC mounts a USB that can be tweaked? If so where is it located?
Reply
#7
It's something to do with making the Pi take ownership of the USB drive... Chmod or something like that?
Reply
#8
Just to clarify the command i used:

I created a directory:
sudo mkdir /media/USB

Then i mounted the drive:
sudo mount -o uid=pi,gid=pi /dev/sda1 /media/USB


The only issue that I have now is that I must do this each time I attach a USB drive to the Pi, even if it is the same one to the same slot! This is also the case if i reboot the Pi. I'm sure there is a way to add that line to a Boot file somewhere so it will execute when I power up the unit. I very rarely reboot the Pi but its annoying if i do.
Reply
#9
If your router was an Apple one I could help as I've only just recently figured out how to get the RPi connected to an Apple Extreme shared disk....

Reply
#10
My posts haven't been very clear... its my Mac that I'm struggling get connected to a HDD connected to the Pi. Thanks anyways
Reply
#11
Lengsville, I believe this should solve all your problems....

Code:
sudo fsck.hfsplus /dev/sda1

Have a read here:

http://www.raspberrypi.org/forums/viewto...91&t=60437

Reply
#12
Thanks wrxtasy but i am using a Fat32 formatted USB, not a HFS. I think i have sorted it now in a roundabout way. I finally found a thread with a solution: http://www.raspberrypi.org/forums/viewto...91&t=65769
This seems to work even when rebooting the Pi, but it must be done for each HDD. Using the UUID should mean that it works regardless of which USB slot it is replugged into after removal.
Reply
#13
Yep UUID is definitely the go in UNIX land, glad its all sorted.

Also if possible can you please edit the first post and select [SOLVED] in the far left selector of the Thread Title Bar... ?

Reply
#14
If that one is satisfactory, then perhaps you could also think about LABEL= to identify the 'disk' as you can make the label more handleable than the uuid
Derek
Reply

Logout Mark Read Team Forum Stats Members Help
Read and write permissions of mounted drive0