Sunday, May 04, 2008

Ubuntu Samba Server

The most exciting things this week have been the arrival of all my boxes from Korea, so I'll be joining Alex and John online this week in some Halo madness.  The other exciting news is that I've managed to do something with linux!  Rach had a dead pc upstairs, so after resurrecting it with a ten quid hard drive I've installed Ubuntu server, plugged all the external hard drives in it and now we can wirelessly access the many files on the many usb drives!!!
for anyone interested, and to help me to restart it all in the future when if all goes wrong...
here's what I did.

Download Ubuntu Server
Install it on the knacker ed machine in the corner.  This is a fairly painless process.

When asked install LAMP, SSH and Samba.

When it's all finished type: ifconfig

make a note of the number with lots of dots in it, 192.178.1.1. or something like it.  Switch off the monitor, unplug the keyboard and switch on your windows pc and download a program called putty.

In the host name box type that number

This should open a window that now controls your server!!!!

Log on.

type: sudo apt-get update
type: sudo apt-get upgrade

just to make sure alls up to date.

type: sudo fdisk -l

make a note of the names, eg sbd1 or sca3 or something like that. Next make directories where you want to find your hard drives, so something like /media/movies1 you'll need to do this for each usb drive you have connected to the server.

eg type: sudo mkdir /media/movies1

Next edit this file so that when you start up your server it will let you find your files in the directories you just made.

type:sudo nano -w /etc/fstab
nano is a simple text editor.
Add the following line for each drive:
/dev/sbd1   /mnt/media  auto    users,owner,rw,umask=000    0   0

changing sbd1 to the names you noted earlier.

type:sudo mount -a

Last step.
type: sudo nano -w /etc/samba/smb.conf

scroll down to the bottom of this document and add

[movies1]
   path = /media/movies1
   public = yes
   writable = yes

one for each drive, change the names from movies to whatever you called yours earlier.

Check your network neigbourhood on you windows pc and the drives should be there!!!
Now i just need to work out how to get the xbox to read them....

Blogged with the Flock Browser

3 comments:

Richard said...

Hi Steve-O. Congrats for forging ahead into the realm of Linux. It sounds like you've got something really useful there.

Just to clarify: you attached all your USB drives to the server so you could browse all your files in all their different locations without having to organize them, buy a giant hard drive, and move them to one place. Is this right?

I've been doing a bit of my own exploring with Linux again. Gin's EEE PC runs a Debian fork called Xandros. In order to install applications, you have to add repositories, and pin the system, and basically go through a whole hassle that has me wondering if it's worth the bother. I could ditch Linux and install Win Xp. But so far things are working out, so I'll continue with it.

Oh, something totally minor that you might be interested in re: nano. When you type sudo nano FileName, you are telling the OS to use the text editor nano to edit FileName (with root privileges). There are other (read: less ugly) text editors out there. I used to use nano until I discovered kwrite, which I used until I realized it was a light version of kate. Try kate (or kwrite), it is much nicer to use.(synatax is the same: sudo kate FileName)

Allie said...

Very clever. Didn't understand a word of it, but it's very impressive.

Ste said...

Hey Richard, thanks for that. Kate it is then. Your clarification is correct, about the usb drives. I've since downloaded a program called twonky so I can stream wirelessly to the xbox360 which is nice :)