Category Archives: Hardware

Hardware Configuration

Installing the latest nvidia Linux drivers in Ubuntu 11.10


In Ubuntu 11.10 the version of nvidia drivers which are installed by default are 280.13.

However, if you want to get the most from your nvidia graphics card then you probably want to use the latest Linux drivers from nvidia which are published on nvidia’s website.

Before you try to upgrade, make sure that the graphics card you are using is supported by the latest driver. To do this, click on the Supported Products tab on the nvidia driver page.

Downloading Linux drives from a manufacturers website is not particularly easy as you have to compile the driver for your kernel. However, thanks to HeticGeeks’s blog, there is an easier way by adding the Ubuntu-X team’s PPA to your install.

Below is a summary of what you need to do:

To add the PPA enter from Terminal:

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

you should see something similar to the following

now update your distribution by entering

sudo apt-get update

followed by

sudo apt-get upgrade

You should see nvidia-curernt listed as one of the packages which will be upgraded, press Enter to perform the upgrade

Note:

In my case on one computer the nvidia-settings package was held back, so performing a

sudo apt-get dist-upgrade

installed this outstanding package.

Finally, you will need to restart your PC to reload Xorg.

Once rebooted, run nvidia-settings to confirm your drivers have been upgraded to the latest version.

 

Advertisements

Installing Mythbuntu 10.10 with a Hauppauge Nova-T 500 PCI DVB-T card: PART 2 – Configuration


In part 1 of this tutorial we went through the process of doing a basic install of Mythbuntu 10.10. I’ve also covered installing Mythbuntu in Ubuntu 10.10.

As there are slight differences between the menus in XFCE (Mythbuntu) and GNOME (Ubuntu) desktops, Ubuntu differences/ specific instructions will have their text in a lovely brown Ubuntu colour!

In Part 2 we are going to:

  • Install additional proprietary firmware for DVB cards
  • Configure Mythbuntu so it works with the Hauppauge Nova-T 500 DVB-T card using Freeview (as I live in the UK)
  • Configure Mythbuntu to download the EPG via XMLTV using the Radio Times feed. In Ubuntu we will be using EIT.

Additional useful resources and where you should start looking if you get stuck:

Checking your hardware!

The Nova-T 500 DVB PCI tuner card is actually presented to the OS as a USB device, so doing a lspci in Terminal is not going to display the card!

To check the card is present enter in Terminal lsusb,

you will see something similar to the above if the Hauppauge card has been detected.

Add additional proprietary firmware for DVB

Click on Applications > System > Additional Drivers. The following menu will be displayed

In Ubuntu – System > Administration > Additional Drivers

Select Firmware for DVB cards and click on Activate

You will be asked for a password, enter your login password set when installing Mythbuntu. The driver will be installed.

You will then need to reboot the PC.

We now need to check that the firmware has been installed. In Terminal enter cd /lib/firmware/ followed by ls dvb-usb-d*. The following will be displayed

You should see listed a file called dvb-usb-dib0700-1.20.fw, this is the current version of the firmware which works. If you do not have this file then it can be downloaded and then copied to this directory.

The next step is to activate the Low Noise Amplifier, this will help boost the signal quality to do this edit as sudo /etc/modprobe.d/options. Do not be surprised if this file has no content!

Add the following line:

options dvb_usb_dib0700 force_lna_activation=1

Then save the file.

Whilst the latest 1.20 firmware resolves a number of problems, it also creates a problem in that the remote control functionality is broken (Nov 2008) and is still broken (Dec 2010). The Microsoft Media Centre (MCE) remote control and USB IR receiver do work and I’ll test these at a later date. In the meantime, you can use the keyboard.

Mythbuntu Control Centre (MCC)

Before we get started configuring the backend of Mythbuntu, there are a few settings I like to change in the MCC which is accessible by clicking on Applications > System > Mythbuntu Control Centre.

In Ubuntu – System > Administration > Mythbuntu Control Centre

By default (this should not be the default if using Mythbuntu in Ubuntu) MythTV Frontend automatically starts on system start-up. Whilst useful in use, it is a pain when you are trying to set things up so this is something I initially disable. To do this click on Startup Behavior and uncheck Automatically start MythTV Frontend.

Once set, click Apply.

An Apply Changes window will appear giving yo a summary of what is about to be changed. Click Apply.

You will be asked for a password, enter your login password set when installing Mythbuntu.

When this has been completed, click Quit.

General Backend Setup

This part of the tutorial is loosely based on this Mythbuntu Wiki page

We are now ready to configure the MythTV back-end. To do this , click on Applications > System > MythTV Backend Setup.

In Ubuntu – System > Administration > MythTV Backend Setup. You will be asked in a window titled Incorrect Group Membership to be added to the group "mythtv". You must click on Yes, enter your sudo password. You will then need to logout and then back in to Ubuntu for the changes to take effect.

You will be asked to confirm wither it is okay to close any running Mythbackend processes, click Yes.

In Ubuntu – You will be asked to Select your preferred language

If you get a message saying that Myth could not connect to the database, check that the password on the screen matches the one in /etc/mythtv/mysql.txt. If not change the on screen password to match the one in the file.

You will be asked for a password, enter your login password set when installing Mythbuntu.

The following screen will be displayed

Whilst in theory you can navigate using the mouse, the mouse pointer disappears when over the menu items which makes it rather difficult! So my preferred method is to use the cursor keys on the keyboard.

1. GENERAL

Select General and press Enter.

For our configuration, there is no need to change any of the settings, so press ALT-N on the keyboard to move to the Next page.

As I live in the UK, the Locale Settings page does need to be changed as follows:

TV format: change from NTSC to PAL

VBI format: change from None to PAL Teletext

Channel frequency table: change from us-bcast to eurpoe-west

In Ubuntu – change Your Local Timezone (for XMLTV) to Auto

The results should look like this screen-shot below

Press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Miscellaneous Settings page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the EIT Scanner Options page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Shutdown/ Wakeup Options page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Backend Wakeup settings page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Backend Control page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Job Queue (Backend) page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Job Queue (Global) page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Job Queue (Job Commands) page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the UPNP Server Settings page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Myth Database Logging page, so just press ALT-N on the keyboard to move to the Next page.

There are no changes to be made to the Mythfilldatabase page, so just press ALT-F on the keyboard to Finish and return the to main back-end set-up menu.

2. Capture cards

Select Capture Cards from the main menu. The following menu will be displayed:

Select (New capture card) and press Enter

Change the following settings:

Card type: DVB DTV capture card (v3.x)

DVB Device Number: /dev/dvb/adapter0/frontend0

press ALT-F on the keyboard to Finish and return the Capture Cards menu, you new card will be listed and should look like

As the Nova-T 500 has two DVB-T tuners, we now need to repeat for the second tuner

Select (New capture card) and press Enter

Change the following settings:

Card type: DVB DTV capture card (v3.x)

DVB Device Number: /dev/dvb/adapter1/frontend0

press ALT-F on the keyboard to Finish and return the Capture Cards menu, you new card will be listed and should look like

Press ESC to return to the main menu..

3. Video Sources

Select Video Sources from the main menu. The following menu will be displayed:

Select New video source and press Enter.

The Video Source setup screen will be displayed.

Change the following settings:

Video source name: Radio Times 1

Ubuntu ONLY: For an unknown reason, the Mythbuntu install in Ubuntu displays a slightly different screen and only provided EPG data via the EIT data which is transmitted with the DVB-T signal! For this reason this part of the instructions will differ for Ubuntu. The Mythbuntu set-up uses XMLTV.

