Adding more functionality to Kubuntu 9.10 NBR

In a previous article, I covered off the installation of Kubuntu 9.10 (Karmic Koala) onto an aging, but much loved and reliable ASUS 701 EEE Netbook. In this entry, I will detail a few of the additional bits of functionality I’ve added to the already awesome Netbook Remix (NBR) of this latest OS drop.

Topics Covered

As always, if there are things you think I should be including, or better ways of doing stuff, let me know in the comments 🙂

Pairing Bluetooth to a Nokia E71

Using an inexpensive bluetooth adapter allows you to get online without having to drag out cables etc when you’re on the bus, in the car – wherever.

The adapter detected fine – but then came the job of setting up the pairing with my Nokia E71:

On the EEE

  • From the Home Screen, open the ‘Internet’ group, then open up ‘kbluetooth’
  • You should see a bluetooth icon appear on your toolbar
  • Right-click the bluetooth icon, and select ‘Settings’ > ‘Bluetooth Adapters’ from the dropdown menu.
  • From the ‘Bluetooth Adapter’ dialogue box, set:
    • Adapter Name: ‘[WhateverYouWant]’
    • Mode: ‘Discoverable’

NOTE: Your Netbook is now being all promiscuous and stuff to the world, long-term, this isn’t good.

  • Click OK


On the Nokia E71

  • Select ‘Menu’ > ‘Connectivity’ > ‘Bluetooth’ and set:
    • Bluetooth ‘On’
    • Visibility ‘Shown to all’ (the same promiscuous warnings apply)
    • My Phones Name ‘[WhateverYouWant]’
    • Remote SIM ‘Off’ (not sure what it does, didn’t need it on)
  • Now, scroll/tab to the right and you’ll see the ‘Paired Devices’ list.
    • Select ‘Options’ > ‘New Paired Device’

Your phone should now scan for any bluetooth devices in range (if your workplace is anything like mine you’ll see a heap of devices)

  • ‘Select’ the device with the name you set in the EEE steps above.
  • The phone will now prompt for a passcode – Enter a passcode (numeric) into your phone.

On the EEE

  • You should now be prompted to enter a passcode on the EEE, enter the same numeric code

On the E71

  • You will be asked to ‘Authorise device [the EEE] to make connections automatically’, select ‘Yes’
  • Your connection should now appear in the phone

(Optional)

  • Select ‘Options’ > ‘Assign short name’ and change the name of the device to something more friendly if you wish.

On the EEE

  • Right-click the bluetooth icon, and select ‘Settings’ > ‘Bluetooth Device Manager’ from the dropdown menu.
  • Your E71 should appear in the list, select the device and click ‘Set Trusted’

Congratulations, your devices are now paired… now to do something useful with the connection!

Installing EEE Control (EEE PC Tray)

EEE Control is a utility written to allow easy management of the ASUS EEE embedded devices such as en/disable the Webcam, SDCard, Wifi as well as setting power and performance schemes.

To set it up under Kubuntu NBR, simply open a terminal window and enter the following:

sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update && sudo apt-get install eeepc-tray

You should see an icon appear on your taskbar which allows you to access the functionality supported by your model of EEE netbook.

Installing UbuntuONE

Ubuntu One is your personal cloud. You can use it to back up, store, sync and share your data with other Ubuntu One users.”

…it’s just not in the Kubuntu NBR by default. To fix this, simply open a terminal window and enter the following:

sudo apt-get install ubuntuone-client-gnome

You will then find a UbuntuOne cloud icon in your ‘Internet’ applications group, and from there you are only a simple configuration away from your 2GB of free storage out in the interwebs somewhere.

Installing Skype

Skype is a VoIP client, if you haven’t heard of it in the last 5 years, you’ve probably been living under a rock – it works, the voice quality is acceptable and while the video capability can be variable, it’s got a huge number of subscribers so, give it a crack – you’ll probably find a number of your friends are already on there. My Current Skype Status is:

To get things running on your netbook, see below:

Remember, those of us with low resolution screens may need to invoke the <Alt> + <Mouse Click & Drag> trick to see the bottom of some dialogue boxes.

Hope this helps those of you out there wanting to squeeze a little more life out of your beloved Netbooks

Installing Karmic Koala (9.10) on an ASUS EEE 701 netbook

Koala

