fstab for ntfs usb disk [SOLVED]

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read this

fstab for ntfs usb disk [SOLVED]

Postby math999 on Sun Apr 15, 2012 12:18 pm

Hello,
I have a problem (maybe with ntfs-3g) for unmount an extern disk mapped in fstab.

I tryed to share a ntfs usbdisk plugged on my linux mint system with a windows 7 pc.
Samba wa allready istalled so I just modify the config with a gui tool (system-config-samba) more user friendly.
After changed my workgroup add folder to share and relaunch samba service
Code: Select all
sudo service smbd restart
sudo service nmbd restart


So I first try to share with samba conf my disk on the auto mount point but I couldn't open it on the windows side.
I tryed share my home folder and it was working perfectly.
I read few thread about why I cannot share the auto mount disk and I find a good documentation here (sorry it's french) : http://michel-eudes.net/blog/index.php? ... xterne-usb

I had in fstab
Code: Select all
UUID=9C64D17064D14DA0 /media/hddExtern ntfs-3g rw,suid,dev,exec,auto,user,async 0 0


The hdd is monted in /media/hddExtern and I can share my file between the 2 pc and I can write in the hdd but
I can't unmount the disk by gui or by command
Code: Select all
eject /media/hddExtern

gui return
Failed to eject medium; one or more volumes on the medium are busy.

Even if I stop to share the drive with samba

And I can't access to the disk with the shortcut hddExtern visible in nautilus I have an error
Unable to mount hddExtern
Mount is denied because setuid and setgid root ntfs-3g is insecure with the
external FUSE library. Either remove the setuid/setgid bit from the binary
or rebuild NTFS-3G with integrated FUSE support and make it setuid root.
Please see more information at
http://tuxera.com/community/ntfs-3g-faq/#unprivileged


In nautilus i can access to the other shortcut with the harDrive name (the automount point) and it's correctly going in the folder /media/hddExtern
Last edited by math999 on Sun Apr 15, 2012 1:35 pm, edited 1 time in total.
math999
Level 1
Level 1
 
Posts: 2
Joined: Sun Apr 15, 2012 10:52 am

Linux Mint is funded by ads and donations.
 

Re: fstab for ntfs usb disk

Postby altair4 on Sun Apr 15, 2012 12:50 pm

You have 2 separate things going on here.
I tryed to share a ntfs usbdisk plugged on my linux mint system with a windows 7 pc.
Samba wa allready istalled so I just modify the config with a gui tool (system-config-samba) more user friendly.
...
So I first try to share with samba conf my disk on the auto mount point but I couldn't open it on the windows side.

When you plug in an external USB disk formatted in ntfs it will mount with you as owner and with permissions for only you to access it. The remote user is not you so you may have told Samba to allow someone else to access it but Linux itself will not allow it. Instead of mounting it in fstab to allow more permissions another solution is to force the remote user to look like you.

Let's say you have created a share that allows guest access. In /etc/samba/smb.conf it would look something like this:
[share]
path = /media/hddExtern
read only = No
guest ok = yes

Modify that share definition to look like this:
[share]
path = /media/hddExtern
read only = No
force user = altair
guest ok = yes

Change altair to your own Mint user name
And restart samba.

The hdd is monted in /media/hddExtern and I can share my file between the 2 pc and I can write in the hdd but
I can't unmount the disk by gui or by command

Because root mounted the partition so root has to unmount it:
Code: Select all
sudo umount /media/hddExtern


If you don't mind plugging in the USB device to mount it before it would be available to the LAN I would remove the line in fstab and go with the "force user" solution in smb.conf.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 13
Level 13
 
Posts: 4743
Joined: Tue Feb 03, 2009 10:27 am

Re: fstab for ntfs usb disk

Postby math999 on Sun Apr 15, 2012 1:34 pm

Your solution is very clean and works very well.
I remove my config on fstab and just had the automount folder in smb.conf and
force user = myUser

Thanks a lot altair4
math999
Level 1
Level 1
 
Posts: 2
Joined: Sun Apr 15, 2012 10:52 am


Return to Hardware Support

Who is online

Users browsing this forum: Bing [Bot] and 13 guests