Oracle – for when it was like that when you got there

Main menu

Post navigation

Essaying a sashay with Samba

Just in case either of my kids are reading this, don’t panic. I’ve not suddenly decided to break the habit of a lifetime and indulge in a bit of Dad Dancing. No, this is a vain attempt to improve my geek-cred, rather than my street-cred. As promised in my last post, this is a wander through my adventures in configuring Samba to share files from my shiny new Ubuntu 9.10 Server installation.

Installing Samba

Connect to the server via SSH and at the prompt type :

sudo apt-get install samba

Now create a directory to hold the files and sub-directories that we want to make available over the network :

Note – I also uncommented this line after having one or two subsequent problems copying files across :

SO_RCVBUF=8192 SO_SNDBUF=8192

Once the file has been edited, restart samba :

sudo /etc/init.d/samba restart

You should now be able to see the share in Nautilus ( i.e. Ubuntu desktop menu – Places\ Network).
At this point I had to refresh the view a few times to get Nautilus to display the Workgroup folder, again when I opened this up to display the server, and then again to display the share.

I’m not sure why this is. Once I’d put my music files on the share and pointed Rhythmbox at it, it all seems to work OK. When I start Rythmbox now, I immediately get the share folder icon on my desktop.
All of which brings me nicely onto :

Copying files from a USB Stick onto the server

Specifically in this case, these are the files I want to put on the newly created share. Of course, one way is to simply plug it into the client and then copy over to the share using Nautilus.The other, is to mount it onto the server.

Mounting the USB Stick onto the server

Create a directory to mount external storage under /media :

sudo mkdir /media/external

Plug the USB stick into one of the USB ports on the server
Find it on the server by :

sudo fdisk -l

This should return details of the hard disk and also the device it recognises as the USB stick.
In this case, with an 8GB stick, the output includes the lines :

The last line here re-starts samba. Once again, I’m not sure if this is necessary but I did it just to be on the safe side.

Finally, don’t forget to unmount the USB :

sudo umount /media/external

A word of caution – in the course of using both of these methods to copy, admittedly quite large amounts of data (over 2GB at a time), the server hardlocked, forcing a reboot.
Further research indicates that this is likely to be an issue with linux copy commands having problems copying large amounts of data. It would seem that the definition of “large” in this context probably depends to an extent on the hardware that you have available.

I managed to resolve this by copying the files across in smaller chunks.

This wasn’t a huge problem for me because the server isn’t being used for anything else at the moment and obviously no-one else was connected. However, I thought it worth mentioning just in case you have any bright ideas as to why this happened.

To finish with a happy ending, my fingers are now dancing across the keyboard to the dulcit tones of Motorhead ( Tear Ya Down – if you must know) playing from the share on the server.