So – Karmic is out, and for those who are looking to upgrade to the new goodness, there’s a few simple tricks to make the process pretty much painless.

If you’re already running (K)Ubuntu 9.04, simply open up a terminal window and type:

update-manager -d

For those installing from scratch (and to be honest – it’s what I tend to still do, hang up from the Windows days?) things are almost as simple.

Getting the Files

  1. Grab a 2GB or larger USB stick
  2. Hit the web for your ISO files

Once the files are downloading (and they’ll take awhile as everyone hits the servers initially (trying a torrent may help), head on to the next step…
Making your USB bootable

  • Grab Unetbootin for your OS for a really easy way to create a bootable USB drive
  • Insert your USB stick, double check where it’s loaded then create!

On your EEE 701

  • Because of the native resolution of the original EEE, a number of dialogue boxes don’t fit so well on the screen. This is mostly only a hassle during the installation as, afterward, you should be able to hold down the <Alt> key while click-dragging the window you want to see the bottom of.
  • If you have an external monitor available, connect it and change the screen settings to display a more reasonable resolution, larger than the crippling 800×400 of the native 701 🙂
  • If you do not have an external monitor available, don’t panic – we can simply use the keystroke navigation as detailed below
    • Ubuntu Install (First Screen)
      • Press <Alt> + <F> (Forward)
    • Welcome Screen
      • Choose your language then <Alt> + <F>
    • TimeZone / Where are you
      • Select your location
      • <Alt> + <F>
    • Keyboard Layout
      • This should detect fine so…
      • <Alt> + <F>
    • Prepare Disk Space
      • To install to 4GB SSD (This will delete EVERYTHING ON THE DISK and install from a blank partition)
        • <Alt> + <E>
        • <Alt> + <F>
        • Partitions will calculate
      • For a Custom Install (to use SDHC card in a EEE for instance)
        • <Alt> + <S> (to Specify partitions)
        • <Alt> + <F>
        • Setup partitions as you wish
          • I chose to use /dev/sdc (the SDHC card) creating a Primary partition of [Full Size of Storage minus Amount of installed RAM (for swap) ]
          • Set mount point to ‘/’ and use the ext4 file system
          • Create a logical partition using the rest of available disk as swap (which should be size as the amount of RAM in your system)
          • <Alt> + <F>
        • Partitions will calculate
    • Who are you- Obvious really:
      • Your Name <Tab>
      • Login/Username <Tab>
      • Password <Tab>
      • Password Verify <Tab>
      • Device Name<Tab>
      • Choose your Login type
        • “Require My password” <Alt> + <M> – Default
        • “Login Automatically” <Alt> + <L> or
        • “Require my password to login and Decrypt Home folder” <Alt> + <R>
      • <Alt> + <F>
    • Summary
      • Last chance to check all your selections
      • Alt + I (to Install)
    • And now the installation will start…

At the end of the installation process, you will be prompted to remove the install media (USB drive) and reboot the machine.

You’re done!

Hacking with MSConfig – Speeding the boot process

My laptop is slow to boot – painfully slow. Slow to the point that, after entering my credentials, I’ll go make a coffee or grab an architecture document to review – anything to avoid the minutes of chugging away which occurs whenever the boot scripts are doing their thing and all the Windows background processes are starting up.

This is where fun little tweaks such as those available in the Windows System Configuration editor come in handy. This is a little known tool which allows you to view and edit the things which load during your windows boot. Of course, because you can edit things in the startup files, it doesn’t mean you should. You can probably make quite a mess of your system if you get too free and easy with the clicking via this tool – so make sure you understand what it is you’re telling you machine not to do when if you decide to start unselecting options.

For me, the big one was to change the number of processors available to the startup sequence from 1 to 2 and allow maximum RAM to be utilised. To do this (these instructions assume Windows Vista, but XP should be the same – possibly with different dialogue box layouts), first you’ll need to startup the Windows System Configuration editor – Click Start, Run, and type in ‘MSConfig’. You’ll likely be asked for authorisation/administrative access to run the utility so, assuming you can grant such things, the first screen you’ll see looks like this:

Default System Configuration Screen

Click the ‘Boot’ Tab

Boot Options - System Configuration

And select the ‘Advanced Options’ button

Advanced Boot - System Configuration

And there’s the money shot, change the number of processors, the maximum allowable memory, click OK to save and you’ll be asked to reboot.

Good luck.

Installing Windows 7 (Build 7000)

Windows LogoWow. I’m in love again.. well, maybe – I’m certainly in LIKE!

A few days ago I wiped out my gaming rig with the intention of installing the latest beta of Windows 7. The Beta was opened up around mid-January and attracted a LOT of attention, and downloads. Personally I grabbed both the 32-bit and 64-bit builds as at some stage I’d like to see if I can get an install running on the EEE.

Installation:

The 32-bit DVD turned out to be a failure, but – since I have a Core 2 Duo I was able to install the 64-bit version without issues, in fact I was struck by just how FAST it installed – I was go to whoa in around 15 minutes. In terms of peripheral detection, everything- including my Leadtek USB DVB-T tuner were found and working right off the bat.

So, first impressions are ‘wow’ and ‘cool’ and ‘I want to replace Vista PERMANENTLY’. If you have a spare machine kicking around at home, I’d fully recommend it.

Post Install:

Media Center – This just works. No fnarkling in the registry, no loading internal webservers and pointing guide downloads to a local source – it just works… with a DVB-T tuner that is – the channel names are captured but I’m not seeing the guide data getting populated within the grid. I have my suspicions that the guide may not be found as my DVB-T card is kinda ancient and may not be picking up the now/next data correctly. I know Mauricio has been testing the Win7 Media Center for a lot longer (and probably has more recent gear than I do) and, given that he’s replaced Vista on his primary media server box, I suspect he has had more sucess in this space.

I haven’t had time (or free PCI slots) to try a traditional tuner and, given the guide data in NZ is only transmitted in band for DVB-T transmissions, I’m not holding my breath.

Edit 02/02/2009: I’ve got the bug!

I wandered into the office at home this afternoon to find my Win7 rig dead. Well, running – but with no display and no ability to wake it up. Apparently others have also seen this behaviour but, unlike those commenting on the article, I have yet to have any sucess in the whole ‘turn it off and on and off and on until it wakes up’ department. So, at the moment – I’ve got a dead PC and no obvious way of sparking it back to life. Granted, it’s Beta – but this seems kind of fundamental so, assuming I can resurrect the box and get Windows 7 talking to me again, I’ll be disabling all power saving features in the hope that things don’t repeat. Failing that, it’s back to WinXP, or Vista, or Ubuntu + WINE.

Edit 03/02/2009: Aaaand we’re back

Managed to get the PC booting again, it may be conincidence, but after popping out the video card and booting off the onboard video, things livened up once more. Reinserted the video card and all back to it’s normal speedy self. Much enjoyment playing around on the system now.

Installing Ubuntu 8.04 on the ASUS EEE

Okay, so I did a painless upgrade from 7.10 to 8.04 LTS while it was still in pre-release, but now that I’ve been playing around with the system for awhile, it’s apparent that my needs are changing and the easiest way to cater to these needs is a full reinstall from scratch, putting in place the learnings I’ve gained since initially getting the EEE and blowing away the default Xandros installation.

Update 19/05/2008: Added a few more applications to the HOWTO

Update 22/05/2008: Added a ‘Weirdness’ Section after having problems removing files from Trash.

Continue reading “Installing Ubuntu 8.04 on the ASUS EEE”

Setting up Sarge

I’m finding more and more need for a large amount of ‘always on’ storage to be available on my home network and, the recent release of Debian 3.1 (Sarge) has enticed me to repurpose a box I had around the house and get it up and running…

Debian GNU/Linux 3.1 (a.k.a. sarge) was released on 6th of June, 2005. The new release includes a bunch of major changes to it’s predecessor Debian GNU/Linux 3.0 (a.k.a. woody). You can check out the press release, review the release notes, or simply click yourself off to the Debian website to read more about it.

Now, while an official installation manual exists, and Google will help you find thousands of people who may be able to answer more technical questions, this page (or pages – depending on how much I end up caring about the documentation) will record my installation experience on my soon to be main server for the house. It’s mainly for my future reference, but you may find it useful too! I have based the instructions on the experience after booting to a CD burnt with the debian-31r0a-i386-netinst.iso file.


Hardware
This section is a little unnecessary as the Debian 3.1 install is actually pretty good at finding everything, but – for the sake of completeness – my hardware configuration for this server is as follows:

Case: Enermax FS-710B Yes it’s big, but the case was unutilised from a previous MythTV backend server project. This machine will also be running a number of hard drives and cooling is key 🙂
PSU: Enermax 550W EG651P-VE Again
big – 550W (peak 650W) is more than the average system needs, but these
are quiet units and I’m expecting to have a large amount of disk in
this unit at the end of all this. – [Review]
Motherboard: ASUSTeK A7V333-RAID

(VIA KT333 Chipset)

It’s an old board and monitoring the environmental sensors on it doesn’t appear to be too easy – if you have this board AND can direct me to an easy to follow howto to get monitoring working under Debian Sarge, please drop and email to rob [dot] inskeep [at] gmail [dot] com (with the obvious changes to unmung my address :))