Change the Listings grabber to Transmitted guide only (EIT). Then select Finish.

Now go to step 4 Input Connections

In Mythbuntu:

Listings grabber: change to United Kingdom/ Republic of Ireland (Radio Times) (xmltv)

Tick the check box Perform EIT Scan

Then by using the TAB key select Configure and press Enter

The following will be displayed

Select UTF-8 (Unicode) by entering 0

You will then be asked to enter the directory to store the listing cache, we will select the default which is /home/username/.xmltv/cache. Press Enter to accept the default.

The following message will be displayed

Select Enable title processing (default) by pressing Enter

Now enter the first part of your postcode e.g. NW10 and then press Enter

In our particular case, as the tuner is a DVB-T card we are only interested in Freeview channels, so we select option 1.

The screen will then fill with messages and you will then be given the following option

As it is not advisable to go through the process of selecting each channel, one at a time type all and press Enter

At this point, after waiting a minute to make sure all 425 channels are processed, press ALT-F on the keyboard to Finish to return to the Video source setup window and then press ALT-F again to return the Video sources menu. Now press ESC to return back to main back-end set-up menu.

4. Input connections

Select Input Connections from the main menu. The following menu will be displayed:

Select the first tuner card, the select source to input menu will be displayed. We will change the following:

Display Name: Tuner 1

Video Source: Radio Times 1

The the screen should now look similar to the screen-shot below.

We are now going to scan for available Freeview channels. Select Scan for channels, the Scan Configuration window will be displayed

65436543

Press ALT-N on the keyboard to move to the Next page. This will take you to the Scanning page and MythTv will automatically start looking for channels based on the criteria set.

Once the scanning has completed, you will get a message similar to that below

Select Insert all by pressing Enter and then follow the on screen prompts.

Once this has been completed, you will be returned to the Scan Configuration screen by selecting ALT-F.

Now press ALT-N on the keyboard to move to the Next page.

On the Interactions between Inputs screen, press ALT-F on the keyboard to Finish to return to the Input connections screen. It should now look like

If you wish you can configure the second tuner by repeating the above instructions, but this time DO NOT Scan for Channels, just click NEXT and then Finish.

Otherwise press ESC to return to the main menu.

5. Channel Editor

Change the Sort… order to Channel Number

Change Video… to Radio Times 1

Then select Icon Download and press Enter

Repeat until you get to Finish.

Click Finish.Repeat until you get to Finish.

Click Finish.

and choose Download all icons

Once all the icons have been downloaded, you will be the option to associate icons with channels with no associated icons. Follow the on-screen instructions.

You will then be returned to the Channel Editor window. Press ESC to return to the main menu.

6. Storage directories

We are going to omit this step, so press ESC to exit the MythTV Backend Setup

When prompted reply Yes to populate the MythTV database. In our case this will go to tv_grab_uk_rt and pull down the TV listings, this may initially take some time to complete.

If you are uncertain whether anything is happening, open up a Terminal and enter top.

tv_grab_uk_rt will probably be listed at the top of the list using 99-100% CPU. This is normal! Also listed will be mythfilldatabase and mysqld. Once mythfilldatabase has completed, cpu will drop back and all three processes will drop down the list in terms of CPU usage. At this point the mythfilldatabase window will close.

Testing the Configuration

We are now ready to test TV reception.

Launch the MythTV Frontend from Applications > Multimedia > MythTV Frontend

From the menu select Watch TV.

All being well, you should now get a TV picture and its associated audio. In addition you should also briefly see the EPG guide information for the current program.

1

You can change the channel numbers by using the numeric keypad on the PC

Final Tweeking!

Video Card Drivers

Whilst the open source nVidea graphics card drivers are good, the proprietary drivers offer better performance so my personal choice is to install these at this stage. they can be added in the same way as the DVB driver was added earlier (Applications > System > Additional Drivers). I always use the recommended driver.

Note: You can also do this through the MCC in Graphics Drivers.

MythTV Menus

I personally don’t like the default menu scheme. If you feel the same or just want to see what is available, launch the MythTV Frontend from Applications > Multimedia > MythTV Frontend, and then select Utilities/ Setup followed by Setup. The select Appearance.

The default theme is Mythbuntu (Widescreen), my preference is MythCenter!

Press ALT-N on the keyboard to move to the Next page.

Select Utilities/ Setup followed by Setup. The select Appearance.

On the screen settings page, uncheck the default Hide Mouse Cursor in MythTV.

Press ALT-N on the keyboard to move to the Next page.

On the Localisation page, change Language to English (British), you also wish to change the following:

  • Date Format
  • Short Date Format
  • Time format

Press ALT-N on the keyboard to move to the Next page and then again.

Press ALT-F on the keyboard to Finish to return to the main menu which will now change to you preference.

MythTV Frontend Desktop

I like a desktop which reflects the purpose of the PC, the plain grey desktop which ships with Mythbuntu is very drab! so I use a Test card wallpaper taken from here and set this as my desktop wallpaper.

Secondly, I like having a few regularly icons on my desktop:

  • MythTV Frontend
  • Exit

For the MythTV Frontend, create a new launcher by right clicking on the desktop and choosing New launcher. Enter mythfrontend and you should get some options displayed. Select the first one, then change the icon for the launcher. I use the following icon

and then increase the pixel size to 175 so it is nice and large on the desktop.

Finally, I add the Exit icon to the desktop in the same way.

In part 3 of this tutorial we will look at recording Freeview programs and getting the remote control to work.

=-=-=-=-=
Powered by Blogilo

Installing Mythbuntu 10.10 with a Hauppauge Nova-T 500 PCI DVB-T card – PART 1


Having the ability to watch as well as record Digital TV on a PC has always been something which I’ve found attractive, especially if you have a large screen monitor/ TV with at least a VGA/ DVI input.

One option is to take your normal Linux distribution like Fedora or Ubuntu and install something like MythTV

If you want to have a dedicated PC running as a PVR then there are a number of dedicated Linux distributions available:

  • Mythdora is based on Fedora and follows the Fedora development cycle. It uses MythTV.
  • Mythbuntu is based on Ubuntu Linux and comes in two forms. A Live CD which is installable and an add-on package for Ubuntu. It uses MythTV.
  • KnoppMyth originally based on Knoppix Linux the latest version is 5.5. However, development has ceased, being replaced by LinHES. It uses MythTV.
  • LinHES is based on Arch Linux and R6 is the current stable release, R7 is under development. It uses MythTV.
  • LinuxMCE is an open source add-on to Kubuntu to give it media-centre functionality. In addition it can be used to control your home including phones and lighting!

I’m going to use Mythbuntu 10.10. To be honest, I would have written this guide earlier, but have struggled to get to grips with the Mythbuntu and MythTv documentation which is best described as poorly maintained. Hopefully, this tutorial may help make sense of the official documentation!

Installation

Note: If you just wish to added to add it to an existing Ubuntu installation then follow these instructions and then follow the configuration instructions in this tutorial.

We are going to do a complete install, rather than just an installation to an existing Ubuntu based distribution. The first step is to download the Live CD which can be obtained from http://www.mythbuntu.org/downloads. It is recommended that you download the 32-bit version.

Burn the ISO to a CD and on the PC on which you wish to do the install, boot off the Mythbuntu 10.10 Live CD.

The above two screens will be displayed before the installation screen is displayed. Please note that you may see some error messages displayed during the boot process, do not worry!

Eventually the installation screen will be displayed, select your language e.g. English.

