Monday, 13 June 2016

Linux RAID-1 [1]

Well I have made a start on testing the RAID configuration for my main PC. After looking at various scenarios, the one that fits the closest is incorporated into the documentation at this site:

In addition the following was referenced for some of the initial setup steps:
In order to make a start I have already (at install time) set up two partitions of identical size (320 GB each). This was done using a 320GB and a 500 GB disk. The 500 GB disk was further partitioned to produce the swap partition and the full install partition (mount point /) for the Linux Mint install for this computer. Mint was installed and I am now working in the Mint installation to set up the RAID-1. The partitions are /dev/sda2 and /dev/sdb1.

Referring to the second reference document (linuxconfig.org) we work through section 3, install mdadm, then section 4.1, loading kernel modules. In other words we are having raid-1 and md modules loaded by adding lines for them to /etc/modules file. Then the system is rebooted to get the modules loaded. Doing a cat /proc/mdstat now reveals that we have RAID-1 support loaded.

We then go to the first reference document (raid.wiki.kernel.org) and go to section 1.5.3 to create a RAID-1 array. In this case the command looks like

sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda2 /dev/sdb1

The next step after the command completes is to look at /proc/mdstat again and read the output, which tells us that the raid-1 array has been created and gives an estimate of how long the initialisation will take to complete. In my case I have also opened the Disks applet from the Mint menu to take a look at how the new disk shows up there, and it appears categorised as a RAID array with all the right information and gives me a graphical representation of the syncing process. At this stage I elected to use the GUI to format the new drive and name it, and then was able to mount it even though the rebuild isn't yet complete. It therefore appears as a new 320 GB volume in the filesystem, but doesn't have any special standing because it hasn't been mounted within the regular filesystem tree of the installation.

Once the initialisation is complete there is one more step and that is to save the RAID configuration. After switching into SU mode (by issuing the command su) we can run the following:

mdamd --detail --scan >> /etc/mdadm/mdadm.conf

The reboot that followed proved that the volume was recognised again on startup. 

Now that we have our RAID running, the next issue to be tackled is how to relocate /home. In the case of my real world system, this relocation will have to occur twice. Firstly, /home will have to go temporarily to another disk, and secondly, after creating the RAID-1 array, /home then gets moved back on the new RAID volume. Here is some documentation I have looked at so far:
For the test I will put some data in place to be copied across from the existing location within the install partition.

For the real thing I need to undertake some steps as follows:
  • Run a full backup, probably not using the Windows based backup but a native Linux one on a removable disk.
  • Find a disk from somewhere to be the temporary home of /home and put it into the removable drive bay of the main PC.
  • Move /home from the internal drive to the removable drive
  • Set up the RAID-1 array using the two internal disks.
  • Move /home from the removable drive to the new RAID-1 array.
So that will gradually happen over the next few weeks, depending on how long it takes to run my test case on the demo machine.

More Mint and a system monitor applet

After playing with a lot of Lubuntu systems I have started to prefer Mint where enough memory is installed because it is often easier to install higher spec apps like Qgis. Lubuntu is really good for a lower spec system which doesn't get used for more than internet stuff and I really recommend it for general use but if you are a power user with some grunty apps then you will find that Mint is easier to install some of these apps on. Google Earth is another example. I could not get it to install on Lubuntu without a lot of hacking and trying various things and the failed attempts also removed a lot of Lubuntu base install applications. I eventually restored most of them manually.

So yes Lubuntu is great and highly recommended but if you have 8 GB or more of memory, even on what is a very old Conroe system that I use at work (at least 8 years old), Mint will go really well and make it easier to install power user applications.

Since I put Mint onto that old Conroe I have struggled to find a system monitor applet to put into the panel. I also have decided one of my screens will have two panels with the one at the top of the screen displaying the clock, system tray, launchers, status icons, workspace switcher and the aforementioned system monitor applet. The one that I finally found that works very well is called System Monitor and its UUID is sysmonitor@orcus. This was after I had tried quite a few that Cinnamon didn't like and disabled. You can find it in the list of available applets (online) that is in the add applet dialog box when you right click and select add applets to the panel. Be aware that you need to install a couple of dependencies and should do this in a terminal before you tell Mint to install System Monitor. The packages you need to install are:
  • gir1.2-gtop-2.0
  • gjs
Whilst it will work with only the first package installed, the second one is needed to change options for the graphs it puts into the taskbar. These graphs look like the ones that are in the system monitor applet that is included with Lubuntu and that is the look I was trying to get from a Mint applet as all I really need to see are a couple of boxes displaying the CPU load and memory usage so that I can tell when the system is really bogging down. It is actually quite surprising how much more performance you can get by increasing the RAM to 8 GB. This old Conroe can do that much memory because it has four slots. I remember my old Intel G41 system which is actually newer (the Conroe is a Intel Q35 system) being limited to 4 GB of RAM because it had only two slots. That system was really an object exercise in getting the right balance between price and performance. Most of the decisions I made such as buying LGA775 right at the end of that architecture, a Celeron CPU (Wolfdale-3M) and a board with only two DIMM slots were bad decisions in hindsight as the result is a system that has fallen well below useful after only three or four years, now struggling through its sixth year of life. Every system I have built since (with the exception of a couple of embedded mini-ITX Atom boards, and their replacement AMD E350s) has been specced for at least 8-16 GB of RAM with four slots, and the Pentium G is my preferred CPU for domestic use, being functionally equivalent to a Core i3 except for disabled hyperthreading.