I’ve found this link around running Debian on this board – I’ll need to have a bit more of a play and see if it can clarify any of the issues I’ve been having…

CPU: AMD Athlon 2100+
RAM: Generic 512MB PC2700 DDR
Hard Drives: 40GB Maxtor

120GB Western Digital

200GB Seagate

Apollo UATA133 2MB Cache (6E040L0)

(WD1200BB-00DW)

(ST3200822A)

Optical: LG DVD ROM It may seem like overkill to put a DVD ROM into a server and I’d agree – but as the distros get bigger it’s making more sense – it also allows me to convince myself (and the accountant wife) that a DVD/RW + CD R/W drive would be a good investment for one of the LAN PCs
Video Card: Power Color CM64P I found this card in my box of bits that all us IT types tend to accumulate, I can’t find a manual or anything useful to describe the card so – google may be your best bet here.
Sound Card: Onboard (C-Media CM8738) Not planning to use this
NIC: PCI 3Com 3C905B Will probably add/replace with a Gig card at some stage


Initial boot from the Network Installation CD

1.0 Choose Language
English
2.0 Choose Region
New Zealand
3.0 Choose Keymap
American English

4.0 Detection Phase

5.0 Configure the Network
5.1 Enter Hostname
[Enter a name for your machine]
5.2 Domain Name
[Selected Default]

