I have an Ext4 partition (not auto-mounted) that I would like to share (entirely) in my home that contains Mac OSX, Windows and Linux machines (currently the most important is sharing with the Mac). How may I do this?
2 Answers
Essentially, you will want to create a Samba share for the Ext4 mount point. Open-up your /etc/samba/smb.conf (in your favorite editor) and alter a few things:
1 - workgroup - you'll want to set that to the name of your network workgroup, if you have one.
2 - security = user - even if this line is commented-out, user-level security is the default for Samba.
3 - Define your Samba share at the bottom of the file. You should see a (commented-out) example at the bottom. You'll need the mount point of your ext4 partition (that you want to share). If you're not sure of what that is, do a "df -k" from terminal, and you should see it (put it in the "path" setting instead of "/some/directory").
[ShareName]
path = /some/directory
browsable = yes
valid users = myUser, user2, user3
4 - Next, you'll need to alter the permissions on the path (mount point) to ensure that the desired users can accomplish what they need to.
5 - Restart Samba
sudo restart smbd
sudo restart nmbd
6 - Connect to your Samba share from your Mac. I found instructions on that here. Essentially, it says:
When you go to the Connect to Server dialog, you may browse the names of computers that are on your local subnet.
You can connect to a server via its IP address or DNS name. If it is required or more convenient in your environment, you may also use other valid URL formats, such as:
smb://ServerName/ShareName
For me, I connect to my Samba shares by IP:
smb://192.168.0.117/ShareName
For troubleshooting, check the doc that I referenced: Mac OS X: How to connect to Windows File Sharing (SMB)
Hope this helps.
-
Thanks for the detailed answer. I already have samba and I share some of the directories with my Mac, so can I just edit the smb.conf file now and restart samba to get it working?– MByDApr 7, 2012 at 11:26
-
If the ext4 partition is mounted and you specify its mount point as the path, then (in theory) "yes" it should work.– AaronApr 7, 2012 at 11:28
-
1Editing the file worked, only a small addition, to enable sharing with guests, I had to add
guest ok = yes
Thanks a lot.– MByDApr 7, 2012 at 11:38 -
As an alternative to the venerable but complicated method of manually editing configuration files, unless you need to extensively customize who can access the share, you can simply:
Navigate in Nautilus (the file browser) to the mount point of the drive you want to share (e.g.,
/media/MyDrive
).Go up to the parent directory (in this example,
/media
).Right-click on the drive name (
MyDrive
), and click Sharing Options.
As you can see, enabling guest access is as simple as checking the box for it.
Nautilus might tell you that you have to install some packages to share a folder. This will happen if Samba and its dependencies are not already installed. You can say yes to this. After installation, you may have to log out and back in (rebooting also works but is not necessary). Then go back to Sharing Options. Now that the necessary packages are installed, you can share the folder.
This method works for sharing statically mounted volumes (like yours), dynamically mounted volumes, or any folder.
-
Thanks for the answer. It was pretty much time ago so I can't recall exactly why, but this was my first approach and it failed for some reason. I had no such problem with normal folders, only with mounted folders...– MByDJun 4, 2012 at 3:52
-
1If you try to select a drive in the device list and share it, this won't work. You have to actually navigate to the mount point's parent folder (which is usually
/media
) to do this. Perhaps that was the problem you were having. Jun 4, 2012 at 4:12 -
-
Many times on many different Ubuntu versions and machines I've tried this approach. I know it should work, but it never has. I'll try all the advice on this page and if it doesn't work, ask a very specific question. Oct 15, 2014 at 10:20