# mount_smbfs: File disappears while saving it



## zellenin (Nov 14, 2013)

FreeBSD 9.2-RELEASE #0 r255898 amd64


```
mount_smbfs -I 192.168.1.1 //dima@server/share /home/dima/mnt
Password:
```

The shared folder mounts all right, I can browse all folders, open files. I can create folders, rename and delete them. I can create, rename and delete files.

*The problem:*

Open any text file on mounted share with graphical program (I tried gedit, geany), press "SAVE" button and the file just disappears, under root or usual user.

Gedit shows this error:

```
Could not save the file '/home/dima/mnt/new file'. 
You don't have the permissions necessary to save the file. 
Please check that you typed the location correctly and try again.
```

Geany says this:

```
Error saving file. 
Error renaming temporary file: Permission denied. 
The file on disk may now be truncated!
```

On the other hand, _in terminal_ I open and save any file without issues with ee editor, under root or usual user.

*What I tried to this moment:*

I tried this in GNOME. GNOME (and Xorg) was installed from ports, then I made a fresh install from packages from FreeBSD FTP, then I made a fresh install from packages from DVD. The problem persists with any SMB share. I tried mounting shares from Windows, Ubuntu, FreeBSD servers. I tried using switches with mount_smbfs, like -f 777, -u. Tried different settings in /etc/nsmb.conf. Tried mounting from /etc/fstab.


----------



## zellenin (Nov 14, 2013)

I just installed FreeBSD 8.2-RELEASE i386 in VirtualBox. The problem remains the same there. I can edit and save any text file from terminal, but I can't save it from gedit in GNOME.

I found one more thing and strange behavior.


 create a text file on the mounted share: right-click -> Create document -> Empty file
 "new file" is created.
 open it using some (gedit, geany, bluefish) editor.
 write some text, press SAVE button
 these editors complain that I don't have permissions and file "new file" disappears from share
 press SAVE again, file is created again.
This looks like some (gedit, geany) text editors can not for some reason overwrite the existing file. BUT! Other text editors (in terminal: ee; graphical editors: leafpad, mousepad) can do this.


----------



## zellenin (Nov 15, 2013)

UPDATE:

I tested PC-BSD 9.2 with KDE (in Virtualbox) and then installed a fresh FreeBSD 9.2 with KDE only (both real and in Virtualbox). These don't have problems with disappearing files. Text editors used for testing were Kate and Kwrite. FreeBSD 9.2 with Enlightenment (Virtualbox) also works fine. Leafpad was used for testing.

So this problem seems to be connected with GNOME only. Perhaps, I should contact with people maintaining GNOME?


----------

