My server box has been running really well. The simplicity of the components appears to be holding up - I still haven't found a proper benchmarking tool to test it out but oh well, another day. For now, I've attached several external hard drives so that I can play them on either of my laptops. Using the smb client has proven to be very successful, even over wireless the network. My housemate states that often videos will skip when she plays them on her computer, however this is not the case on my computers so we are both assuming that her computer does not have enough processing power to play the videos. An easy solution would be to use a wired connection - and we might just do that in due time.
What I would like to post today is my current /etc/fstab file. I've finally decided to read a bit about fstab configuration and now I'm wondering why I didn't do it earlier - it's really simple! As always, there is good documentation from the Ubuntu website. There is an example of an fstab entry and as you will see, they are not much different from a mount command.
To find out information about the devices that are connected, use blkid - the output will look like the following:
sudo blkid
/dev/sdc1: LABEL="A-hard-drive" UUID="12B0WF25B0DF0KDB" TYPE="ntfs"
/dev/sdd1: LABEL="Another-hard-drive" UUID="554123D9E73ABF54" TYPE="ntfs"
Take note of the UUID and the TYPE. These will be used in your new fstab file.
Go to /etc/fstab and make a copy of the original file, just incase something goes horribly wrong. I usually just append .orig to the end of the file (fstab.orig), that way it can be found easily again later. If you append orig. to the start (orig.fstab), then you might have trouble finding it later.
sudo cp /etc/fstab /etc/fstab.orig
Open up /etc/fstab with your favourite editor, I use nano since I don't know emacs...yet :). Your original file will look a bit like this, thought it may have more entries depending on how you setup your distro.
sudo nano /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda5 during installation
UUID=5efe42d5-1b11-4287-a604-diid345b63d6 /home ext4 defaults 0 2
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
So alls you gots to do, is add your entries to the end of this file. Easy huh? From blkid before, you'll need to take the UUID and use that so the computer can identify the external HDD if it happens to be plugged in. I'm hoping that you have read the Ubuntu Docs I linked to before, and you will know that the syntax is something along the lines of:
[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]
That said, for me, I just add these two lines to the end of fstab and my configuration is complete:
UUID=12B0WF25B0DF0KDB /media/OneTouch ntfs-3g uid=user,gid=group-name,umask=0000 UUID=554123D9E73ABF54 /media/Elements ntfs-3g uid=user,gid=group-name,umask=0000
Final file:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda5 during installation
UUID=5efe42d5-1b11-4287-a604-diid345b63d6 /home ext4 defaults 0 2
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
UUID=12B0WF25B0DF0KDB /media/OneTouch ntfs-3g uid=user,gid=group-name,umask=0000
UUID=554123D9E73ABF54 /media/Elements ntfs-3g uid=user,gid=group-name,umask=0000
Important! The security of your filesystems is solely up to you. I have used ntfs-3g because this allows users to write to the filesystem. More info about which is the correct filesystem to mount an external as can be read here. Also, by setting uid and gid, you can permit only certain persons to access the filesystems. I believe I have mentioned this before, but no harm in mentioning it again right? Call me paranoid, call me what you will...
Hope this guide is useful, I'm sure I'll be reading it again in the future, when my server dies or I forget what an fstab is.
Adios, till next time!