jump to navigation

Moving Large Files On A Debian VMware Server 2 With A Guest Samba Mount June 6, 2009

Posted by ModelR in Everything LINUX.
Tags: , , ,

As noted in a previous post, I was having troubles moving large files that were on a samba mount. I thought it was only in Ubuntu (version 9.04), but after installing Debian (Lenny) I was experiencing the same system crashes.

Turns out the reason behind all the crashes was because of my setup.

After reading this post here: http://ubuntuforums.org/archive/index.php/t-345489.html , I realized I had to rethink my setup.

Here is what I had:
Debian Lenny running VMware server 2
An Ubuntu 9.04 virtual machine with one virtual network card that was bridged

Since I was using the bridged virtual network card to do the transfers from the guest operating system to the host, things were getting unstable. A more stable (and reasonable) solution is to place two network cards in the guest system: one bridged network card, and one host-only network card.

Also note: I wasn’t experiencing these crashes if I tried to copy the large files from the VM to another system (Vista) on the network. This proves the that the virtual bridged network card on the guest system trying to connect to the host system for a large transfer was the cause for the crashes.

So here is what I did to resolve the issue:
-First I upgraded the Virtual Hardware Version of the VM. The version that was on the VM was Version 4 after the upgrade it became Version 7 (This step wasn’t really necessary, but did it just to get things up to par)
-Then I added a new network card that was “Host-Only”
-After starting the guest VM I added this to the /etc/network/interfaces file to create a static address for the new card (yours will be different depending on the VM network address you have for vmnet1 on your machine)
#The Host-Only network interface
auto eth1
iface eth1 inet static

-Restarted the network
/etc/init.d/networking restart
-Edited the Samba config file /etc/samba/smb.conf to include the following:
interfaces = eth0 eth1
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

-Restarted samba
-Edited the /etc/hosts file on the VM Host machine to include the Guest VM Host-Only nic address vm-guest vm-guest

A few things that I found out along the way of solving this problem:
On the samba client system, make sure these programs are installed
apt-get install smbclient smbfs

Mount the cifs volume with forcedirectio enabled this provides better performance as it disables caching
mount -t cifs //servername/sharename -o username=username,rw,forcedirectio /mnt/share

useful samba commands:
To list the available shares on a machine
smbclient -L <hostname>

To get a nice progress status when copying use the –progress flag with rsync:
rsync --progress file1 file2 user@othermachine:/dest/dir



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: