Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

External Harddrive automounts with root as owner


  • Please log in to reply
4 replies to this topic

#1 kilgorecemetery

kilgorecemetery

  • Members
  • 37 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:In my chair
  • Local time:01:36 PM

Posted 05 October 2010 - 11:57 PM

Just installed Ubuntu 9.04 and i want to be able to share my external hard drive with another computer in the house through my network. The hard drive is USB 2.0 and still has a considerable amount of files from when i ran Windows 7. The computer that i'm trying to network to is currently running XP pro. When I try to share the drive I get an error message stating:

'net usershare' returned error 255: net usershare add: cannot share path /media/FreeAgent Drive as we are restricted to only sharing directories we own.
Ask the administrator to add the line "usershare owner only = false"
to the [global] section of the smb.conf to allow this.

Unfortunately I dont know enough about samba to know where to begin. i did a search for smb.conf and found 3 matches. 2 appear to be samples, so i logged in as root and made the change requested above, but i still get the same error.

I also tried using chown and chmod, but neither do anything to the drive. I was, however, able to get them to work on other folders so I know that I'm using the commands correctly.

any help at all on this would be much appreciated.

BC AdBot (Login to Remove)

 


#2 ice2921

ice2921

  • Members
  • 177 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:VA
  • Local time:01:36 PM

Posted 06 October 2010 - 06:53 AM

'net usershare' returned error 255: net usershare add: cannot share path /media/FreeAgent Drive as we are restricted to only sharing directories we own.
Ask the administrator to add the line "usershare owner only = false"
to the [global] section of the smb.conf to allow this.


I know that you said you performed these steps but lets remove your drive and try again.

1. go into a terminal session:
Applications menu -> Accessories -> Terminal (if using Gnome)
KMenu -> System -> Terminal Program (Konsole) (if using KDE)

2. backup your current smb.conf:

sudo cp /etc/samba/smb.conf~
or
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.original

3. Edit your smb.conf per Ubuntu's instructions:

sudo gedit /etc/samba/smb.conf
KDE

sudo kwrite /etc/samba/smb.conf
GNOME

You should see something similar to the following:

[global]
workgroup = WORKGROUP
server string = SambaServer
security = share
name resolve order = hosts lmhosts

[Documents]
path = /home/USER_NAME/Documents
force user = USER_NAME
force group = USER_NAME
read only = no
guest ok = yes

[Downloads]
path = /home/USER_NAME/Downloads
force user = USER_NAME
force group = USER_NAME
read only = no
guest ok = yes

[Music]
path = /home/USER_NAME/Music
force user = USER_NAME
force group = USER_NAME
read only = no
guest ok = yes

[Pictures]
path = /home/USER_NAME/Pictures
force user = USER_NAME
force group = USER_NAME
read only = no
guest ok = yes

[Templates]
path = /home/USER_NAME/Templates
force user = USER_NAME
force group = USER_NAME
read only = no
guest ok = yes

[

In the Global section you need to add the line
usershare owner only = false
at the end. It should look something like this:
[global]
workgroup = WORKGROUP
server string = SambaServer
security = share
name resolve order = hosts lmhosts
usershare owner only = false

4. restart SAMBA:

sudo /etc/init.d/samba restart

I am not trying to be repetitive, but sometimes it help to try again. make sure you restart SAMBA. When done then replug in your device. Also if you drive is formatted in NTFS we need to make sure its mounted correctly. Hope this helps.

#3 kilgorecemetery

kilgorecemetery
  • Topic Starter

  • Members
  • 37 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:In my chair
  • Local time:01:36 PM

Posted 06 October 2010 - 06:03 PM

that's kewl ice2921. I'm open for any suggestions. I'll give it a try. One thing I do want to mention is everywhere says that I should set "usershare owner only" to "false", but in the smb.conf file it already has the "usershare owner only" line and it's set to "yes". Should I still set it to "false" or should it be "no"?

I'll try both just in case, but I would like to know for future reference. Also, I'll be posting results shortly

#4 cryptodan

cryptodan

    Bleepin Madman


  • Members
  • 21,868 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Catonsville, Md
  • Local time:06:36 PM

Posted 06 October 2010 - 06:05 PM

You may need to check /etc/fstab as well to see whats in there.

#5 kilgorecemetery

kilgorecemetery
  • Topic Starter

  • Members
  • 37 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:In my chair
  • Local time:01:36 PM

Posted 06 October 2010 - 06:44 PM

Yay! we have a shared folder! good call ice2921. I also changed the domain to the correct setting while i was there, but am currently still unable to view it from the XP system. I'm gonna try rebooting the router after a while and see if that helps.

I dont know much about fstab, but this is what the file contains:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=03d8199f-76c1-4c8a-b1d9-866965aaf9a9 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda6
UUID=fa5b1167-a0fa-42eb-90d1-c8c2850b91ee none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users