Installing the Core System
This first part is the easiest of the bunch as we are only trying to install the core components of the Ubuntu Server we will use.
Installing the core
First of all Download and Burn to a CD the Installation files. Pay attention that you download the correct architecture for your server x32 or x64 bits? Once you have the material, boot from the CD on the machine you’re going to use and start the installation.
Note: You can find some screenshots on the basic setup here if you need them.
We don’t really need a lot of customization here. If you have a hard-disk that you don’t use, just use the whole of it for the server’s filesystem (use the option to use the whole disk in the relevant section). Make sure your network is detected and you get a dhcp address from your router (if you’ve set it up to provide addresses) otherwise just setup your network details manually for your subnet.
Go through the rest of the steps by following the instructions of each. Setup a username/password that you’ll use. a hostname that makes sense and so on. Once you reach the package installation parts, make sure to select the samba and openssh components as we’ll need those later.
Once the server is installed and you reboot, login to the terminal with the account you’ve created to continue.
Setting up the Network
Now that the system is running, we need to make sure we can always find it in the correct location. If you’ve setup the system with DHCP, we’ll need to modify the settings so that it uses a static IP address.
Edit the network config file ((Note: You can avoid having to write “sudo” all the time by typing once sudo -i to make yourself root)
sudo nano etc/network/interfaces
Find the part which is for your network interface (should be eth0) and replace “dhcp” with “static”. Then fill in the entries to be similar to below
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
Make sure that the addresses there are relevant to your own subnet. This is for the subnet 192.168.0.0/24. If you are on one which starts with 192.168.1.x for example, make sure you replace the previous to last 0s with 1s. Then press ctrl+x and Y to save and exit and then restart your network interface:
/etc/init.d/networking restart
Setting up storage devices
It’s very likely that you’ll use your server with various external storage devices as well and it makes sense to have those devices automounted on boot-time and in the same location.
First make sure that the devices are connected and powered on correctly. Run an fdisk command to see that you see as many devices as you have connected:
$ sudo fdisk -l
Disk /dev/sda: 400.1 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000f2d2
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12748 102398278+ 7 HPFS/NTFS
/dev/sda2 12749 48641 288310522+ 5 Extended
/dev/sda5 12749 47889 282270051 83 Linux
/dev/sda6 47890 48641 6040408+ 82 Linux swap / Solaris
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1114b515
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760001 c W95 FAT32 (LBA)
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
1 heads, 63 sectors/track, 31008336 cylinders
Units = cylinders of 63 * 512 = 32256 bytes
Disk identifier: 0x06ee1af5
Device Boot Start End Blocks Id System
/dev/sdc1 * 2 31008256 976760032+ 7 HPFS/NTFS
So we see that I have 2 extra USB devices connected on my server. The first one is my internal disk and there are two more 1Gb devices connected. /dev/sdb1 and /dev/sdc1
Now that we know what we are looking for, we also need to find the Unique ID of each which we’ll use to always automount the same device in the same place.
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2010-03-28 17:28 2050C96150C93DF2 -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-03-28 17:28 22d3ff6d-39c6-4599-8f46-2dfc8fde918c -> ../../sda5
lrwxrwxrwx 1 root root 10 2010-03-28 17:28 5326ee5d-cf6a-4517-bef3-c62edf593fdf -> ../../sda6
lrwxrwxrwx 1 root root 10 2010-03-28 15:29 76E0A71CE0A6E19B -> ../../sdc1
lrwxrwxrwx 1 root root 10 2010-03-28 15:29 b1043f04-49a7-4d66-a2e3-5e9e755520a9 -> ../../sdb1
So we can now see that the unique Identifier of those two partitions.
Now we need to create the directories where we’ll be mounting those devices every time. The name is nor important, choose what you think will be easiest to find (such as the device’s label). In my case I used store1 and store2
$ sudo mkdir /media/store1
$ sudo mkdir /media/store2
And now we need to edit the automounter file to make sure our devices are mounted
$sudo nano /etc/fstab
Now add a section similar to the ones below, at the end of your fstab
### External Disk mounts ###
# Void-1
UUID=b1043f04-49a7-4d66-a2e3-5e9e755520a9 /media/store1 auto rw 0 0
# Expansion Drive
UUID=76E0A71CE0A6E19B /media/store2 auto rw 0 0
Replacing of course the UUIDs you see here with the ones you saw for your own partitions.
Now press ctrl+x and Y to save and exit and try to mount your new devices
$ sudo mount -a
Now your external devices will be automatically started on boot time as long as they’re connected and turned on.
Now that we’re done, we can proceed to setup the XBMC media system.