click Install Mythbuntu.

The following screen will be displayed.

Tick the check boxes for Download updates while installing and Install this third-party software.

Then click Forward to continue.

You will now be asked to create a partition in which to install Mythbuntu. In this tutorial we are going to use the whole hard disk, so we will select Erase and use the entire disk .

Then click Forward.

You will new be asked to confirm what you wish to do.

When you are happy click Install Now.

As with any Linux install you will need to specify your time zone.

Once done, click Froward.

Keyboard layout. Again click Forward when done.

Now enter your login credentials.

As this is a media centre PC, I leave it to login automatically.

Once set-up, click Forward.

You now need to decide whether you want to have a dedicated “back-end” server, basically doing all the recording and streaming of video/ TV or a Frontend or a Primary Backend with Frontend ( a combination of both).

For our installation we will go for a Primary Backend with Frontend.

Once selected, click Forward.

You are then asked what additional services you need installed. Samba and SSH are selected to be installed by default, but I always feel it is useful to install VNC as well in case you need to remotely manage the server using its graphical interface.

Once you have made your selections click Forward.

You are then given the opportunity to enable the Remote Control for your DVB-T card. Tick the check box Enable a Remote control, select the relevant remote, in our case the Hauppaugu Nova-T 500 and tick the check box Generate frontend restart mapping (Power followed by Clear).

When ready, click Forward.

Mythbuntu has now collected the information it needs and will commence installation.

Once installation has completed you will get the following window displayed. Click Restart Now to reboot the PC.

Your installation CD will be ejected and once removed, you will need to press Enter to continue the reboot.

On reboot the above screen will appear.

As MythTV has not yet been configured, press ESC and confirm to exit MythTV. The XFCE desktop environment will be displayed

In part 2 of this tutorial we will set-up our DVB-T tuner card to receive Freeview as well as the program guide (EPG) information through XMLTV.

=-=-=-=-=
Powered by Blogilo

FreeNAS Network Attached Storage Server – Part 3


In Part 1 I covered installing FreeNAS

In Part 2 I covered basic FreeNAS configuration, including adding disks

In Part 3 I am now going to cover some of the more advanced topics:

  • Setting up Software RAID
  • Users & Groups
  • File Management and the File Editor
  • Backing up your System Configuration

Setting up a Software RAID

NOTE:

In Parts 1 & 2 I had 256Mb of RAM configured for our FreeNAS server. If you are creating a software RAID, you will need to have at least 512Mb of RAM, otherwise you may experience unpredictable behaviour when creating the RAID.

FreeNAS supports many types of disk RAID Arrays including:

  • RAID 0
  • RAID 1
  • RAID5
  • RAID 0/1/5

See Wikipedia for more information on what each of these types of RAID offer in terms of protection against failure and performance.

JBOD is also supported but is not RAID, it stands for Just a Bunch Of Disks.

In addition to the drive FreeNAS is installed on, we have two hard disks in our FreeNAS Server which we are going to set-up as a Software RAID.

Follow the instructions in Part 2 in the section titled Adding Disks to FreeNAS, but before clicking Add, change the Preformatted file system to Software RAID. It should look something like the following screen-shot for the first disk which I’ve called Disk1. The choice of name is up to you!

Click Add and then repeat for the second disk, the Disks Management window should now look like the following

Click Apply Changes to put the disks online.

We are now ready to create our RAID.

From the menu bar select Disks > Software RAID. With RAID 1 selected (see screen shot below)

click on the + sign to create a RAID array.

Give the RAID a name, we will call it Disk in this example (see note later on).

Select the drives you want to be added to the array and then check the box titled Create and initialised RAID

Click Add. You will be taken to the previous screen where you newly created array is displayed.

Click Apply Changes. You should now get the following screen displayed

Note: in the following screen shot the RAID name was changed from Disk to RAD1

As we have chosen RAID 1 (disk mirroring) even though we used 2 x 2Gb hard disks, only 2Gb is available as usable storage. This is a feature of RAID 1.

The RAID Array now needs to be formatted.

From the menu bar select Disks > Format.

For Disk, select the RAID we have just created from the drop down menu.

Now give the volume a label, I this example we will call it RAID1

Now click Format disk to format the disk.

You will be asked to confirm your choice, click OK.

You will now see formatting information below the Format disk button similar to that below

Done! will appear once formatting has completed.

The final thing left to do is to mount the disk.

From the menu bar select Disks > Mount Point

Click on the + sign on the far right to add a new mount point.

Select the disk to mount in the Disk field and in the Mount point name field give it a name, we will call it DataRAID.

Click Add.

You should see the following in Disk Mount Point Management window

Click Apply changes to mount the disk.

To check the disk is mounted, click on System on the menu bar. You will see something like the following

Note: Although my ‘live’ FreeNAS server is a re-cased Compaq DeskPro EN Pentium 3 800MHz PC with 512Mb RAM, for this tutorial I created a Virtual FreeNAS server in Virtualbox. Hence the rather higher CPU specification!

With the disk mounted, you can now share it. Information on how to do this can be found in Part 2 of this series of FreeNAS articles.

Setting up RAID 5 is very similar, the difference is that at least three disks are required. Gary Sims, author of Learning FreeNAS which can be purchased online, has created a great video which you can view here on how to set-up RAID5 in FreeNAS.


Users & Groups

In Part 2 I touched upon creating a user account in the section Setting up a User Account to Remotely Access the Share. I will now cover this in a bit more detail in relation access permissions to Disk Mount points.

When you create a disk mount point, there is a section called Access Restrictions.

The defaults can be seen above, this is for my mount point called NASDisk1.

The owner is by default the account which created the mount point, normally Admin in FreeNAS. The Group, in this case wheel, restricts which group of users can access the mount point. The Mode section determines which collection of access permissions (Read, Write or eXecute) each category of user has, be it Owner, Group or Others.

From The FreeNAS menu bar select Advanced > File Manager and if asked to login login with your Admin account and password.

As FreeNAS runs FreeBSD, disk mount points are located in the /mnt directory. Open the /mnt directory by clicking on it.

On my FreeNAS server I have two disk drives and therefore two mount mount points, which like any Unix/ Linux OS take the form of a directory.

In the Perm’s column (short for Permissions) you will see the standard Unix Linux file permissions for the directory

Owner

Group

Other

r

w

x

r

w

x

r

w

x

r = Read w = Write x = eXecute

The above is prefixed with a ‘d’ if it is a directory, as with all PC operating systems, a directory is just a special type of file

Where permissions are absent, as in the following example for a file

the earlier table would look like the following

Owner

Group

Other

r

w

x

r

w

x

r

w

x

r

w

x

r

w

r

Which looks like this in File Manager

So, how does this all relate to users?

Well by default, if you create a directory using File Manager logged in as Admin, the default permissions are

drwxrwxr-x

When you create a user in FreeNAS, your primary group is Guest and no additional group is defined by default. Because your account is not the account which created the mount point i.e. Admin, you are therefore not the Owner and so Owner permissions do not apply.

As your account belongs to the Group guest, the Group the mount point belongs to is wheel, therefore Group permissions do not apply which means your account falls into the Other category. In this case this only allows you to Read and eXecute files but does not allow you to write!

There are two ways round this problem:

Either:

A. Change the mount point to it’s group matches that of the user, or better still change the group membership of the user to match the mount point. So make the user a member of the group wheel..

Or:

B. Login to File Manager with the account with which you wish to access the shares remotely, in this way that account is the owner of the directory and therefore has rwx access by default.

