Tag Archive: Samba


I mentioned a few posts back that I was going to try and create a script (if no-one beat me to it) to automate the process of configuring a samba share to be used with Time Machine. I’ve had a go…

Here is the automator script: http://www.tickett.net/downloads/setup_samba_for_time_machine.zip

There are still a few steps required but it removes the need to open the terminal and lookup your computer name, mac address etc

1. Mount your samba share
2. Right click the setup_samba_for_time_machine automator script (downloaded above) and select Open With, Automator Runner

3. Select your samba share mount point, click choose

4. Wait a minute and you should see a message similar to above. Now launch Time Machine and point at the samba share!

I’ve never used Automator before so I expect the script can be improved considerably… I expect there are currently a few limitations:

  • The .sparsebundle file must not already exist
  • Your computer name must not contain any spaces
  • Others?

I have also seen an error when trying to backup one of my Macs that the image isn’t big enough even though it is set to the same size as the hard disk drive? (Should we be making the .sparsebundle image larger than the hdd size?)

Feel free to modify the script and please feedback and changes/comments etc- I will most likely blog later about the way the script works (I found it quite hard using google to solve issues such as: How do I determine the size of the hard disk drive? How do I display a simple message/popup/dialog?)

L

I’ve decided to stick with my rackable systems box as my fileserver because it’s relatively quiet and “green”. I have two identical servers so all i had to do was pop 4x 1.5TB drives in the new one (the old one had 4x 750GB) and migrate the data! The old server is running FreeNAS 7.2 and I loaded FreeNAS 8 RC2 onto the new one (ZFS support).

I can briefly remember attempting the migration task in the past and finding it somewhat easier said than done!

First i tried from a windows box connecting to each server using samba simply dragging/dropping the files. The transfer goes from the old server to the windows box then back to the other server so I decided this was a no go (performance was pretty poor and the samba process on both servers seemed to be eating the CPU but at least i got a progress bar).

Now I decided if i want the transfer to go directly from server to server i’d need to SSH into one of them and initiate the transfer from there. I mounted the old server on the new (mkdir /mnt/oldnas | mount oldnas:/mnt/data /mnt/oldnas) and proceeded to copy a folder (cp -R /mnt/oldnas/test /mnt/data). Unfortunately I couldn’t tell how fast the transfer was going nor the progress it had made!

So googling suggested rsync (rsync –progress) which provided speed and progress- great! Or not… unfortunately performance was even worse than before, only this time rsync was eating the CPU!

Next google result… scp (scp /mnt/oldnas/test newnas:/mnt/data)- using both local paths doesn’t display progress so one path must be nfs. Poor performance again! You guessed it… scp eating CPU.

So… back to cp! This time i passed -v to get an update after every file completes (cp -R -n -v /mnt/oldnas/test /mnt/data). Excellent! Only 10% CPU utilization… but can i determine how fast the transfer is going without timing how long a file (or group of files) takes to transfer? After trying a bunch of useless commands i finally found systat -ifs which shows current network throughput and peak network throughput- perfect!

Another update shortly!

P.S. I found that: systat -ifs doesn’t work prior to FreeBSD 8 (not a problem for me as i think FreeNAS 8 RC2 is based on FreeBSD 8.2) but: netstat -Iem0 -w1 -h is mildy helpful if you are running FreeBSD < 8.

%d bloggers like this: