Popular Posts

How to open/save LibreOffice documents on Samba network

11:39 AM 3 Comments A+ a-

When users have to use some shared Windows folder on Linux you can easily access and open it automaticly with samba (Which comes preinstallled on most distros) , but when you open some files in LibreOffice or OpenOffice programs like Calc and Writer, and when you click "Save" nothing will happend, and if you click close, you will lose your changes in that file. When you open it again it will be unchanged.  If you want to recover it, click "Save as" and it will open temp folder in which it saves changes. Copy folder name and go to that folder on your folder explorer (Nautilus(GNOME), Dolphin(KDE), PCmanFM(LXDE), Thunar(XFCE)...) and you will find all your lost documents.

I searched for solution all over the web and find several solutions and none of them are wizard-like. You must do it by editing some config files.
 I will show you now solution that will fix all problems  caused by accessing samba resources, read-only permisions ....

Also this will solve the problem of Mapping network drivers in Linux , you can do it in several ways but this is the best for ordinary user because when you setup it once it will stay forever and user will never be in situation to enter samba user password, or to map it again... it will just work (I hope so :))

The solution is to mount your network drive on some folder.First create that folder:
mkdir /media/mappedfolder

Then enter this command to test if it working:

sudo mount -t cifs -o username= myusername@domain, password=mypassord,file_mode=0777, dir_mode=0777 //10.1.0.120/sharedfolder  /media/mappedfolder

Also if you use freenas or something similar, and if you use guest account you can easily mount it like this command:
sudo mount -t cifs  //10.102.10.4/userdata  /media/userdata

You must use parameter ,file_mode=0777, dir_mode=0777 to have read-write permission to all users on your computer .
Change myusername@domain to your username and domain, and change mypassord to your password.
Change //10.1.0.120/sharedfolder to your shared folder. You don't need to use smb:/ prefix because.
If you don't using ubuntu you can delete "sudo" word from command, and you must enter the root console.

If everything works then open /etc/ftab with root privilegies and add foolowing(Change it with your data): 
//10.1.0.120/sharedfolder /media/mappedfolder cifs username=yourusername, password=yourpassword, file_mode=0777,dir_mode=0777

And from now every time you start computer this will run and this folder will be mounted automatically.

If something is worng maybe you don't have installed all prerequisities. You must install samba, smbclient, cifs-utils (most people missing just this one) and it will work I hope so.

UPDATE: You probably not using nautilus file manager when you have those problems. We found out that all problems about accessing disk from LibreOffice or other programs are solved when you use nautilus to opet it. So if you don't using install it and try this. If it works on your computer you can make it default easily.