Note: It would not be advisable, for security reasons to change the permissions for Other to Write unless you were confident that allowing write access to all users was not going to be a problem, now or in the future.

For more information on Linux/ Unix file system permissions see Wikipedia

File Management

As we have already touched on File Management, it is worth covering it a bit more although there isn’t a massive amount to cover as it is mainly self explanatory.

The File manager supplied with FreeNAS is QuiXplorer which is a simple web based file manager.

You can:

  • create, copy, move and delete files and directories
  • change file and directory permissions
  • browse the FreeNAS file system
  • search for files
  • change users permissions

The last item is probably the most interesting as you can manage user passwords, set whether the user can see hidden files and the level of permissions they have for managing users. An account can also be disabled from this option.

File Editor

Also in the main FreeNAS menu under Advanced is the File Editor, which allows you to browse for a file, Load it, edit it and then Save it. It is by no means advanced, but a useful addition to the toolbox should you feel brave enough to edit FreeNAS configuration files directly!

Backing up your System Configuration

Whilst it is great ‘tweaking’ your FreeNAS system configuration either via the menus or directly using the editor, mistakes do happen and things can go horribly wrong, So it is worth while to backup your system configuration on a regular basis.

From the main menu, click on System > Backup / Restore. The following screen will be displayed.

Click on Download configuration, this will allow you to save your configuration file locally to your PC. It will not save it to the FreeNAS server disks for obvious reasons!

To restore your configuration, browse to where your backup file is stored and click on Restore configuration.

Finally, if all else fails, rather than re-install FreeNAS you can reset the server back to Factory defaults by selecting System > Factory defaults.

Use with care and best to backup your configuration before resetting.

In part 4 of this article, I’ll be looking at e-Mail notification and some of the additional services FreeNAS can run like BitTorrent, which I had to leave out of this article due to space!

=-=-=-=-=
Powered by Blogilo

Using Clonezilla with FreeNAS or Network Share to Backup a Hard Disk


If you’ve used Symantec Ghost http://en.wikipedia.org/wiki/Symantec_Ghost or Acronis True Image http://en.wikipedia.org/wiki/Acronis_True_Image then you will know how useful they are for making images of computer hard disks. Great for backing up all your data or even for disaster recovery. The down side is they are both expensive programs to buy and for us Linux users, not free (as in beer or as in speech).

Clonezilla http://en.wikipedia.org/wiki/Clonezilla is in my view as good as, if not better than, the closed source competition and is highly regarded by IT professionals. I use Clonezilla regularly to image PCs before doing a distribution upgrade and I image both Linux and Windows partitions. I also use it for backing up hard disk and for migrating data between disks. For the latter I use Clonezilla along with GParted Live http://gparted.sourceforge.net/livecd.php. to resize partitions after the cloned image is restored to a new (larger) hard disk.

