Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

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.

share|improve this answer
    
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? –  MByD Apr 7 '12 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. –  BryceAtNetwork23 Apr 7 '12 at 11:28
1  
Editing the file worked, only a small addition, to enable sharing with guests, I had to add guest ok = yes Thanks a lot. –  MByD Apr 7 '12 at 11:38
    
Excellent! Glad I could help. –  BryceAtNetwork23 Apr 7 '12 at 11:41

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:

  1. Navigate in Nautilus (the file browser) to the mount point of the drive you want to share (e.g., /media/MyDrive).

  2. Go up to the parent directory (in this example, /media).

  3. Right-click on the drive name (MyDrive), and click Sharing Options.

Folder Sharing in Nautilus - If you want people to be able to access it without logging in, check the box labeled: "Guest access (for people without a user account)"

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.

share|improve this answer
    
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... –  MByD Jun 4 '12 at 3:52
1  
If 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. –  Eliah Kagan Jun 4 '12 at 4:12
    
That's explains it :) will try when I get home. thanks. –  MByD Jun 4 '12 at 6:32
    
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. –  James Bradbury Oct 15 at 10:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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