Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Mount SAMBA share on RPi

Wed Aug 15, 2012 6:44 am

Having loads of trouble mounting a SAMBA share from a DNS-323 on the RPi. Used

Code: Select all

sudo mount -t cifs //192.168.1.2 /mnt/box/
But no dice, prints:
"Retrying with upper case share name
mount error(6): No such device or address"

Ok, sure so maybe I don't have the address correct, tried several variations, again, no luck. Searching Mr. Google, I found I could use smbclient or smbtree to find the share name from within RPi, and installed smbclient.

Tried smbclient -L 192.168.1.2 but that just prints:

"Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'
tree connect failed: NT_STATUS_ACCESS_DENIED"

I'm just trying to access the SAMBA share as guest, as I've setup my internal network w/o needing accounts. I'm pretty new to all this linux, so any help would be greatly appreciated!

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 8:28 am

Turns out I wasn't using the correct host and needed to add the share name as well. Thought it would be ok without it, apparently not!

New problem: I want this share to be persistent through reboots, so I added

Code: Select all

//192.168.1.2/Volume_1 /mnt/box cifs
to /etc/fstab . Rebooted and now the RPi is no longer accepting SSH logins. Will try later when I get home.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 8:29 am

Is there supposed to be a space between the server address and the directory?
Try removing the space.

vinntec
Posts: 147
Joined: Thu Aug 02, 2012 9:37 am
Location: Basingstoke, UK

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 10:53 am

bredman wrote:Is there supposed to be a space between the server address and the directory?
Try removing the space.
On my one I have
//IREIGN/C /mnt/c cifs username=...etc
C is what windows is sharing it as, and /mnt/c is my mount so providing his disk is being shared as Volume_1 then no problem, I think.

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 10:59 am

If there wasn't a space, it would read the mount directory as part of the host.

The RPi seems to have had an issue. Watching the boot sequence from the TV, it hangs indefinitely after attempting to configure the network interfaces. No SSH, just nothing. Any suggestions?

User avatar
RaTTuS
Posts: 10539
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 11:31 am

not sure of exactly your problem
but spaces in share names will cause you issues
//share/vol 1 is not the same as
//share/vol\ 1
you will either have to escape out the space or enclose the lot in ""
not sure which it will be ... my 1st guess will be escaping
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

vinntec
Posts: 147
Joined: Thu Aug 02, 2012 9:37 am
Location: Basingstoke, UK

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 11:54 am

RaTTuS wrote:not sure of exactly your problem
but spaces in share names will cause you issues...
Unless I need new glasses, he is using Volume_1 for the share name which doesn't have spaces (unless you can't see the underline character for some reason?).

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 11:55 am

RaTTuS wrote:not sure of exactly your problem
but spaces in share names will cause you issues
Of course. Do you see a space in the share name?

User avatar
RaTTuS
Posts: 10539
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 11:58 am

yes I see a space , however after refreshing the browser
//192.168.1.2/Volume_1 /mnt/box cifs
it's back as it should be ....
sorry for that
[chrome / prosilver problems maybe ? .... ]
not to worry
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

vinntec
Posts: 147
Joined: Thu Aug 02, 2012 9:37 am
Location: Basingstoke, UK

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 11:59 am

Hans Olo wrote:If there wasn't a space, it would read the mount directory as part of the host.
The RPi seems to have had an issue. Watching the boot sequence from the TV, it hangs indefinitely after attempting to configure the network interfaces. No SSH, just nothing. Any suggestions?
Hmmm - when SSH doesn't work, that's bad. if you have another Linux machine which can read the SD card, I would look at whatever you changed last and see if there is anything obvious (comment them out possibly for a test).
If you are buring SD card from Windows, then you can only "see" the boot partition which is less helpful. In which case you might need to do an emergency boot. I will try and track down the instructions for doing this and see if it can be used to help in this case.
Peter

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 12:10 pm

Hans Olo wrote:The RPi seems to have had an issue. Watching the boot sequence from the TV, it hangs indefinitely after attempting to configure the network interfaces. No SSH, just nothing. Any suggestions?
You could try booting into safe mode.
http://www.raspberrypi.org/phpBB3/viewt ... 29&t=12007

halfabiscuit
Posts: 26
Joined: Thu Jun 21, 2012 10:55 am

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 12:26 pm

Format for mounting a samba share in /etc/fstab is:

Code: Select all

//192.168.1.1/RemoteShare /LocalMNT smbfs username=bob,password=password
where:
192.168.1.1 is the address of the server hosting the share
RemoteShare is the name of the share on the remote server (not necessarily the directory name but what it is shared as)
LocalMNT is the absolute path to the local directory you want to mount it to - make sure it exists and you have permission to access it
smbfs denotes you are using the samba file system
username=bob,password=password are the credentials you are using