Because it runs from a ‘live’ CD (ISO image obtainable from http://tinyurl.com/c2myn8) and will read most hard disk formats including NTFS, Clonezilla is OS agnostic. It can backup at partition level to another hard disk or to a USB hard disk, and as we shall see it can also back up to a network share, or in our case to a FreeNAS storage server*.

*See my earlier blog posts on installing and configuring FreeNAS http://preview.tinyurl.com/2eglwrm and http://preview.tinyurl.com/2978jqv .

Cloning a Hard Disk

Insert the Clonezilla ‘Live CD’ and boot the PC off the CD.

The following menu will be displayed.

Select the default option, and press the Enter key. Clonezilla will boot.

Eventually displaying the following “choose language” screen.

Select your language, then press the Enter key.

The “configuring console data” screen will appear

Accept the default and press the Enter key.

You will now be given two options, as we don’t want the command prompt, choose the default option Start Clonezilla and press the Enter key.

You will now get a screen asking if you wish to work with images or clone from one physical disk to another (duplicate). Choose the device-image option and press the Enter key.

You will now be asked where you are going to save the image to, as FreeNAS runs Samba, we will choose samba_server.

Press the Enter key.

Note: If you are not using FreeNAS, but are instead saving to a Windows or Linux Samba share, then you would still select this option.

You will now be asked to set-up a network IP address for Clonezilla so that it can connect to the network share.

As we have a DHCP server (in my case it is my DSL router) I’m going to select dhcp.

Press the Enter key to continue.

Once Clonezilla has obtained an IP address from the DHCP server, you will be asked for the IP address of the Samba server which contains the file share you wish to connect.

In my case the address is of the FreeNAS server is 192.168.1.252, yours is probably different.

Once you have entered the address, press the Enter key to continue.

You will be asked to provide the domain name, if you don’t have a domain name set you can leave this blank. In my case mine is called workgroup.

Press the Enter key to continue.

You will now be asked for a username to connect to the FreeNAS server, the offered name is Administrator. Replace this with a valid username for your network share. In my case I have a username of fernsm1 set-up on my FreeNAS server.

Press the Enter key.

You will then be asked for the destination directory, and will be offered the directory name of /images. Replace this with the name of your network share and the directory within that share you wish to save the image in to.

In my case this is /NASDisk1/images, remember that Unix and Linux operating systems are case sensitive. So if the share name is in upper case, make sure you write it in upper case!

UPDATE: 15/12/10

You can also enter the share name. So in my example the Samba/ CIFS share name is /DiskImages and you just enter what I’ve put in bold text. You may find this more reliable than specifying the actual path.

When done, press the Enter key.

The following screen will be displayed. This is a summary of what you have entered so far, and warns that you will now be asked to enter the password.

Press the Enter key.

At the bottom of the screen the following will appear.

The above is the command string being used to connect Clonezilla to the share.

Type in your password and press Enter.

If the following will be displayed, this means that Clonezilla has successfully connected to the FreeNAS server/ network share. if you get an error message at this stage, check the share name and/ or username/ password and start again.

Press the Enter key.

You now need to select the mode you wish to run Clonezilla in, a list of choices will be displayed

As we are creating an image of the PC, we will use the savedisk option. Select and press the Enter key.

You will then be asked for a name to give the image. By default Clonezilla gives a unique file name based on the date and time. When you have give a file name for the saved image, press the Enter key to continue.

You will now be asked to select the hard disk on the PC which you wish to clone. If you only have one hard disk, just press the Enter key. Otherwise use the cursor keys and space-bar to select/ deselect a disk..

You will now go through a number of screens offering “advanced extra parameters”. Accept the defaults on all.

Once completed, Clonezilla builds a command string should use wish to use it again without having to go through all the menus. In our case it should look similar to the following

Press the Enter key to continue.

Clonezilla will now start the cloning process, telling you what it is about to do and giving you the option to cancel.

If you are happy with the summary it provided, press y followed by the Enter key to continue.

Clonezilla will check the file system of the source PC to ensure okay and determine the cloning method it will use before it starts to clone the hard disk. If satisfied, it will then commence the cloning process.

Once the disk has been cloned, you will see something like this

Congratulations, you have successfully cloned your PCs hard disk to your FreeNAS network share.

Pressing Enter, will give you an options menu:

  1. Poweroff
  2. Reboot
  3. Enter command line prompt
  4. Start over

Warning: The default is option 2.

 

=-=-=-=-=
Powered by Blogilo

FreeNAS Network Attached Storage Server – Part 2: Configuration


In Part 1 we installed our FreeNAS Server on an old PC gathering dust in the corner of the office. In my case this is a Pentium III 800MHz Compaq Deskpro EN tower, maxed out with 512Mb of RAM and a Promise PCI SATA/ IDE card to manage large 250Gb+ hard disks. For FreeNAS this is quite a high spec PC as it can run with 256Mb RAM and a Pentium II CPU!

In Part 2 we are going to configure this PC into to a fully fledged NAS Server.

Configuring FreeNAS Server

Changing the Admin Password

This is the first thing we need to do, now the server is up and running.

From the FreeNAS menu bar, click on System > General and select the Password tab. Your old password is already entered for you, so enter your new password (twice) in the fields provided.

When done, click Save.

The following message will be displayed.

Note:

If you wish you can also change the username from Admin to something else, this can be done from the General tab under WebGUI section. In the Username field enter the name of the username you wish to use, go to the bottom of the page and click Save.

Set-up the File Sharing Service (CIFS/ SMB)

From the FreeNAS menu bar, click on Services > CIFS/ SMB.

Note:

SMB http://en.wikipedia.org/wiki/Samba_%28software%29 and CIFS http://en.wikipedia.org/wiki/Cifs allow Unix/ Linux, Apple OSX and Windows PCs to access the share.

Tick the Enable check box (top right of screen)

Scroll to the bottom of the screen and click on Save and Restart.

The screen should refresh and you should see

Adding the Disk(s) to FreeNAS

From the FreeNAS menu bar, click on Disks > Management, the following screen will be displayed

As we are adding a disk, click on the + symbol on the right.

Now from the Add window, click on the drop-down in Disk field, this will display all your “disk” devices including removable media, like my DVD ROM drive. FreeBSD (Unix) labels disks differently to Linux. ATA type disks (IDE/ SATA) are prefixed with ‘a’, followed by ‘d’ short for disk, CD devices are followed by ‘cd’. A number is allocated for each device, and the device information read to help you identify which device you are selecting.

In the above example, ad1 is a 8Gb IBM hard disk of which 128Mb was allocated to FreeNAS in part 1, the rest is available to use. The remaining ad devices are a 250Gb Hitachi SATA hard disk (ad6) and a 300Gb Maxtor IDE hard disk (ad8). We will select ad6 as our first disk to mount.

As I don’t wish my disks to spin when not in use (it’s good to try to save energy when setting up a NAS box), I’m going to set the Hard disk standby time to 10 minutes.

I’m also going to activate S.M.A.R.T. Hard disk monitoring as I will not be using a software RAID disk in this NAS configuration as I want to maximise my available disk space. Tick Activate S.M.A.R.T monitoring for this device.

Click Add to save the settings, you will be returned to the Disk Management screen. An information box will advise you to click Apply to apply the changes to the disk. Once clicked, the disk status will change from initialising to ONLINE.

Under the File System column, you will notice that the disk is showing as unformatted.

Format the Disk

To format the disk, from the FreeNAS menu bar select Disk > Format.

In the Disk field, select the disk you wish to format, in our example only one is listed because only one disk has been added to FreeNAS.

Give the disk a Volume label, this will be used to identify the disk. In our example, I’m calling this disk NAS1.

The completed screen should look like the following

As you will notice, I’ve headed the warning at the bottom of the screen and have kept the default UFS (Unix File System). You are now ready to format the disk, so press Format disk. You will be asked to confirm, click Okay.

The disk will be formatted and the lower half of the screen will fill the output of the format command (sets of random numbers). Once formatting has completed the word Done! will appear at the bottom of the list.

From the FreeNAS menu bar, click on Disks > Management, under the File System column, you will notice that the disk is now showing a UFS file system.

Mounting the Disk

Although the disk is online, and formatted it is not available to use as it has yet to be mounted. To mount a disk from the FreeNAS menu bar, click on Disks > Mount Point.


Click on the ‘+‘ sign on the far right, as you are going to add a disk. In the Mount Point Add screen, in the Disk section under Settings, select the hard disk you have just formatted. Now give it a Mount point name, I’m going to call it in this example NASDisk1.

If you wish you can also give it a description, in the description filed below.

Likewise, you can set the normal Unix/ Linux Read Write and eXecute permissions for different groups of users, set the owner, default is always root (administrator), and add the disk to a group. For our purposes, we will leave this as per the defaults.

See completed screen below

Click Add, you will be returned to the Mount Point Management window, where the disk will show a status of initialising. Click Apply Changes, the disk will be mounted and the status will change to OK.

Whilst in the window, you may notice there are two other tabs, Tools and Fsck. The former allows you to mount or umount (unmount) a disk and the latter which stands for File System Check is used to check the consistency of the Unix/ Linux file system, similar to chkdsk in DOS/ Windows.

Sharing the Disk

From the FreeNAS menu bar, click on Services > CIFS/ SMB. Click on the Shares tab, we are now going to share the disk so that it is available to access over the network.

Click on the ‘+‘ sign on the far right, as you are going to add a share.

Give a Comment for the share, this can be anything useful.

Give the share a name e.g. NASShare1.

In the Path field, you are now going to create the share. Click the browse button, a window similar to the following should appear

NASDisk1 is the mount point for the disk we created earlier. Click on it to select, and then click Okay.

The resulting screen should look something like

Click Apply changes.

You have now created your share on the network.

Accessing the Share over the Network

Now browser the network for the samba share using your file manager:

For Linux

In KDE Dolphin, or in GNOME Nautilus you can either browse your network for the Samba share or enter smb://192.168.1.252/NASShare1/ .

It is also possible to automatically mount a Samba share, for more information see https://help.ubuntu.com/community/SettingUpSamba .

For Windows

Open Windows Explorer or Start > Run and enter \\192.168.1.252\NASShare1.

As we have not set-up security on the share, no password is required, and therefore you should be able to browse you FreeNAS share, add and remove files.

You have now set-up your FreeNAS server Samba share.

Setting up a User Account to Remotely Access the Share

Whilst you can get away with having no user account set-up for remote access to the share, some programs expect a user account. One of them is Clonezilla, which I will be using in my next blog to image up a PC to the FreeNAS server.

To set-up the user account

From the FreeNAS menu bar, click on Access > Users and Groups. Click on the ‘+‘ sign on the far right, as you are going to add a new user.

In the Name field, enter the login name for this account.

In the Full Name field either give the users full name or a description of the purpose of this account

In the Password field, enter a password, (twice)

When complete click Add.

The above screen will appear, click Apply changes. You have now created an account to remotely access the share.

In Part 3, I will be looking at configuring some of the other more advanced features available in FreeNAS, including setting up a software RAID and configuring FreeNAS as a Bittorrent server.

=-=-=-=-=
Powered by Blogilo

FreeNAS Network Attached Storage Server – Part 1: Installation


The appeal of having a Network Attached Storage “box” on the network is great if you wish to have a central place to store your data. However, NAS boxes are expensive starting around £100 and going up to £600 for a Drobo and that’s before you add the hard disks.

If you are like me, you probably have a PC sitting in the corner looking for a new use, and wouldn’t it be great to turn it into a NAS server, and a FTP server and download bittorrets with it….. Well your can, and using FreeNAS you can have it all for free!

In my case this is a Pentium III 800MHz Compaq Deskpro EN tower, maxed out with 512Mb of RAM and a Promise PCI SATA/ IDE card to manage large 250Gb+ hard disks. For FreeNAS this is quite a high spec PC as it can run with 256Mb RAM and a Pentium II CPU!

FreeNAS is an open source Linux distribution based on FreeBSD http://en.wikipedia.org/wiki/FreeNAS. It works as a preconfigured "software appliance". Like any appliance, it needs to be set-up and this is mainly done through a very user friendly web interface.

The following instructions will walk you through installing FreeNAS.

FreeNAS can be downloaded from http://freenas.org/downloads.

Installing FreeNAS Server

Boot off the FreeNAS CD, you will get a boot menu with a countdown timer, allow the PC to boot with the default boot option.

Once booted you will get a menu similar to that below

Select option 9) Install/ Upgrade to hard drive/ flash device, etc.