6.0 Partition Disks
I have 3 Disks in this system:
40GB Maxtor (6E040L0)
120 GB Western Digital (WD1200BB-00DW)
200GB Seagate (ST3200822A)
Since there is nothing I want on the box I’m happy to have the install wipe out everything.
6.1 Partitioning Method
6.1.1 Erase entire disk: IDE1 Master (hda)
6.1.2 All files in one partition
This created 2 partitions,
#1    primary    39.5GB    ext3    /
#5    logical      1.6GB     swap   swap
I don’t plan to setup the other 2 disks yet as I want to span them into a very large drive which I can add more space to later – that will take a bit of learning I imagine so for now we just:
6.2 Finish partitioning and write changes to disk
Answer yes to confirm writing the partition tables.

7.0 Write partitions / Installing Debian base system

8.0 Install GRUB boot loader
8.1 Install GRUB as default boot loader

9.0 Completing Installation
9.1 Remove the CD from the drive


First boot after initial CD Configuration

10.0 Debian Configuration

11.0 Time Zone Configuration
11.1 Clock is NOT set to GMT
11.2 Pacific/Auckland
11.3 Root password
11.4 Users Full Name
11.5 Username
11.6 User Password
English

12.0 APT configuration
12.1 Chose edit by hand
Enter the sources as listed further down in this section – some may not resolve at this point so commenting them out with a # at the start of the line will allow you to continue through the installation.

13.0 Software Selection
Note: I would not choose to install applications during the initial setup as, until this guide is complete and I can understand everything which is happening, I want to be able to install all the packages I need via the apt-get method. To do this, it pays to use local sources where it makes sense see below for my sources list which can be copy/pasted into
/etc/apt/sources.list

13.1 Unpacks a bunch of files

13.2 Configuring Exim v4 (exim4-config)
13.2.1 Local delivery only; not on a network
13.2.2 Plan to configure things later to grab mail from various POP sources and deliver locally to allow for spam/virus blocking at the network level.
13.2.3 Root & postmaster mail recipient
13.2.3.1 [default user]
13.3 Debian configuration complete
13.5.1 Note that we can run this again via base-config program.
13.5.1.1 OK
13.4 Tries to start X & fails
13.6.1 Disables X Server until X can be configured correctly
13.5 Login Prompt

