Mount Windows (CIFS) LAN Shares and Overcome Libreoffice/.doc Issues

Those of us trying to use Linux in a Windows network LAN environment at work can have a certain amount of difficulty accessing Windows (CIFS) shared folders when using the company's Windows LAN.  In addition, Libreoffice Write (and OpenOffice Write) can create problems trying to open/save .doc files because Libre/Open Office do not use the CIFS-style mandatory byte-range blocks.  I am using #! both at work and at home, and I thought it might help at least some folks if I shared some of the setup I use.  This setup allows auto mounting of Windows network shares and overcomes the problems opening/saving .doc files in Libre/OpenOffice.  Here goes -

PERMANENTLY MOUNTING WINDOWS (CIFS) SHARES AS A #!LINUX CLIENT:

1.  Open a terminal and create a directory in /mnt to receive the shared CIFS folders as follows:  sudo mkdir /mnt/<foldername> 

I use the existing name for the Windows share as it appears on the company server, but you can name this folder anything - it does not matter.  If you have subfolder within a primary shared folder, mounting the primary folder will also allow access to all of the subfolders and files it contains (no need to mount each subfolder individually).

2.  If not already installed, install the "smbfs" package via Synaptic or via apt-get install from the command line.  (You can determine whether you already have this installed by opening Synaptic and doing a search for "smbfs").  smbfs "provides support for cross-platform file sharing with Microsoft Windows, OS X, as well as other Unix systems."

3.  Open your /etc/fstab file in gedit from the terminal command line as root using the following command in a terminal:  sudo gedit /etc/fstab

4.  Add the following entry to the end of your /etc/fstab file and save the edited fstab:

#Mount Windows network shares
//1xx.xx.x.xxx/<share_name_or_IP_address> /mnt/<foldername> cifs auto,iocharset=utf8,nobr1,username=<windows user name>,password=<windows network password>,_netdev,uid=<username>,gid=<group_id> 0 0

If you have other shares to mount, make an entry like the one above for each additional share you want to mount at boot.

If there is a space in a share name in fstab, you can "escape" the space by replacing it with the escape code /040. For example, if a share's name is "bobs your uncle", then the share's name in fstab would be:

//1xx.xx.x.xxx/bobs/040your/040uncle

5.  After saving the file, check to see whether your Windows shares are mounted by entering the following command in a terminal:

sudo mount -a

You will get a return showing all mounted devices and shares.  Here is what mine looks like currently (edited slightly to remove some identifying information):

/dev/sda3 on / type ext4 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda6 on /home type ext4 (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
//1xx.xx.x.xxx/users/ on /mnt/users type cifs (rw,mand)
//1xx.xx.x.xxx/Teams/ on /mnt/Teams type cifs (rw,mand)

Note the last two lines showing two mounted Windows LAN shares ("users" and "Teams").

OVERCOMING THE LIBREOFFICE WRITE FAILURE TO OPEN/SAVE .doc FILES

The key to making Libre/OpenOffice Write work properly with MS .doc or .docx shared files is to insert the "nobrl" option in the CIFS mount instructions.  This forces Write to ignore the mandatory byte range blocks inserted by MS Word.

I hope this is helpful.  (I want to thank the OpenSUSE team for their wonderful instruction set available here:  http://opensuse.swerdna.org/susesambacifs.html Much of the above was adapted from this document).

Last edited by busprof (2011-05-16 02:07:50)

 

From:http://crunchbanglinux.org/forums/topic/12470/mount-windows-cifs-lan-shares-and-overcome-libreofficedoc-issues/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值