You will be presented with a number of options as FreeNAS can be installed on a variety of different types of media including USB memory sticks.

We are going to choose option 3 ‘full’ OS install to HDD (Hard Disk Drive), the following will be displayed.

Press enter to confirm.

You will then be asked to select the CD ROM drive the FreeNAS CD is in. Select the drive and press enter.

You will now be asked to select the hard disk on to which to install FreeNAS. Again select the drive and press enter.

The FreeNAS installer will ask you to set the size of the FreeNAS partition

Select the default (128Mb) and press enter.

On being asked about whether you would like a swap partition, select No.

The FreeNAS CD ROM will now be mounted and FreeNAS installed.

Once the installation has completed, you will get a message similar to the following

When you press enter, you will be returned to the Console Set-up menu.

Configuring the Network Interface

Select option 2 Set LAN IP address

You will be asked the following

You now have two options:

Option 1 (If you select Yes): DHCP allocated IP Address

The advantage of DHCP is that you don’t have to worry about configuring the IP address, this is by far the lest technical way of setting up the server and works well if you don’t plan to turn it off.

If you select this option, you will then be asked if you wish to configure the network interface for IPv6. For most people, the answer will be No (default). Press enter, after a few seconds you will get a something similar to the following:

This tells us that the FreeNAS server has an IP Address of 192.168.1.66 and the web interface can be accessed by entering http://192.168.1.66:80 in a web browser. The :80 means that the website will be accessed on port 80.

Pressing Enter returns yo to the main menu.

Option 2 (If you select No): Fixed IP Address

If you answer No, you will be asked to enter your own IP address. Make sure that the first three sets of numbers correspond to your network address range. To check open terminal and enter ifconfig. You should see something similar to the following

Enter the first three sets of numbers which make up the inet addr e.g 192.168.1 and then enter the final number which must be available to use. If uncertain, from terminal enter ping followed by the full IP address you wish to use. If you get the Message “Destination Host Unreachable” then it is unlikely that that IP address is being used. Press CTRL+C to terminate the ping.

Enter the fixed IP address you wish to use.

Select OK and press enter.

You will now be asked to enter the subnet mask using CIDR (Classless Inter Domain Routing) http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing notation

The easiest way to work out this two digit number from your subnet mask which in our example we got 255.255.255.0 from doing an ifconfig (see above) is to use a online calculator. I use http://grox.net/utils/whatmask/ which is simple to use.

Enter the IP address, and press Go, you will get something similar to the following

In this example the CIDR number is 24. Enter it and select OK.

You will now be asked to enter your default Gateway, this is normally 254, so in this example you would enter 192.168.1.254.

You will next be asked for a DNS IP address. Unless you are running your own DNS server, leave this black and select OK. Other wise enter your DNS server IP address.

You will then be asked if you wish to configure the network interface for IPv6. For most people, the answer will be No (default). Press enter, after a few seconds you will get a something similar to the following

This tells us that the FreeNAS server has an IP Address of 192.168.1.120 and the web interface can be accessed by entering http://192.168.1.120:80 in a web browser. The :80 means that the website is being accessed on port 80.

Pressing Enter returns you to the main menu. You are now ready to login

Logging in to you FreeNAS Server

On a network attached PC, open a web browser and enter the ip address 192.168.1.120:80.

The following login screen will be displayed

Enter the following login credentials:

Username: admin

Password: freenas

The FreeNAS home page of you server will now be displayed

You have successfully installed your FreeNAS server.

In Part 2, I’ll be looking at configuring FreeNAS and mounting your storage so it is accessible from other computers.

Linux Hell – Via Southbridge VT8251 SATA II Controller – PART 2!


I wrote in February http://tinyurl.com/2vm3vy6 about the very poor Linux support for the VIA VT8251 SATA 2 controller on my ASUS A8V-VM SE motherboard and how I got it to work with my SATA hard disk and DVD/RW drive using pci=nomsi. The original Laubnchpad bug report can be found at http://tinyurl.com/29hglgf.

Unfortunately in the Linux world, what gets fixed does not always remain fixed and with regular Kernel updates the honeymoon can be short!

It all started just over a month ago at the start of March, just after kernel 2.6.31-17-generic was released. I thought my DVD-RW drive was having issues with burning DVDs, turing half dozen into coasters!

What would happen is the disk would be partly burnt and then K3B would fail, rendering the disc useless. The LG DVD drive was SATA and so was the 300Gb data hard disk being used as the source disk. The OS boots off SCSI. I added post #23 to http://tinyurl.com/33ectgj

This weekend I swapped the drive to another PC with a different chip-set (nVidia) and make of motherboard (Gigabyte). The LG drive worked flawlessly. The replacement DVD drive on the ASUS A8V-VM SE motherboard was also LG but this time IDE. On the nVidia based PC this worked perfectly and although it worked well on the VIA VT8251 PC, it was very very slow.

KSystem kernel log revealed the problem:

2010-04-25 16:42:12

[ 1705.688583] ata3.00: exception Emask 0x10 SAct 0x0 SErr 0x580100 action 0x6 frozen

2010-04-25 16:42:12

[ 1705.688589] ata3.00: irq_stat 0x08000000, interface fatal error

2010-04-25 16:42:12

[ 1705.688594] ata3: SError: { UnrecovData 10B8B Dispar Handshk }

2010-04-25 16:42:12

[ 1705.688604] ata3.00: cmd 35/00:00:1f:59:fa/00:04:16:00:00/e0 tag 0 dma 524288 out

2010-04-25 16:42:12

[ 1705.688605] res 50/00:00:1e:59:fa/00:00:16:00:00/e0 Emask 0x10 (ATA bus error)

2010-04-25 16:42:12

[ 1705.688609] ata3.00: status: { DRDY }

2010-04-25 16:42:12

[ 1705.688615] ata3: hard resetting link

2010-04-25 16:42:13

[ 1706.212549] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

2010-04-25 16:42:13

[ 1706.332620] ata3.00: configured for UDMA/133

2010-04-25 16:46:34

[ 1968.012445] ata3.00: limiting speed to UDMA/100:PIO4

2010-04-25 16:46:34

[ 1968.012457] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x180000 action 0x6 frozen

2010-04-25 16:46:34

[ 1968.012467] ata3: SError: { 10B8B Dispar }

2010-04-25 16:46:34

[ 1968.012484] ata3.00: cmd 35/00:00:9f:e2:81/00:04:17:00:00/e0 tag 0 dma 524288 out

2010-04-25 16:46:34

[ 1968.012486] res 40/00:00:6e:08:7b/00:00:17:00:00/e0 Emask 0x4 (timeout)

2010-04-25 16:46:34

[ 1968.012493] ata3.00: status: { DRDY }

2010-04-25 16:46:34

[ 1968.012520] ata3: hard resetting link

2010-04-25 16:46:35

[ 1968.540878] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

2010-04-25 16:46:35

[ 1968.644397] ata3.00: configured for UDMA/100

2010-04-25 16:46:35

[ 1968.644424] ata3: EH complete

2010-04-25 16:49:14