That’s it – the system is setup, now obviously there is some tidy up to do – but at least the system is running. Now, while we still have a local keyboard and monitor plugged in, we need to set the system to use a static IP address so we can find it later once it’s running headless (without a local keyboard/mouse/display).
You may find it easier to finish off via a SSH connection, first off we need to know the IP address that DHCP has assigned to this machine.

ifconfig
You are interested in the value of inet addr: for the eth0 card as this is the IP for the machine (and you’ll need to use it to connect your SSH client remotely.
inet addr:10.1.1.xxx

Once you’re remotely connected, you can carry on to the next step, or go it alone and install any packages you so desire. The only package I needed at this point was vim, a text editor.

  1. As the root/su user, do an apt-get update and an apt-get upgrade first, to ensure you have the latest packages and package list.
  2. Use the command apt-get install vim to install the vim text editor
  3. Edit your /etc/apt/sources.list to restore the lines we commented out during the installation.
    vim /etc/apt/sources.list
    Your file should look something like this:

    ———————————————————————-
    deb ftp://ftp.jetstreamgames.co.nz/debian stable main
    deb ftp://debian.ihug.co.nz/debian/ stable main
    deb http://http.us.debian.org/debian stable main contrib non-free
    # The non-US source listed below is not loving me at the moment – I need to find
    # another non-US apt source.
    #deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free

    deb http://security.debian.org stable/updates main contrib non-free
    ———————————————————————-

  4. Do another apt-get update to test your sources and ensure you have the latest package lists.
  5. Once all your sources are working, do a apt-get upgrade to update your system with the latest packages


Setting a Static IP address
To set a static IP address, you will need to edit the /etc/network/interfaces file:
vim /etc/network/interfaces
Change the line:
iface eth0 inet dhcp
to:

iface eth0 inet static
address [ a_valid_IP_address ] (e.g. 10.1.1.xxx)
netmask [ your_netmask ] (e.g. 255.255.255.xxx)
network [ your_network ] (e.g. 10.1.1.0)
broadcast [ your_network ] (e.g. 10.1.1.0)
gateway [ your_gateway ] (e.g. 10.1.1.xxx)

and save/exit the file (<esc> :wq <enter>)

To apply this configuration type:
/etc/init.d/networking restart
or reboot the system with shutdown -r now


Creating a Spanned Disk using LVM
So, the theroy is like this: I have a couple of largish hard drives (okay, as large as I could afford – and had lying around) and had previously spanned these within Windows XP to store a buttload of files and stuff. Since this server we’re building is going to be up all (most?) of the the time, it goes to reason that the large disk should sit here rather than on a windows box which goes up and down like a whitehouse intern.
On with the section…

  1. Start with unpartitioned disks
  2. Install LVM packages
    apt-get install lvm-common lvm2
  3. Initialize the disk(s) (or partition(s)) for use by LVM
    pvcreate /dev/[ device_name ]

    e.g. pvcreate -ff /dev/hdc
    e.g. pvcreate -ff /dev/hdd
    The -ff option forces an initialisation

  4. Create a Volume Group vgcreate [ volume_group_name ] [ device_to_include ] [ device_to_include ]

    e.g. vgcreate volume_group /dev/hdc /dev/hdd

  5. Create a Logical Volume
    lvcreate -l [ the_size ] [ y o u r _ v o l u m e _ g r o u p ]

    e.g. lvcreate -l 76313 volume_group

    To determine [ the_size ] you can run the command vgdisplay [ volume_group_name ] and take the ‘Total PE’ value (or fraction of). See below for an example of this on my system.

  6. Make the File System
    mkfs -t ext3 /dev/[ your_volume_group ]/[ y o u r _ v o l u m e _ g r o u p ]

    eg
    mkfs -t ext3 /dev/volume_group/LargeDiskVolume

  7. Mount the Drive
    mount /dev/[ Volume_Group_Name ]/[ Logical_Volume_Name ] /mnt

    e.g.
    mount /dev/volume_group/LargeDiskVolume /mnt

  8. Check the Mount
    df

    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/hda1 xxxxxx xxxxxx xxxxxx xx% /
    tmpfs xxxxxx xxxxxx xxxxxx xx% /dev/shm
    /dev/mapper/large_disk_volume-LargeDiskVolume 307673208 32828 292011480 1% /mnt
  9. Set the mount to load at boot
    vim /etc/fstab
    Add the line:
    /dev/disk_span/lvol0 /mnt       ext3    defaults        0       0

    Save the file
    Test with mount -a

Right – the mount appears, it’s all done! The next step is to install Samba and create a share that windows machines can see and write to.

Displaying the Volume Group Information
vgdisplay volume_group

— Volume group —
VG Name volume_group
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 298.10 GB
PE Size 4.00 MB
Total PE 76313
Alloc PE / Size 76313 / 298.10 GB
Free PE / Size 0 / 0
VG UUID 78S1Dh-W6xW-iX1r-nTCQ-egEB-FKan-uRrT0a

Displaying the Logical Volume Information
lvdisplay

— Logical volume —
LV Name /dev/volume_group/LargeDiskVolume
VG Name volume_group
LV UUID 8CrfT4-L2Np-2dEe-R8Xw-hYYn-x2m5-8zebZn
LV Write Access read/write
LV Status available
# open 0
LV Size 298.10 GB
Current LE 76313
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 254:0

Reference: LVM HowTo


Backing up your Installation

If you’re following through this in the order that it’s written, it’d probably a good time to take a snapshot of your raw system before we go installing anything (clever) which might cause problems further down the track. This is a good idea as it give you a clean build of your system after all the initial setup has completed – and saves the setup bandwidth should you need to start again 🙂
I’ve chosen dd as the tool to create the backup as it’s reletivly well documented so googling will pretty much sort out most issues you’re likely to run into (very important when you’re talking about your digital assets!). The ddcommand will do a bit for bit backup of a Hard Disk. I’m using this to give myself an image that I can always come back to as I try changing and installing new ‘stuff’ on my system (given my tendency to haphazardly experiment as I go).

Backing up:

  1. Create a directory to store the backup
    mkdir /[device to store the backup on]/[backup directory name]

    e.g. mkdir /mnt/backup

  2. Copy the HDD to an image file
    dd if=/dev/[hard drive name] of=/mnt/[backup directory name]/[backup name].iso bs=65535

    e.g. # dd if=/dev/hda of=/mnt/backup/mydisk.iso bs=65535

    BE ROOT FOR THIS! Actually I don’t know for sure, but it stands to reason that if you don’t have the access of root, then you won’t be able to back up files owned by root.

  3. Be patient. THIS WILL TAKE QUITE AWHILE (You are after all copying an entire disk) when it completes, you will see something similar to the following (just with numbers not xxxs 😉 )xxxxxx+1 records in
    xxxxxx+1 records out
    xxxxxxxxxxx bytes transferred in xxx.xxxxxxx seconds (xxxxxxxx bytes/sec)
  4. Compress the Image
    If you have a large amount of free space on the disk you were copying, compressing it will shrink it’s size.
    gzip /[device to store the backup on]/[backup directory name]/[backup name].iso

    e.g. gzip =/mnt/backup/mydisk.iso

    Again, this will take a fair while to complete so I’d recommend taking the dd and the gzip command lines and pasting them to the command line together so your system runs them one after the other – you could of course automate this with a script and run it via cron too. As an indication, I was able to turn my 41,110,142,976 byte .iso into a 32,757,683,474 byte .gz file – that’s about a 20% space saving!

Getting it back (Restore [for the benefit of searchbots]):

  1. From some kind of command line (you could use a Knoppix CD or similar CD based distro) you need to run:
    dd if=/[device the backup is stored on]/[backup directory name]/[backup name].iso
    of=/dev/hda bs=65535

    e.g. dd if=/mnt/restore/mydisk.iso of=/dev/hda bs=65535

  2. Reboot
    shutdown -r now
    Note – I haven’t tried a restore at the time of writing this, so I’d recommend testing your backup before you need it.

Creating a Network Share with Samba

So, by this point you should have a machine setup on your network and you may even have a spanned disk with a heap of space which you can make available to your other network machines.
I’m going to use Samba to create the shared drive and control its access so that my Windows machines can also make use of the space.

  1. Install the Samba packages
    apt-get install samba smbfs smbclient

    How do you want to run Samba: [daemons]
    Create samba password database, /var/lib/samba/passdb.tdb? [Yes]

  2. Add a Linux user for linking to the Samba share
    adduser

    Enter a username to add: [Share Username]
    Adding user ‘[Share Username]‘…
    Adding new group ‘[Share Username]‘ (1001).
    Adding new user ‘[Share Username]‘ (1001) with group ‘[Share Username]‘.
    Creating home directory ‘/home/[Share Username]
    Copying files from `/etc/skel’
    Enter new UNIX password:
    Retype new UNIX password:
    passwd: password updated successfully
    Changing the user information for [Share Username]
    Enter the new value, or press ENTER for the default

    Full Name []: [Share Username]
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
    Is the information correct? [y/N] [y]

  3. Add users to the Samba server
    smbpasswd -a [Share Username]

    New SMB password:
    Retype new SMB password:
    Added user [Share Username]

  4. Create a directory to share
    I’m assuming that your LVM is already mounted, if not check the LVM section for the correct syntax
    mkdir /mnt/[Share Directory Name]

    e.g. mkdir /mnt/MediaStore

  5. Allow others to reand and write to the directory
    chmod 777 /mnt/[Share Directory Name]

    e.g. chmod 777 /mnt/MediaStore

At this point, you need to decide if you’re GUI or CLI, for me a Graphical User Interface is quicker and suits my impatient nature quite nicely, others may wish to do all their config from the Command Line Interface – either choice is fine, but for the sake of swift sharing, and given that this server will sit on the inside of my network, I’ve chosen to use a package called SWAT (Samba Web Administration Tool) to help me setup my Samba shares

  1. Install the SWAT package
    apt-get install swat
    As the package configures, you will receive a warning that your smb.conf file is about to get overwritten. Choose [Ok]
  2. Enable SWAT by allowing the service
    vim /etc/inetd.conf
    Find and uncomment the line:

    #<off># swat            stream  tcp     nowait.400      root    /usr/sbin/tcpd  /usr/sbin/swat

    The line should now read:

    swat            stream  tcp     nowait.400      root    /usr/sbin/tcpd  /usr/sbin/swat

    Save the file

  3. Enable SWAT by allowing the port
    vim /etc/services
    Add the line:

    swat 901/tcp

    Save the file

  4. Reboot the server (or figure out how to reload the affected configuration files – and let me know)
    To REBOOT use shutdown -r now
    To RELOAD without a full reboot, use /etc/init.d/inetd reload

Right, now you should be able to point a browser on your LAN to

http://[Server Hostname or IP Address]:901/

You should be presented with an authentication dialogue (which you’ll need to use your root credentials for – don’t worry, you can setup other users once you’re in)

  1. Click the shares link
  2. Create a Share by entering your [Sharename] and clicking the ‘Create Share’ button
  3. In the ‘Base Options’ section, enter the path that you created above ‘/mnt/[Share Directory Name]’
  4. In the ‘Security Options’ section, add the users you want to have access to the relevant list (valid users, read list, write list) e.g. I will have a user who can read and write from my windows machines, but the media devices which also connect to this share will be write only. In the ‘hosts allow’ line, you may want to add you whole network with

    10.1.1.0/255.255.255.0

    or just specific IP addresses

  5. Click ‘Commit Changes’ when done setting options

Reference:There is a pretty good article over on Linux Questions on SAMBA, click here to view


Monitoring the box

This section covers a number of aspects of monitoring which I feel are necessary, but then – I do have a soft spot for numbers and graphs!


RRDTool

This is a great tool used to graph pretty much anything, seriously! One of the features I like the best about it is how the databases it creates never get any bigger than they are when you create them. I’ve decided to store all my databases in /var/lib/rrd/ since a number of others out there seem to use this location and it just makes using other peoples scripts a lot easier.

  1. Install the RRDTool package
    apt-get update && apt-get install rrdtool

Read the documentation on the web for how it all works – it’s explained better there than I can do in this guide.


Hard Disk Drives

SmartMon tools is a package which allows you to interrogate your SMART enabled hard drives for problems. There is a pretty good article over at the Linux Journal here which details the what’s and how’s of the package.

To monitor the hard drive(s) on this system I followed these steps:

  1. Edit /etc/apt/sources.list to add the location of the SmartMon tools package
    vim /etc/apt/sources.list
  2. Add the lines:

    # Location of SmartMon Monitoring Package
    deb http://honk.physik.uni-konstanz.de/~agx/linux-i386/debian smartmontools/

  3. Update your sources and install the package
    apt-get update && apt-get install smartmontools
  4. smartd was disabled and to enable I needed to edit /etc/default/smartmontools
    vim /etc/default/smartmontools
  5. Uncomment the smartd line
  6. Start smartd
    smartd
  7. Check your disks
    /usr/sbin/smartctl -a [disk name]

    e.g. /usr/sbin/smartctlsmartctl -a /dev/had

    I got output which looks like this:

smartctl version 5.32 Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: Maxtor 6E040L0
Serial Number: xxxxxxxx
Firmware Version: xxxxxxxx
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 0
Local Time is: xxx xxx xx xx:xx:xx xxxx xxxx
SMART support is: Available – device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (1021) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
No General Purpose Logging support.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 17) minutes.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
3 Spin_Up_Time 0x0027 220 219 063 Pre-fail Always – 8211
4 Start_Stop_Count 0x0032 253 253 000 Old_age Always – 1110
5 Reallocated_Sector_Ct 0x0033 253 253 063 Pre-fail Always – 0
6 Read_Channel_Margin 0x0001 253 253 100 Pre-fail Offline – 0
7 Seek_Error_Rate 0x000a 252 252 000 Old_age Always – 1
8 Seek_Time_Performance 0x0027 250 234 187 Pre-fail Always – 64735
9 Power_On_Minutes 0x0032 232 232 000 Old_age Always – 983h+23m
10 Spin_Retry_Count 0x002b 253 252 157 Pre-fail Always – 0
11 Calibration_Retry_Count 0x002b 253 252 223 Pre-fail Always – 0
12 Power_Cycle_Count 0x0032 252 252 000 Old_age Always – 403
192 Power-Off_Retract_Count 0x0032 253 253 000 Old_age Always – 359
193 Load_Cycle_Count 0x0032 253 253 000 Old_age Always – 1698
194 Temperature_Celsius 0x0032 253 253 000 Old_age Always – 37
195 Hardware_ECC_Recovered 0x000a 253 252 000 Old_age Always – 1136
196 Reallocated_Event_Count 0x0008 253 253 000 Old_age Offline – 0
197 Current_Pending_Sector 0x0008 253 253 000 Old_age Offline – 0
198 Offline_Uncorrectable 0x0008 253 253 000 Old_age Offline – 0
199 UDMA_CRC_Error_Count 0x0008 199 199 000 Old_age Offline – 0
200 Multi_Zone_Error_Rate 0x000a 253 252 000 Old_age Always – 0
201 Soft_Read_Error_Rate 0x000a 253 252 000 Old_age Always – 3
202 TA_Increase_Count 0x000a 253 252 000 Old_age Always – 0
203 Run_Out_Cancel 0x000b 253 252 180 Pre-fail Always – 0
204 Shock_Count_Write_Opern 0x000a 253 252 000 Old_age Always – 0
205 Shock_Rate_Write_Opern 0x000a 253 252 000 Old_age Always – 0
207 Spin_High_Current 0x002a 253 252 000 Old_age Always – 0
208 Spin_Buzz 0x002a 253 252 000 Old_age Always – 0
209 Offline_Seek_Performnce 0x0024 184 184 000 Old_age Offline – 0
99 Unknown_Attribute 0x0004 253 253 000 Old_age Offline – 0
100 Unknown_Attribute 0x0004 253 253 000 Old_age Offline – 0
101 Unknown_Attribute 0x0004 253 253 000 Old_age Offline – 0

SMART Error Log Version: 1
ATA Error Count: 1
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It “wraps” after 49.710 days.

Error 1 occurred at disk power-on lifetime: 0 hours (0 days + 0 hours)
When the command that caused the error occurred, the device was in an unknown state.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
04 51 50 40 97 03 00 Error: ABRT

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
ef fe 00 00 00 00 00 00 00:03:20.976 SET FEATURES [Reserved for CFA]
ec 00 01 01 00 00 00 00 00:03:20.944 IDENTIFY DEVICE
c1 00 00 00 00 00 00 00 00:03:20.944 [VENDOR SPECIFIC]
c0 00 01 01 ff ff 00 00 00:03:20.928 CFA ERASE SECTORS [VS IF NO CFA]
c1 00 ff 01 ff ff 00 00 00:03:20.928 [VENDOR SPECIFIC]

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 4348 –

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Loads of info huh? You can obviously pull out what is of interest to you from here.