I am now setting up one of my two AMD E350 board systems (Gigabyte GA-E350 WIN8) as a Mint testbed. What I need to do with it as a very high priority is to work out how to add RAID-1 to my Main PC at home as this has the disks but it was not set up when I installed or since because there are no nice GUIs unlike Windows. In other words I will probably have to move /home off the disk it is on to a disk that goes into the removable drive bay, then configure the RAID-1 and then migrate /home back to the RAID-1 array. So that is what the testbed is for. After I have finished with that it will become a Windows 10 testbed so I will have a Windows 10 computer in the house after all. But it will only be used for testing easyworship to start with.

The retreat from Lubuntu has now been completed with the second AMD E350 (identical motherboard to the other) also being installed with Linux Mint. But I continue to have a pen drive dedicated to the Lubuntu64 installer, and use it on some virtual machines. As I have stated above it is a great system for 4 GB or less of memory; once you are able to get as high as 8 GB, its advantages are no longer so clear cut because the CPU spec or speed is not so significant when such a large amount of RAM is installed. The second AMD E350 is in my workshop and will have a wireless connection to another network. It is being used primarily for work related to that network, which is not very much work at all at the present time. But hopefully the wireless connection will work well. I have had sooo much fun with a little Edimax nano adapter supposedly rated to 150Mbps which seems to be able to get real-world about 5Mbps on my home Wi-fi. So using another wireless antenna I have here I hope to be able to get a much faster speed. Well indeed I eventually tested with a much better Edimax solution, a wireless 802.11ac USB adapter with a big aerial on it. It turns out to be at least 5-10 times faster particularly on a 802.11ac network.

Another thing I am trying on my two work PCs is using Chrome instead of Chromium. Since it turns out Google makes a release of the full Chrome product for Linux alongside Chromium which is the open source part of the Chrome package. The newest one also has Firefox Developer installed from a source other than Ubuntu Make, which I could not find to install. I got FFDE from the Mozilla site instead. Once it is extracted you need to copy the firefox folder to somewhere, for example /opt (with root privileges needed) and then make a firefox-dev.desktop file for the menu entry which you put into ~/.local/share/applications where the Cinnamon menu thingy will pick it up automatically. The contents could look something like this (the firefox folder has been renamed to firefox_dev):

[Desktop Entry]
Name=Firefox Developer 
GenericName=Firefox Developer Edition
Exec=/opt/firefox_dev/firefox
Terminal=false
Icon=/opt/firefox_dev/browser/icons/mozicon128.png
Type=Application
Categories=Application;Network;X-Developer;
Comment=Firefox Developer Edition Web Browser.

This has worked just as well as the Umake version.

Thursday, 9 June 2016

Windows / Android

Well the Windows 7 computer has been set up and is doing a great job of running Windows 7 instead of 10. Of course MS will try to phase out Win 7 support as soon as they can so when that happens I will have to try to work out what I am going to do with it because of my very strong feelings about subsequent versions. I may be pushed onto 8 or 8.1 but it may well be the case that the support for these versions doesn't last a whole lot longer. I also support on a voluntary basis a Win7 computer next door so I am not sure how well this computer can transition to Win10 or later in the future. A big issue for that computer is that it has Intel Skylake architecture, which while being a great advance on its predecessor for speed and so forth, only has support from MS on Win7 for a limited period. MS naturally wants to push everyone using such a late architecture onto 10. But then there are the other issues with 10 that make it less suitable for a projection computer for example. At least on Win7 Enterprise you don't get the annoying "Install Windows 10" popups and enticements that people have been scammed with by MS on other editions of 7. People in the IT industry I know or work with seem to get asked quite often how to uninstall Windows 10 because they have been tricked into installing it without awareness of its differences.

In the phone area I am about to purchase my second Android phone, the Samsung Galaxy J2. The main thing I am attempting to achieve is to get a phone that has more than 4 GB of onboard storage. In Android there are many apps, particularly the built in Google/Android ones, that can only install into the onboard storage. Since the Moto E running Lollipop can only make 2.2 GB available for installs, it has filled up all this space long since leaving me with only a few extra apps I can use and I run into problems every time I get an app upgrade or want to add some new app. Ideally of course 16 GB would guarantee no more problems ever but there is a big leap in price to 16 GB, the only models I can see are the Galaxy A3 at $549 which is way too dear. In other words I should have thought that the extra cost of the Galaxy J5 over the J2 would have brought more memory whereas in actuality Samsung has decided the extra $100 is to be expended on a bigger screen and 13 megapixel camera. It will be interesting to be buying a phone that has a front camera for the first time and the most annoying limitation of the Moto E phone has been its fixed focus which has often resulted in blurry photos. I have elected to buy the phone outright and not be locked into a contract for two years to pay for it as well as keeping the special terms of my current contract (a big data allowance) which was a one off special and is not currently available in general although in a practical sense there are similar plans at similar or slightly cheaper prices considering the amount of talk time and data I actually use on it.