[ 2128.010067] ata3.00: limiting speed to UDMA/33:PIO4

2010-04-25 16:49:14

[ 2128.010078] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x180000 action 0x6 frozen

2010-04-25 16:49:14

[ 2128.010088] ata3: SError: { 10B8B Dispar }

2010-04-25 16:49:14

[ 2128.010104] ata3.00: cmd 35/00:00:47:a5:8a/00:04:17:00:00/e0 tag 0 dma 524288 out

2010-04-25 16:49:14

[ 2128.010107] res 40/00:00:3e:9d:8a/00:00:17:00:00/e0 Emask 0x4 (timeout)

2010-04-25 16:49:14

[ 2128.010114] ata3.00: status: { DRDY }

2010-04-25 16:49:14

[ 2128.010123] ata3: hard resetting link

2010-04-25 16:49:15

[ 2128.542591] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

2010-04-25 16:49:15

[ 2128.634875] ata3.00: configured for UDMA/33

2010-04-25 16:49:15

[ 2128.634907] ata3: EH complete

The VT8251 SATA controller was experiencing errors and falling back to a lower bus speed until it reached the minimal of UDMA/33, where it stuck and repeatedly had the same error until the operation completed. Having experimented with disk to disk file copies I have confirmed that this is most likely a bug which was not previously present and for which appears to have no work-around. Removing pci=nomsi from GRUB ends up with the SATA hard disk not being detected!

I think this is now the last straw, I’ll going to ditch this motherboard for something more Linux friendly! I’ll no longer use ASUS AMD 939 motherboards (lost all the USB ports on an AMD 939 nVidia based board the other week) or VIA based motherboards, just too many hardware compatibility problems. No wonder Google only use Gigabyte motherboards in their server farms!

UPDATE 2/5/10:

I had a spare ASUS A8V-VM SE motherboard using VIA K8M890 / VIA VT8237A chipsets. SATA works fine, so does USB (so far).

Currently testing under Kubuntu 10.04 stable!

How to Configure the Conky System Monitor


1. Introduction

On Kubuntu I use a plasmoid for monitoring key system performance indicators like CPU Temperature, CPU Performance, Network traffic and memory usage. In GNOME you can use gDesklets http://www.gdesklets.de/ which are supposed to be the equivalent of KDEs Plasmiods. However, a more popular option is to use the light-weight system monitor called Conky http://conky.sourceforge.net/.

My preference is for Conky, lightweight, flexible and powerful. Its one downside is that it can be a pain to set-up unless you are given a helping hand. Hopefully, this blog will be of some assistance!

2. Installing Conky

As well as needing Conky installed, you also need to install lm-sensors http://www.lm-sensors.org/ which are the hardware monitoring sensors.

A. Install LM-SENSORS

To install lm-sensors enter from terminal:

sudo apt-get install lm-sensors

Now configure the sensors by entering:

sudo sensors-detect

Reply yes to all questions including the last one to insert the detected sensor modules into /etc/modules.

Now test what is being detected by entering:

sensors

This will display all detected sensor devices

B. Install Conky

To install Conky enter from terminal:

sudo apt-get install conky

From the root of your home drive, create a file in your favorite text editor called .conkyrc

Note the preceding period in front of the file name which makes this file hidden.

Below is my modified version of the Pengo script. Select the text and copy it into a file called .conkyrc. and save it in the root of your Home directory.

Alternatively, you can download a copy from here , again saving it in the root of your Home directory.

# UBUNTU-CONKY

# A comprehensive conky script, configured for use on

# Ubuntu / Debian Gnome, without the need for any external scripts.

#

# Based on conky-jc and the default .conkyrc.

# INCLUDES:

# – tail of /var/log/messages

# – netstat connections to your computer

#

# — Pengo (conky@pengo.us)

#

# Create own window instead of using desktop (required in nautilus)

own_window yes

own_window_type override

own_window_hints below

# Use double buffering (reduces flicker, may not work for everyone)

double_buffer yes

# fiddle with window

use_spacer yes

use_xft no

# Update interval in seconds

update_interval 3.0

#Maximum Width of Window

maximum_width 320

# Minimum size of text area

# minimum_size 250 5

# Draw shades?

draw_shades no

# Text stuff

draw_outline no # amplifies text if yes

draw_borders no

font arial

uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?

stippled_borders 3

# border margins

border_margin 5

# border width

border_width 6

# Default colors and also border colors, grey90 == #e5e5e5

default_color FFFFCC

own_window_colour brown

own_window_transparent yes

# Text alignment, other possible values are commented

#alignment top_left

alignment top_right

#alignment bottom_left

#alignment bottom_right

# Gap between borders of screen and text

gap_x 10

gap_y 10

# stuff after ‘TEXT’ will be formatted on screen

TEXT

$color

${color CC9900}SYSTEM ${hr 2}$color

$nodename $sysname $kernel on $machine

${color CC9900}CPU ${hr 2}$color

AMD Athlon(tm) 64 Socket 939 X2 Dual Core CPU 4200+

Total CPU: ${cpu cpu0}%

${color 597DB2}${cpubar}$color

${cpugraph 000000 597DB2}

Core 1: ${freq 1} MHz Temprature: $color ${exec sensors|grep ‘Core0’|awk ‘{print $3}’}

${cpu cpu1}% ${color 597DB2}${cpubar cpu1}$color

Core 2: ${freq 2} MHz Temprature: $color ${exec sensors|grep ‘Core1’|awk ‘{print $3}’}

${cpu cpu2}% ${color 597DB2}${cpubar cpu2}$color

NAME PID CPU% MEM%

${color CCFFFF}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}

${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}

${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}

${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}$color

${color CC9900}MEMORY ${hr 2}$color

RAM Used: ${mem} RAM Free: ${memfree}/ ${memmax}

RAM: $memperc% ${color FF6600} ${membar 6}$color

Swap: $swapperc% ${color FF6600} ${swapbar 6}$color

${color CC9900}DISK ${hr 2}$color

sdc5 ${fs_type} (Root): ${fs_free_perc /}% ${color FFFF33} ${fs_bar 6 /}$color

sdc1 NTFS (Data): ${fs_free_perc /media/data}% ${color FFFF33} ${fs_bar 6 /media/data}$color

${color CC9900}NETWORK (${addr eth1}) ${hr 2}$color

Down: $color${downspeed eth1} k/s ${alignr}Up: ${upspeed eth1} k/s

${downspeedgraph eth1 25,140 000000 ff0000} ${alignr}${upspeedgraph eth1

25,140 000000 00ff00}$color

Total: ${totaldown eth1} ${alignr}Total: ${totalup eth1}

Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768

61000 count}${alignr}Total: ${tcp_portmon 1 65535 count}

${color CC9900}LOGGING ${hr 2}$color

${color 339900}${execi 30 tail -n3 /var/log/messages | fold -w50}$color

3. Running Conky

When you are ready, either press <ALT>+<F2> and enter conky or from terminal enter conky. Either way, Conky will run based on the configuration of your .conkyrc file you saved earlier.

4. Customising Conky

Two useful tables detailing the syntax of commands used in the .conkyrc file are available from theConky website

Config Settings http://conky.sourceforge.net/config_settings.html

Config Variables http://conky.sourceforge.net/variables.html

For ACSII colour codes see http://html-color-codes.com/

The .conkyrc configuration file is split into two sections:

  • Section 1 – General Configuration: This is text between # UBUNTU-CONKY line and # stuff after ‘TEXT’ will be formatted on screen
  • Section 2 – System Monitoring Parameters: This is text after # stuff after ‘TEXT’ will be formatted on screen onwards!