vinntec
Posts: 147
Joined: Thu Aug 02, 2012 9:37 am
Location: Basingstoke, UK

Re: Mount SAMBA share on RPi

Wed Aug 15, 2012 12:28 pm

bredman wrote:
Hans Olo wrote:The RPi seems to have had an issue. Watching the boot sequence from the TV, it hangs indefinitely after attempting to configure the network interfaces. No SSH, just nothing. Any suggestions?
You could try booting into safe mode.
http://www.raspberrypi.org/phpBB3/viewt ... 29&t=12007
Then to access your Linux partition you need to:

Code: Select all

mount /dev/mmcblk0p2 /mnt
vi /mnt/etc/inittab
reboot
Good luck! Peter

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Thu Aug 16, 2012 6:53 am

Thanks for the valid suggestions Peter and bredman. Before your post Peter, I was off to do just that, read the card in Windows. After much tribulation, I was able to load the linux filesystem on my OSX machine. Edited out the entry in fstab and everything booted back to normal. For future seekers/reference, I used http://ekettoz.blogspot.hk/2009/06/moun ... tions.html, Installed Fuse and fuse-ext2. The linux partition was immediatly mounted, but for write access one needs to mount via

Code: Select all

 fuse-ext2 /DeviceName /LocalMountPoint -o rw+

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Thu Aug 16, 2012 7:02 am

halfabiscuit wrote:Format for mounting a samba share in /etc/fstab is:

Code: Select all

//192.168.1.1/RemoteShare /LocalMNT smbfs username=bob,password=password
where:
192.168.1.1 is the address of the server hosting the share
RemoteShare is the name of the share on the remote server (not necessarily the directory name but what it is shared as)
LocalMNT is the absolute path to the local directory you want to mount it to - make sure it exists and you have permission to access it
smbfs denotes you are using the samba file system
username=bob,password=password are the credentials you are using

I'm aware of the format, but read that smbfs is deprecated in favor of cifs. CIFS is the new way to mount SAMBA shares as it is more feature rich. That being said, my share does not require a user or password so I left those out. Any one hazzard a guess as to why adding

Code: Select all

//192.168.1.2/Volume_1 /mnt/box cifs
breaks the boot process, and how to correctly add this SAMBA share to fstab?

vinntec
Posts: 147
Joined: Thu Aug 02, 2012 9:37 am
Location: Basingstoke, UK

Re: Mount SAMBA share on RPi

Thu Aug 16, 2012 7:17 am

Hans Olo wrote: I'm aware of the format, but read that smbfs is deprecated in favor of cifs. CIFS is the new way to mount SAMBA shares as it is more feature rich. That being said, my share does not require a user or password so I left those out. Any one hazzard a guess as to why adding

Code: Select all

//192.168.1.2/Volume_1 /mnt/box cifs
breaks the boot process, and how to correctly add this SAMBA share to fstab?
Hi Hans - are you using static IP addresses on your network, or ones assigned by DHCP? One thing which might cause the RPi to go totally ape is if you tried to define on Samba the RPI's own IP address? Is this even a remote possibility? Peter

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Thu Aug 16, 2012 7:51 am

vinntec wrote:
Hans Olo wrote: I'm aware of the format, but read that smbfs is deprecated in favor of cifs. CIFS is the new way to mount SAMBA shares as it is more feature rich. That being said, my share does not require a user or password so I left those out. Any one hazzard a guess as to why adding

Code: Select all

//192.168.1.2/Volume_1 /mnt/box cifs
breaks the boot process, and how to correctly add this SAMBA share to fstab?
Hi Hans - are you using static IP addresses on your network, or ones assigned by DHCP? One thing which might cause the RPi to go totally ape is if you tried to define on Samba the RPI's own IP address? Is this even a remote possibility? Peter

I am using static IP addresses and no there isn't a conflict.

Hans Olo
Posts: 14
Joined: Wed Aug 15, 2012 6:36 am

Re: Mount SAMBA share on RPi

Thu Aug 16, 2012 8:01 am

OK, I assumed (from reading man fstab) that blank fields in each fstab entry would be interpreted as the default values. After writing a full entry

Code: Select all

//servername/sharename  /mountPoint  cifs  guest,uid=1000,iocharset=utf8,codepage=unicode,unicode  0  0
with guest, and some other useful options, the RPi was able to mount the share on boot. Yay! (for now, hah)

Thank you for your suggestions Peter!
Best of Luck

Return to “Troubleshooting”