• How to share an external USB hard drive from Ubuntu to a Windows network

    by  • May 21, 2013 • Tech • 8 Comments

    tux_windowsI’m in the process of taking an old desktop and turning it into the house’s media server, taking most of the grunt work off of the computer I use to do my “real work” on. The media server is currently running Ubuntu 13.04 and it was sharing the small 80GB internal hard drive across my Windows network just fine. However, when I attached an external 3TB USB drive to the server, it was recognized, and I could right-click on it and tell it to share, but when I tried to access it from the Windows machine in the living room, it would not give me access. Many Google searches later I assembled the correct steps to get it to work. So, as a record for next time, and in hopes of helping someone else with some specific instructions, here they are:

    1. Connect and mount the drive to the Ubuntu computer. (The format of the drive, NTFS vs EXT4, doesn’t seem to matter for this to work so I ended up formatting it as NTFS for future portability.)
    2. Do not right-click on the drive and go into the sharing options via the drive’s properties. This will not work.
    3. Make sure you have Samba installed. (You can find it in the Ubuntu Software Center titled “SMB/CIFS file, print, and login server for Unix”)
    4. Install, if you haven’t already, install the Samba GUI. (Also in the Ubuntu Software Center titled “Samba” with a description of “Create, modify, and delete samba shares”.)
    5. Run the Samba GUI. (Applications|System Tools|Administration|Samba)
    6. File|Add Share
    7. Browse for the drive you wish to share and select it
    8. Change the share name if you’d like to. (For this example my share name is “Media01″)
    9. Check “Writeable” if you wish to be able to write to this drive from other computers on the network.
    10. Check “Visible” if you’d like others to see the share while browsing the network.
    11. On the Access tab, select “Allow access to everyone” (This will avoid the problems of having to specify usernames and passwords in programs like XMBC and MediaPortal.)
    12. Click OK (You should be done at this point but you’re not. This is what caused me the most headaches to find.)
    13. Open a Terminal session
    14. # cd /etc/samba
    15. # sudo pico smb.conf (Feel free to use the editor of your choice. I like Pico.)
    16. Scroll to the bottom of the file. There you should find [Media01] (remember that’s the name of the share I created.)
    17. Add the following new line in that section: force user = username (In my case username is “msauers” since that’s the username I log in to Ubuntu with. Replace with your username.)
    18. Save the edited file.
    19. # sudo restart smbd (restarts Samba)

    That should do it. You should now be able to access the shared drive from any Windows computer on your network.

    About

    Michael Sauers is currently the Technology Innovation Librarian for the Nebraska Library Commission in Lincoln, Nebraska and has been training librarians in technology for more than 15 years. He has also been a public library trustee, a bookstore manager for a library friends group, a reference librarian, serials cataloger, technology consultant, and bookseller. He earned his MLS in 1995 from the University at Albany’s School of Information Science and Policy. Michael’s twelfth book, Google Search Secrets (w/ Christa Burns) was published October 2013 and has two more books on the way. He has also written dozens of articles for various journals and magazines. In his spare time he blogs at travelinlibrarian.info, runs Web sites for authors and historical societies, takes many, many photos, and reads more than 100 books a year.

    http://www.travelinlibrarian.info/

    8 Responses to How to share an external USB hard drive from Ubuntu to a Windows network

    1. markus
      July 9, 2013 at 3:50 pm

      Thanks Michael, you saved me. Couldn’t figure out why the storage disk diden open as a shared disk from Win7. After days of googeling and trying everything out there I was about to give up ubuntu. Then I found this and it worked for me! Thanks!

    2. aaron
      July 18, 2013 at 1:31 pm

      thanks!!!
      I especially appreciated the step by step explanation.

    3. Adam
      August 4, 2013 at 4:38 pm

      Thanks!! Was beginning to drive me mad!

    4. tim
      September 2, 2013 at 3:22 pm

      Thankyou! Very helpful! W7 was saying that it couldnt access it, even though it could see it…

    5. Kasander
      September 22, 2013 at 5:13 am

      Many, many thanks from Holland (Europe)! Tried it for month and coudn’t found out what was wrong! You saved my day!!

    6. nader
      October 14, 2013 at 1:38 pm

      Thank you so much! This trick allowed me to share my external hard drive files and the files saved in my windows 7 partition. This information should be more easily found, and the samba gui should assume the force user permission. Thanks again!

    7. November 24, 2013 at 4:57 pm

      Thanks from Brazil!

    8. Flint
      August 4, 2014 at 5:06 am

      I’ve tried almost every website looking for answers – Ubuntu Forums, Superuser, etc – everywhere! They all told me to set up Samba CLI and then sharing it and I wasn’t able to.

      Thanks a lot man. I owe you one! :D

    Leave a Reply

    Your email address will not be published. Required fields are marked *