Adding a second hard disk
Some time ago we were given a ex-schools computer and we installed Fedora on it. It only had an 80GB disk so eventually I added an extra hard disk, 160GB.
This computer continues to work well although I had to replace the motherboard with an identical old model bought on ebay (so that I could use the same processor and memory - because the specification was fairly good.)
Since the Fedora installation used LVM it was simple to add the new disk and extend the disk space available. It was quite a while since I did this but I think my notes explain the method OK. If you follow them do check the man pages for the relevant commands.
Starting by partitioning the extra disk using fdisk. This can all be done on the existing operating system.
The scheme I created was
/dev/sdb1 500MB Primary Partition
/dev/sdb2 Extended partition 120GB
/dev/sdb5 40GB Logical partition
/dev/sdb6 40GB Logical partition
/dev/sdb7 39GB Logical partition
pvcreate /dev/sdb5 /dev/sdb6 /dev/sdb7
vgextend volume-group /dev/sdb5 /dev/sdb6 /dev/sdb7
(where volume-group was the one originally created on the 80GB disk)
The existing logical volumes can be checked using lvdisplay. e.g. The home logical volume would be /dev/volume-group/home and root would be /dev/volume-group/root
Now extend the logical volumes to use the new physical volumes. The -r option resizes the underlying filesystem at the same time.
lvextend -r /dev/volume-group/home /dev/sdb5
lvextend -r /dev/volume-group/root /dev/sdb7
lvextend -r /dev/volume-group/home /dev/sdb6
(I know two of these lines apply to the home logical volume - it's just the way I did it!)
Activate the changes:
vgchange -a y
Check your changes with vgdisplay and lvdisplay
19th September 2014 John Williams
CA0106 Sound Card Fault
Following the installation of the latest Fedora operating system (i.e new kernel, poss new drivers) my CA0106 sound card stopped working properly. One channel could not be heard. When I listened on headphones there was no sound to the right ear. It was too coincidental that the sound card should have developed a fault at that moment, even though when I switched to onboard sound (the built-in sound from the motherboard) everything worked well.
When I opened the Pulse Audio Volume Control (the program that lets you switch between onboard sound and the sound card) it did not show any fault.
But entering "alsamixer" in a terminal was more productive.
Press F6 to select sound card
Press F3 for playback
Use right and left arrows to select the channels you want (analogue, center, forward etc.)
All the analogue settings in my case showed a suitable default level for the left speaker but the right were all set to zero. I suppose a bug in the driver for this card sets the levels incorrectly. Entering 'man alsamixer' in a terminal shows you can change the levels for left and right independently.
[Q | W | E ] -- turn UP [ left | both | right ]
[Z | X | C ] -- turn DOWN [ left | both | right ]
After making the levels of left and right equal the CA0106 sound card worked as it should.
18th September 2014 John Williams
I've been using korganizer for a number of years now. Apart from a few hiccups it has been reliable, useful software. Backing up used to a case of keeping a copy of an .ics file but with the introduction of Akonadi things changed.
Akonadi is a storage service for the KDE Personal Information Manager allowing data to be written to and accessed easily from a database.
So now backing up korganizer is a matter of using the backup provided by Akonadi.
Start the Akonaditray program.
Right-click the icon > Click "Make Backup".
In the same menu you will see "Restore Backup" (which you might need one day :)
When akonadi was new and I was upgrading my Fedora operating system I had to manually install akonadi-mysql (yum install akonadi-mysql (as root)) to get akonadi to work with my saved files.
This also works for MariaDB.
17th September 2014 John Williams
Resize Root Volume
My computer started telling me the space left on the root logical volume was critical (1.1GiB space left). When I originally installed Linux on this 500G disk my idea was to divide it in two and have two different installations. I never did get around to doing the second install but for some reason I made the root volume on the first install 50GiB which over time has filled up.
In a terminal
showed information on the volume group containing the root logical volume.
The line "Free PE / Size" showed that the volume group had 44GiB free which could be used to extend the root logical volume. (Maybe I saw this coming?)
I suppose I could have run the installation DVD, selecting Troubleshooting and working on the unmounted filesystem using the command prompt but the way I tried was to boot into single user mode from the GRUB menu.
On other occasions I've used systemd parameters to change the way the system boots but this time when the grub menu showed I pressed 'e' to edit the kernel parameters, found where it says 'rhgb quiet' and replaced those two words with the word 'single'.
Following grub's instructions I pressed F10 to boot. Grub said it was booting a command list and the boot started in text mode. There was an opportunity to enter the LUKS passphrase for the system and we got to "Welcome to rescue mode. Give root password for maintenance."
According to the man page the command I needed was:
lvextend -L +40G --resizefs /dev/volumegroup/rootlogvol /dev/sda2
-L is the size option. Dont' forget the + to specify how much extra space is needed. --resizefs expands the filesystem to fit the new logical volume. The next part identifies which logical volume to extend. Insert your volumegroup name for volumegroup and your lv name for rootlogvol. The last part identifies which physical volume to locate space on.
Well I was told /dev/sda2 could not be found. Afterwards I thought I should have used /dev/mapper/luks-265218etcetc which is the physical volume name given by pvdisplay or I could have tried the PV UUID 6Q3h37-VXFG-elxz-etcetc.
Anyway, what I did do was run the command again without /dev/sda2 on the end because there was only one physical volume that the command could use:
lvextend -L +40G --resizefs /dev/volumegroup/rootlogvol
A few seconds later everything was finished. I looked at
and the root volume group was given as 90GiB.
In the past, when working with volumes I always finished with the command:
vgchange -a y
which just tells the kernel to activate all volumes. And that's what I did. I rebooted and now there is lots of space for the root filesystem.
14th March 2014 John Williams
phpMyAdmin on local computer
On remote cpanel servers I backup databases using phpMyAdmin. Having just created a localhost database on a desktop computer I wondered how it was possible to use phpMyAdmin with it.
yum install phpMyAdmin.noarch
Then open a browser and type
A prompt asks for username and password. Since in the previous post I created a root mysql password these will be 'root' and the created password. (If you hadn't created a password you would just press enter.)
10th March 2014 John Williams
Localhost Website and Database
I design website content using httpd and php on a local linux computer (also viewing the site on a Windows® computer which is on the local network). When all is well I upload the new files to the remote server.
This method has been very practical until I needed to add content from a Simple Machines Forum to a website's homepage. Following the guide on the smf mod site I needed to add:
<?php require("SSI.php"); ?>
as the very first line of the homepage code (where SSI.php is the correct path to the SSI.php file.)
Then somewhere on the same page I had to have an include containing:
<?php ssi_recentPosts($num_recent = 6); ?>
The result of this is a list on the home page of the 6 most recent posts in the forum.
Now, I like to finish up with identical files on the local computer and the remote server. I would never remember to add these lines of code every time I uploaded the files to the server, but as you would expect the file would not work on localhost with those lines of code on the page. Trying to load the homepage on localhost just gave me an error message about installing smf.
So I thought it would be interesting to have an installation of Simple Machines Forum on localhost so that my homepage code could be the same on the local and remote machines.
My desktop Fedora installation has MariaDB installed as it is totally open source - it works like mysql. In a terminal I typed as root:
systemctl enable mariadb
systemctl start mariadb
Then to check
systemctl status mariadb
At this point I restarted the local computer although it was probably OK just to restart httpd, the apache server.
I copied the original smf installation files to an identical directory on the local computer. Navigating to the forum directory started the installation process. Installation had to be stopped because I hadn't done any work on the database.
As root I ran:
answering yes to everything.
Initially there is no root mysql password - just press enter then set the root password.
Then connect to the MySql database (localhost) with password:
mysql -h localhost -u root -p
Create database and database user.
MariaDB[(none)]]>CREATE DATABASE dbname;
MariaDB[(none)]]>CREATE USER 'dbuser' IDENTIFIED BY 'userpwd';
MariaDB[(none)]]>GRANT ALL ON dbname.* TO 'dbuser';
Using the database information the installation of Simple Machines Forum and the creation of an Admin account went ahead easily. I now have a working Forum on localhost which I could use to test any changes, but the primary result is that local website files are identical to those on the remote server once again (the databases don't need to be the same).
10th March 2014 John Williams
Eclipse / Java Problem
Just spent an afternoon trying to get eclipse to start on one machine. On similar machines eclipse is working OK. The eclipse error message said that there was no Java Runtime Environment JRE or Java Development Kit JDK at the usual location. Although the required Java was installed it wasn't showing up as installed.
It could relate to a selinux bug some time ago that produced yum errors during package updates. I thought I had reinstalled all the faulty packages. Anyway I reinstalled Java and Eclipse, deleted the config in /home/username/.eclipse and removed the 'workspace' folder -- but I still got the same error about Java, and eclipse would not start.
I finally found a fix in fedoraforum.org involving 'alternatives'.
In a terminal do:
The result included the following entries:
java auto /usr/lib/jvm/java-1.7.0-openjdk-188.8.131.52-184.108.40.206.fc20.x86_64/jre/bin/java
jre_openjdk auto /usr/lib/jvm/java-1.7.0-openjdk-220.127.116.11-18.104.22.168.fc20.x86_64/jre
'auto' shows that the entries will be updated to the latest versions but the versions shown were actually NOT
the latest installed. (Maybe this was caused by the above mentioned yum update errors.)
So as root enter:
alternatives --remove java /usr/lib/jvm/java-1.7.0-openjdk-22.214.171.124-126.96.36.199.fc20.x86_64/jre/bin/java
alternatives --remove jre_openjdk /usr/lib/jvm/java-1.7.0-openjdk-188.8.131.52-184.108.40.206.fc20.x86_64/jre
Doing this allowed alternatives to be updated correctly and cleared the problem for eclipse. Now eclipse opens with no complaint about java.
21st February 2014 John Williams
Some software programs include a password generator to give us a suitably complicated password, but there are lots of occasions when we need to invent a password ourselves. We are often reminded not to re-use the same password as that in itself can be a security hazard.
One easy way to generate passwords is to use 'pwgen', available from linux repositories.
For example install using:
su -c 'yum install pwgen'
Then enter root password.
pwgen will give you passwords ranging from those you have half a hope of remembering to those which are impossible to remember. Of course complicated passwords are usually written down somewhwere ....
for all the options, allowing you to pick your own level of security.
As an example, in a terminal you could type:
pwgen -y 12
This will give you a screenfull of passwords to choose from, each 12 digits long. The -y option includes at least one special character such as a tilde or curly bracket etc.
14th February 2014 John Williams
Opening Publisher Documents
From time to time people send me Microsoft Publisher (.pub) documents but I don't have the Publisher program to open the file. If the document is a poster I have asked them to save the file as an image (.jpg or .png) instead. This has worked fairly well in the past. When the occasion made it necessary I used a free online conversion utility http://www.zamzar.com/fileformats/pub which gave a file I could then open and edit.
With LibreOffice 4.0 came a Publisher filter to convert .pub files to a format that can be opened. I got a chance to test this recently when I received a .pub file by email.
Using File > Wizards > Document Converter
in LibreOffice I was given a dialogue to choose Documents or Templates then to enter the source and destination folder locations.
When converted the document became an Impress Presentation (like powerpoint) with 4 pages that could be edited and saved. I had to do some adjusting (tabs - I think - needed altering) but at least I got a file that could be opened, read and edited with the minimum of fuss.
The Publisher filter is relatively new in LibreOffice and the developers welcome feedback to help them improve its capabiliies even more. http://www.libreoffice.org/
9th February 2014 John Williams
Resizing multiple images
I had to reduce the size of a group of images so I copied all the required pictures to a new folder. Using the terminal I changed to the new folder.
Imagemagick comes installed with every Fedora desktop. The command to use for multiple images is 'mogrify'.
mogrify -resize 450x450 *.jpg
This changes every file in the folder with the jpg extension so that the maximum dimension of each image becomes 450pixels. Other files are ignored. Note that if some filenames have an uppercase extension e.g. JPG you will need to repeat the command to resize them. i.e.
mogrify -resize 450x450 *.JPG
7th February 2014 John Williams
Using Fedora 20
I've been using Gnome 3 Classic since installing Fedora 20 (and previous to that) getting used to that way of working with the desktop and Nautilus file manager. I suppose Gnome 3 looks good, especially when it is displaying all the application icons, but for every functional use I have depended on the Gnome Shell extensions or switching things to work in a preferred way using dconf or the Gnome Tweak tool. I can't say I like working with the minimal appearance of Nautilus.
On another computer Gnome 3 started mistaking the size of my screen so that the Dash on the left (where all the Favourites Icons are displayed in a vertical line) was so big that it disappeared off the bottom of the screen so the Applications Icon at the bottom of the column could not be seen.
Changing the size of the icons or the spacing in CSS didn't help. I managed to find posts which described the exact same problem - just a bug to be fixed.
I thought I would try the Cinnamon Desktop and I installed it with yum. Lots of dependencies were installed along with the Nemo file manager.
This setup is so refreshing and practical. It is quick to use and Nemo is great. I'm going to carry on using Cinnamon and Nemo for everyday work on several machines and see how well it all works in the long-term.
7th February 2014 John Williams
The Fedora Project has now reached version 20. If you would like to know more about Free Open Source Software and about Fedora in particular, please have a look at http://fedoraproject.org/wiki/Overview
The release can be downloaded free from the Fedora site or may be purchased from one of the commercial companies who sell it on DVD or CD at low cost. (See the panel below entitled 'Distributions on DVD and CD.')
7th February 2014 John Williams
When wanting a RAID array to protect your data against hard disk failure (e.g. running two hard discs, one being an identical copy of the other) then there are a couple of options available. If using RAID with the array controlled by the BIOS you should select the installation option relating to special storage setups. Fedora will then treat the array as a single hard disk. If your BIOS does not support RAID you can use software RAID, implemented by the operating system. Just select 'Custom' when asked how you wish to install Fedora and create a RAID array for your hard disks. You should create a pair of 500MB partitions for Boot, formatted as ext4, and another large pair of partitions for the rest of the operating system. The Logical Volume Manager can then create logical volumes for swap, root and home.
7th September 2011 John Williams
Distributions on DVD and CD
You need a good Internet connection to download a full distribution (operating system and other software) to your computer prior to burning it to DVD or CDs.
For convenience, especially if you are trying several different distributions, you can buy ready-made DVDs or CDs. For example at http://www.thelinuxshop.co.uk/
Fedora on DVD costs just £6.49 including postage in the UK and there is a wide choice of distributions available. Not a bad price for a complete computer operating system and associated software.
29th December 2009 John Williams
Things for your Windows
Over the years I've collected links to a great group of essential, popular programs, most of which are free to download and use indefinitely.
You will probably know a lot of these and maybe you are using some already, but this collection is all on one convenient (long!) page to save people hunting around the Internet. Pssst ... pass it on.
They are tried and tested programs and most of them have been around for ages. All are available for Windows operating systems and even the Linux shop link has some Open Source software CDs for Windows.
8th April 2009 John Williams