Section 1 – General Configuration

These lines detail the general layout, colours, size and behavior of the Conky window. Reference the Config Settings link above for more information.

The elements which I found useful for setting up my display were:

maximum_width 320

Sets the maximum width of the window. Height is variable depending on the number of lines of information you display.

default_color FFFFCC

Sets the default colour of text, in this case to Light yellow, See the ACSII colour code table link above for more colour codes

own_window_colour brown

Sets window background colour, this can be a name of a colour or ASCII colour code

own_window_transparent yes

Makes the background transparent or not (yes or no), depends on the colour of your wallpaper whether this is useful. On the default Ubuntu wallpaper it was unhelpful as the text colours merged with the background.

own_window_type override

Stops the Conky window disappearing when you click on the desktop! Highly recommended!

Section 2 – System Monitoring Parameters

This is laid out in the order it will be displayed in the window. So the first element is

$[color ######} text xyz $color

This sets the colour of the preceding text and the text colour is reverted back to the default colour (set by default_colour in section 1) with $color

In our example each section is grouped, the first one is SYSTEM which is preceded with ${hr 2} this sets the height of the line, this has already been set to light brown by the color command.

If you want to enter text to be displayed as part of the window content, you just enter it as normal e.g. AMD Athlon(tm) 64 Socket 939 X2 Dual Core CPU 4200+. Anything not prefixed with a $ is treated as text.

The horizontal positioning of the text can be done either with the <TAB> key or the <space-bar>. Vertical spacing is done by pressing the <Enter> key.

Using the Config Variables (see link above) you can probably work out the rest of the code in the file, with one exception!

Whilst most CPUs can be read using acpixxxxx variables e.g. acpitemp to read the CPU temperature, AMD CPUs can not be read in this way as they use k8temp-pci-00c3 http://www.mjmwired.net/kernel/Documentation/hwmon/k8temp.

You would have established when configuring LM-SENSORS if the k8temp sensor was being used on your motherboard. As you would have had a result like

8temp-pci-00c3

Adapter: PCI adapter

Core0 Temp: +35.0°C

Core1 Temp: +30.0°C

The lines

Core 1: ${freq 1} MHz Temprature: $color ${exec sensors|grep ‘Core0’|awk ‘{print $3}’}

Core 2: ${freq 2} MHz Temprature: $color ${exec sensors|grep ‘Core1’|awk ‘{print $3}’}

in .conkyrc are used to display the core temperature results which are obtained from the temp1 and temp3 files located in /sys/bus/pci/drivers/k8temp/0000:00:18.3.

I’ve now explained the essentials necessary to getting started in creating your own customised Conky display. Hopefully, the rest of the code in .conkyrc should now be more meaningful.

TIP: When making code changes, copy and paste the code you wish to change below the old code. Modify the pasted version, save and reload Conky from terminal.

5. Automatically Running Conky at Boot

If you want to automatically load Conky every time yo run Ubuntu, then you will need to write a short script to delay Conky starting immediately on boot, otherwise you will get a shadow behind your Conky Window.

The script looks like

#!/bin/bash

#Conky start-up delay script

sleep 20 && conky;

A copy of the script can be downloaded from here.

The sleep 20 parameter causes the script to wait 20 seconds before conky is started. I’ve found on my PC that a 10 second delay is sufficient.

I would recommend you create a scripts directory in the root of your home drive and save it in it with a meaningful name like conky_delay_start.

Having created and saved your script, you now need to change it from a plain text file in to an executable text file.

From the scripts directory enter

chmod 755 conky_delay_start

to make the script executable.

Now to get the script to run on boot-up, add it to Preference > Start-up Applications like so

Restart your PC and Conky will load automatically.

=-=-=-=-=
Powered by Bilbo Blogger

Upgrading Dell C640 from Kubuntu 9.04 to 9.10: How to Recover the Upgrade when it Fails!


Last November I upgraded my trusty C640 to Kubuntu 9.10, only to bottle out post upgrade when I realised the on-board ATI Radeon Mobility M7 video card had a bug causing window display corruption.

With Kubuntu 10.04 due out in a few months and finding the a solution http://tinyurl.com/ydk88cr for last years aborted upgraded, I decided to try again.

Problem 1: Refused to Upgrade to 9.10

Kubuntu refused to recognise a distribution upgrade was available, either graphically or via the command line using sudo apt-get dist-upgrade.

I think this might have been due to a recent bug-fix which corrected the GRUB menu, for some unknown reason was showing Kubuntu 8.10 instead of 9.04.

Using the Alternative CD I instigated the upgrade by entering the following from terminal:

sudo mount -o loop ~/Desktop/ubuntu-9.10-alternate-i386.iso /media/cdrom0

Problem 2: Broken Upgrade

I use a wired Ethernet connection when doing upgrades, I don’t trust wireless as it can be unreliable at times, mainly when you need it. As part of the ISO upgrade, I confirmed that I wanted updates from the internet.

Part way through the upgrade I started getting errors about certain OpenOffice deb packages missing from the Alternate CD. As these were not core to the OS working I continued the upgrade. There were a number of related errors and eventually I got a “Upgrade Failed” message, asking me to reboot to recover.

However, I noticed the restart icon had appeared in the plasmoid notification area, so a pretty good indication that the core OS was sound and any problems would be with secondary packages. So instead of doing a restart, I opened up Terminal and entered:

sudo apt-get update

followed by

sudo apt-get upgrade

and was told that I had broken packages, so ran the following

sudo apt-get -f install

then did an upgrade which installed any missing packages (mainly OpenOffice).

As an insurance policy, I re-ran the upgrade process again to make sure nothing had been missed. The laptop was then rebooted and Kubuntu 9.10 loaded, really quickly!

Problem 3: Broken ATI Graphics

This was a known problem, and I had the fix. The only thing to change was replacing GDM (Gnome Desktop Manager) with KDM (KDE Desktop Manager) to adapt it for Kubuntu rather than Ubuntu.

Window corruption with older ATI graphics cards

With older ATI graphics cards with 32MB or less of video RAM some corruption of direct rendered windows, for example OSD notifier windows, might appear. This may be worked around by disabling ‘RenderAccel’ in the Xorg configuration. (426582)

To do this first exit to the console using the following command:

*

sudo service gdm stop

Then create an Xorg configuration file with the command below:

*

sudo Xorg -configure

Then add the ‘RenderAccel’ option to /etc/X11/xorg.conf:

*

Section “Device”

Driver “radeon”

Option “RenderAccel” “off”

EndSection

And restart X/GDM.

sudo service gdm start

It worked, one reboot and all was fine.

Problem 4: KNetworkManager

Just when I thought it was all fixed, I then tried my wireless connection. It could see the network, but just could not connect.

Because of previous problems under 8.10 with KNetworkManager not always loading successfully on boot, I had added it to AutoStart. I removed this from Autostart and rebooted. KNetworkManager loaded and asked for my wireless access encryption code. Once entered, it connected without a problem.

KNetworkManager has been totally rewritten since 9.04, so it might work reliably. Stranger things have happened!

Conclusion

Despite the above problems, some of which may be unique to my laptops configuration, I think the upgrade to Kubuntu 9.10 was worth it. The whole laptop seems faster and graphics more responsive.

I eagerly look forward to Kubuntu 10.4, hopefully Pulse Audio may start working for a change.

=-=-=-=-=
Powered by Bilbo Blogger