Thursday, 2 April 2026

Migrating Nextcloud to OpenSUSE 16.0

Migrating my Nextcloud instance to OpenSUSE 16.0 is not totally transparent since the 16.0 makes a number of key changes - namely replacing yast with a mixture of myrlyn (for Software Management) and cockpit (for other management tasks), and replacing AppArmor with SELinux.  

So here goes...

First of all, the new installer for OpenSUSE, agama, is still a bit rough round the edges. While a bit more up-to-date in the looks department, and probably easier to use for a novice, it has a few design issues. If you don't want the standard setup, it's not entirely clear what to click on to edit which installation settings. Sometimes it's a button, sometimes a menu, sometimes a non-highlighted clickable bit of text. In that respect the old installer was rather better. 

Anyway, I wanted to not use BTRFS this time just so the Nextcloud console didn't show me the same repeated details for every subvolume since OpenSUSE creates them in abundance. Since I rsnapshot the vital parts of the volume daily I'm not risking much. 

So, logging this somewhat on-the-fly as I do things...  

  1. Install with LAMP and Desktop profiles
    1. ...and discover cockpit isn't installed
    2. ...and discover updates aren't installed (unlike the old installer) 
  2. Run myrlyn and install updates
  3. Run myrlyn and install cockpit, and cockpit-client-launcher
    1. Discover a weird broken dependency incompatibility with busybox-hostname
    2. Solution is to select the "deinstall busybox-hostname" option
    3. systemctl enable cockpit.socket 
    4. systemctl start cockpit.socket 
    5. Edit application menu to move cockpit client launcher from the Internet section to the System section because that bugs me
  4. Run myrlyn and install the various PHP dependencies that Nextcloud needs
  5. Tweak /etc/php8/apache2/php.ini and /etc/php8/apache2/php.ini to meet Nextcloud requirements (see link above)
  6. Fire up cockpit client launcher and start+enable apache and mariadb
  7. Run mysql_secure_installation to clean things up and set a secure root password
  8. Run the commands to set up the nextcloud user and database:
    CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
    CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    GRANT ALL PRIVILEGES on nextcloud.* to 'username'@'localhost';
  9. Run the command the restore the Nextcloud database backup
    mysql -h [server] -u [username] -p[password] [db_name] < nextcloud-sqlbkp.bak
  10. Restore /srv/www and /srv/data directories from backup
  11. Edit /etc/sysconfig/apache2 to make sure the modules ssl, headers and rewrite are included, and it starts with the SSL option
  12. Restore /etc/apache2 from backup - includes vhosts definitions and ssl details
  13. Run myrlyn and install certbot, and cerbot-systemd-timer
  14. Restore /etc/letsencrypt from backup 
  15. Tweak SELinux to allow webserver write access to nextcloud directories 
    semanage fcontext -a -t httpd_sys_rw_content_t '/srv/data(/.*)?'
    semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/htdocs/nextcloud/config(/.*)?'
    semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/htdocs/nextcloud/apps(/.*)?'
    semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/htdocs/nextcloud/.htaccess'
    semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/htdocs/nextcloud/.user.ini'
    semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/htdocs/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
  16. Update restored Nextcloud files to match SELinux policies
    restorecon -Rv '/srv/www/htdocs/nextcloud/'
    restorecon -Rv '/srv/data/'
  17. Allow web updates (slightly naughty)
    setsebool -P httpd_unified on
  18. Go into cockpit and add ports 80 and 443 to the firewall rules 
  19. Allow PHP jit to work
    setsebool -P httpd_execmem on 
  20. Allow other Nextcloud functions to work
    setsebool -P httpd_can_network_connect on
    setsebool -P httpd_can_sendmail on
  21. Restore /etc/cron.d from backup and restart the service
Got to learn more about SELinux than I wanted! The hope is now I have the requisite policies configured, I can just copy the selinux config folder in future. That's probably hoping for more stability and consistency than is realistic.

Tuesday, 7 February 2023

Restoring NextCloud to a New OpenSuse build

I have been running my Nextcloud instance on OpenSuse 15.3 which has reached EOL, so it was time to upgrade. Unfortunately, something went awry with the in-place 15.3->15.4 upgrade resulting in a trashed btrfs filesystem. Fair enough, not a problem, I have tiered backups using rsnapshot on a separate volume which include not only the Nextcloud www and data directories but also /etc for good measure. Before each rsnapshot run, I also mysqldump a copy of the Nextcloud database into the top of the data directory.

This time, unlike previous OpenSuse+Nextcloud builds, I'm not going to install the official Nextcloud package since it's always an older verion. I can just plonk the backup copy into /srv/www/htdocs and be done with it. I chose the LAMP server pattern for my OpenSuse install, restore the backup directory, and reload the database into MariaDB. All very simple but it ain't working, so what have I missed?

  1. Set permissions on the restored files. They should be owned by wwwrun and be chmod 750
  2. Apache config (you can use the Yast sysconfig tool for this),
    1. Add ssl, rewrite and headers to the modules list in sysconfig
    2. Make sure Apache is started with SSL option
    3. Restore the /etc/apache2 config directory from backup so it has vhosts and SSL config correct 
  3. PHP config (I'm still with PHP 7 at this point)
    1. Make sure all the Nextcloud PHP module dependencies are installed
    2. Install php-apcu and php-cli
    3. Edit PHP config as outlined in my previous posting to enable opcache, apcu and up the memory limits.
  4. Cron config
    1. Restore /etc/cron.d from backup
    2. Change permissions on all the files to 644
  5. Letsencrypt config (seems to be installed be default in the 15.4 LAMP pattern)
    1. Restore /etc/letsencrypt from backup
  6. Networking
    1. Make sure hostname and IP address are set so that SSL certificates work externally
    2. Open firewall ports for http and https

If you remember these then the rebuild takes maybe an hour. A lot of this is restoring files - I'm using SSD's so if you are stuck with HDD's this might be rather longer.

Another trick is that OpenSuse 15.4 now offers a downloadable updated ISO image which includes patches. This speeds up the install a fair bit.

Sunday, 22 January 2023

Running KVM VM's as a regular user on OpenSuse 15.4

 Things you need to do to allow a regular user to use virt-manager for VM's

  1. Add user to the following groups: kvm, libvirt, qemu
  2. These bits let regular users redirect USB devices to a VM...
    Add the line: org.spice-space.lowlevelusbaccess     yes:no:yes
    to: /etc/polkit-default-privs.local 
  3. After this run: /sbin/set_polkit_default_privs
  4. Add the line: usr/bin/spice-client-glib-usb-acl-helper  root:root  4755
    to: /etc/permissions.local
  5. After this run: chkstat --system --set
Credit to simon at serverfault

Wednesday, 23 March 2022

Shoehorning Duallies - A Slightly Bigger Build

 


My previous compact dual cpu builds were based around the (now long discontinued) Coolermaster Elite 360 and motherboards that were more or less ATX sized - or SSI CEB which is a little deeper at 10.5 inches rather than 9.6. At 147x380x410mm (WxHxD) the case comes in at 22.9 litres in volume and had two 5.25" bays and two 3.5" bays which provided ample room for storage (and judicious routing of cables). However, those were sold off a while ago.

Looking to reduce my power consumption a bit, now that utility bills are rising, I decided to consolidate my desktop and server machines into a single unit running Linux/KVM. This would need to be quite a beefy unit but I don't want anything too big. Shopping around, I came across the Kolink KLA-002 at overclockers.co.uk which looked rather interesting. At 175x410x385mm (WxDxH) and 27.6 litres, this case is about an inch wider than the Elite 360 but can fit an EATX motherboard with some adjustment. It's also dirt cheap so I'm happy taking a drill to it.

It looks like there are two optical bays up top but the upper bay is blocked by the front panel buttons etc. moulded into the top of the front cover. You could mount an internal drive or two there but I am going to tuck the extra length of the PSU cables in there to keep things neat. 

There are two 2.5 inch mounts on the base plate in front of where an ATX motherboard would fit - however, these would be blocked by an EATX motherboard. There are screw holes at the bottom left of the case to fit either a 3.5" HDD or a 120mm fan (albeit with a fairly restrictive grill). 

There are also two 3.5" drive bays at the bottom right which will need to be removed to get a larger motherboard in. It is possible to slide a board in behind the drive bays but you risk damaging components and reaching any connectors there is impossible. 

To remove it you need to drill out 5 rivets (arrowed). Two on the bottom edge, two under the front cover and one on the base. They can easily be replaced by a screw and a nut if you want to reinstate the bays later. 

Once the bays are removed there is space for an EATX motherboard with some caveats. There are only standoffs in the ATX board positions so you will need some additional board support. You can get plastic standoffs that clip into the empty screw holes but even then the bottom right corner position falls over a hole in the backplate for cable routing. If the board is the full 330mm deep then it will come right up against the front fans which can be tricky if there are, for example, right angle SATA connectors there. In that case, consider investing in slimmer 120mm front fans.  

 
The motherboard I chose for this build was the Huananzhi X99 T8D. Huananzhi is one of the better home-grown Chinese manufacturers who tend to have reasonable VRM designs, functional BIOS's and even a degree of support. This is an unusual board which targets the small number of non-standard OEM Haswell Xeons that support DDR3 as well as DDR4. These were adopted by the likes of cloud providers back in the day so are plentiful and cheap on the second-hand market. Huananzhi have also added some more modern features - bootable M.2 slots for NVME and SATA SSD's, USB 3, onboard BIOS code indicators and onboard power and reset buttons for testing. It also has 7.1 audio and dual (Realtek) Gigabit ethernet. The board is also a fraction smaller than EATX at 290x310mm which makes fitting it into the case a breeze.

To go with this board I have two Xeon E5-2696 v3 CPU's with 18 cores each and a top turbo speed of 3.8GHz. These can be had for under £100 off Aliexpress which is ridiculous for the amount of power you get. Each of the E5's has a multicore Passmark score equivalent to an Intel Core i9-10900K. There is a BIOS mod which will allow the full turbo speed to be applied to all the CPU cores but this can strain the VRM's somewhat. This mod works for all V3 Xeons - search for "S3TurboTool" if you are interested. Usefully this motherboard also supports LRDIMM's which are also remarkably cheap since not all motherboards support them. £260 for 8x32GB DDR3-1600 LRDIMMS from the well-known auction site, which happily overclock to DDR-1866 speeds.

Getting back to the build, all the front panel connections are on the bottom edge of the board. Rather than messily routing the cables through the case, they can be bundled together and fed through the holes in the front of the case cleared by removing the drive bays. All except the USB 3 connector which is too big. This is fed through the slot under the optical drive and tucked out of the way under the bottom edge of the front fans. There is just enough room for the cables round the edge of the optical drive when the front cover is snapped into place. I've also put in some mesh filters over the fans since they are intakes. 


Here is the motherboard fitted into the case. Huananzhi provide suitable plastic standoffs for cases that don't have standoffs in the right place.

The coolers are Raijintek Aidos with the fans replaced with 90mm Arctic PWM PST ones. One annoying feature of the motherboard is that it only has 4-pin fan control for the CPU fans. The PST feature of Arctic fans allows the PWM signal to be passed on to other fans. The front CPU also controls the two 120mm intake fans - which are also Arctic PST models. The rear CPU initially also controlled the rear exhaust fans - two Arctic 80MM PST models that I found got a bit noisy as things warmed up. I ended up connecting the rear fans to one of the 3-pin fan headers with a speed reduction resistor. The fan speed vs temperature profiles for each CPU can be independently configured in the BIOS and it actually works! Unfortunately, the profiles rely on chipset temperature sensors rather than the CPU sensors so there is a bit of a lag in their response. Linux fancontrol can be used to get round this.

The two 8-pin EPS power connectors and the main ATX power connector are all at the top edge of the board so those cables can be tucked above the DVD-RW drive. I found that one of the EPS cables could be fed through the channel on the side of the 5.25" drive bay. The other could be tucked into the gap between the case and the PSU and then down the gap between the PSU and the rear fans. 

The only cables I routed behind the motherboard were the SATA data cable for the DVD-RW drive, and the SATA power for the SSD's. As I've mentioned before, I find the SuperMicro slim SATA cables to be the best for my purposes. You could also run a GPU PCIE power cable down here if needed - I chose a GTX 1650 card which doesn't require a power cable and provides enough oomph for the few games I do play, like Oolite or a bit of Minecraft.

You can also just see the PST signal cable from the front CPU fan which also connects to the two front fans back here.  

Having removed or blocked most of the storage bays in the case, I do need to have some more storage slots than just the on-board M.2 connectors. On the well-known auction site, I found a card that holds two 2.5" SATA drives and fits into a PCI slot. It doesn't take any power or signals from the slot - there are two SATA data and one SATA power connector on the card edge.

Two drives aren't really enough though, so I bought two cards, removed the bracket from one and stacked them together using 8mm spacers and 25mm screws. This gives just enough space to fit a 7mm SSD and four of them occupy a slightly-larger-than-single-slot card. Just found an "official" but bulkier version from DeLock.

 I did have to saw/file off a few of the PCI slot fingers to fit round motherboard components but since there are no connections there it is not a big deal. You can see it fully loaded at the bottom of the whole-case shot above.

I like to have one physical drive per VM using KVM raw pass-through. Easy to move to a new host and there is no storage contention when VM's are doing heavy activity. 

 So there you have it:

2x18 Haswell Xeon cores at up to 3.8 GHz

256GB 8-channel DDR3 1600 LRDIMMS overclocked to 1866

1xM.2 NVME SSD + 4x2.5" SATA SSD's

All in a 27 litre case, and costing well under a grand.           

Thursday, 30 April 2020

Nextcloud Address/Calendar Bbackups

I've been looking at an easy way to mirror my Nextcloud instance to a secondary server and came across Bernie_O's calcardbackup which neatly plugs a hole. While it is pretty easy to use rsync or similar to copy the files across the nextcloud database is a bit of a problem. You could use myqsl dump but that replicates the entire installation which is not quite what I want. However, when you get down to it, the bits that really matter are calendars and address books. The rest - user lists etc. are pretty much set up once and left alone.

What the script does is dumps out users calendars and address books in .ics and .vcf format - which can easily be imported when needed. What I do (as the web user) is:
  1.  Dump out the users data a files in the nextcloud admins account (not compressing them into a package, and only keeping 14 days backups):
    /usr/bin/calcardbackup/calcardbackup "/srv/www/htdocs/nextcloud" -x -r 14 -o "/srv/www/htdocs/nextcloud/data/admin/files/Backups"
  2. Tell nextcloud to rescan the admin's files to make them visible in the nextcloud client
    php /srv/www/htdocs/nextcloud/occ files:scan -p "admin/files/Backups"
  3. Once I conformed that these worked OK I added them to the web user's cron jobs to run daily at 2am
The dumps are then rsync'ed along with everything else.

Friday, 15 November 2019

Chuwi Minibook First Look

Received my Chuwi Minibook (crowdfunded on Indiegogo) and have been having a play so here are my first thoughts. For my basic setup I am more-or-less duplicating the configuration I used for my GPD Pocket with updated versions of the packages in question.

I ordered the M3-8100Y version with 16GB of RAM. However, I did not order any additional SSD since I intended to use an M.2 PCI-E MicroSD adapter for an internal drive. This means I can just take the internal MicroSDXC from my GPD Pocket rather than having to copy anything. The card also draws at most maybe 0.5W as a storage device which is a lot less than an equivalent SATA or NVME SSD. Yes, it's slow but I seriously don't notice that much since I'm not a gamer.

Some observations about the Minibook.
  1. Chuwi have configured M3-8100Y with TDP-up settings that give a minimum turbo of 1.6GHz. It would be great if this was configurable in a future BIOS with the options of regular TDP (1.1GHz) and TDP-down (800MHz) for those of us who want to extend battery life. I'll detail my experiments with Throttlestop in this area down below.
  2. It's annoying that the minimum PD power requirements is 24W (12Vx2A) rather than 18W (9Vx2A) since there are a lot of 18W adapters and power packs around. Not sure whether this might be adjustable or is hard wired. On the other hand, it makes sense considering the potential maximum power draw of the Minibook (15W peak TDP for the CPU alone).
  3. It would be nice if the default keyboard light status could be configured in the BIOS to Off/On/Last Setting for mainly for resumption from suspend/hibernate.
  4. The screen is a seriously shiny fingerprint magnet and I'm still looking for a good oleophobic matt screen protector in the UK. I ordered at AtFoliX one from eBay and it was far too big.
  5. The Intel drivers for the M3-8100Y seem to handle external displays very badly - the GPD Pocket was painless but getting scaling and orientation right with the new control panel doesn't really work.
Now, on to my Throttlestop configuration (I have yet to try XTU)...
  1. I have downvolted the CPU core by 100mV and the CPU cache by 50mV to reduce power consumption. This works for me but depends on your CPU. This works for all frequency settings.
  2. I have left the TDP limits as they were, since they can't be configured per profile in Throttlestop. Instead I use turbo frequency limits to control power consumption. I haven't fiddled with GPU settings since I don't really game that much - so its power consumtpion is generally minimal. Geekbench 4 figures are in [brackets].
  3. Profile 1 is 1.6gGHz limit for both single and dual core turbo (this is as low as it goes) and is the default I use when on battery. Power consumption seems to be around 3.5W peak (CPU only). [2207/3845]
  4. Profile 2 is 1.8/2.2GHz and with a CPU peak power of around 5W. The fan doesn't seem to spin up at this level and keeps things quiet. [2798/4807]
  5. Profile 3 is 2.2/2.7GHz, with a CPU peak power of around 7W. The fan spins up but is generally not too obtrusive. This is my default when plugged in. [3289/5706]
  6. Profile 4 is the default 2/7/3.4Ghz that the Minibook comes with. With undervolting I am seeing a peak of maybe 10W here but the fan does get noisy. [3939/6771]
I have yet to do any thermal mods so there's still more scope for noise limiting. Battery life for Profile 1 running the CPU flat out, display brightness 40% and keyboard light off is around 2.5-3 hours. Idle CPU power draw is around 0.5W so there is scope for quite good longevity under normal use.

For those of you with NVME drives that draw 4+W, default CPU settings and Windows Update/Indexing thrashing both, I'm not surprised battery life is short. Once Windows settles down things will improve a lot but a heavily used power hungry SSD could easily halve battery life.    

Sunday, 27 January 2019

Nextcloud on OpenSuse 15.0 Part 2

Now we've got the latest Nextcloud (15.X) running more or less satisfactorily on OpenSuse 15.0, it's now time to do a bit more detailed configuration.

First of all we need to set up a cron job to do the regular housekeeping that nextcloud needs. Currently, it kicks off this activity whenever a page loads but as more content gets added this begins to become a bottleneck. So, in a terminal session do the following as root:
  1.  crontab -u wwwrun -e
  2. This brings up an editor (vim) for the cron jobs assigned to the user wwwrun (which is the account nextcloud runs under). The editor commands are somewhat cryptic...to go into insert mode, press i and the cursor will move to the top of the screen
  3. Enter (or cut and paste) the following: */5  *  *  *  * php -f /srv/www/htdocs/nextcloud/cron.php
  4. Do not press Enter! 
  5. Now you are done, press Escape to get out of editing mode and then :q to quit and save.
  6. This will have scheduled the Nextcloud housekeeping to run every 5 minutes
Now, we need to tell Nextcloud that what has been done.
  1. In a browser, log into Nextcloud as the admin and navigate to the Settings | Basic Settings screen
  2. In the top Background Jobs section, click on Cron (you have to enter the admin password again to confirm).
Now it makes sense to update the Nextcloud config to ready for external access.
  1. Navigate to /srv/www/htdocs/nextcloud/config/ and open config.php in kate (or your text editor of choice).
  2. In the trusted domains_array add some entries after 0 => 'localhost', so that the Nextcloud server will work when accessed via other URL's besides localhost. I would suggest the following (adapted to your setup)...
    1. 1 => 'the-ip-address-of-the-server',
    2. 2 => 'servername.domain.com',
    3. 3 => 'servername.localdomain',

Saturday, 26 January 2019

NextCloud on OpenSuse 15.0

Most of the install guides (https://en.opensuse.org/SDB:Nextcloud and https://en.opensuse.org/SDB:LAMP_setup) use the command-line but a lot can be done using Yast. Do this logged on as root or else you will need to enter the root password a lot and preface command line instructions with sudo.
  1. Get the LAMP stack is installed and running...
    1. Yast | Software | Software Management | View | Patterns
    2. Tick Web and LAMP Server under Server Functions and press Accept
    3. Yast | System | Services Manager
    4. Select apache2  set the Start Mode to On Boot, and then press Start to start it immediately. Repeat for mariadb. Then press Ok.
  2. Get MariaDB set up properly...
    1. Fire up a terminal session and run mysql_secure_installation
    2. Press enter since there is no current MariaDB root password and then select Y to set one - enter your new MariaDB root password twice
    3. Select Y for the rest of the options
  3. Set up a database for Nextcloud...
    1. Fire up a terminal session (or keep using the previous one) and run mysql -u root -p
    2. You will be prompted for the password you entered above
    3. To create the database type create database nextcloud; and then press Enter. Don't forget the semicolon at the end.
    4. Then create a user ID and password for Nextcloud to access the database. Type create user ncdbuser@localhost identified by 'your-password-here'; and then press Enter
    5. Now give the Nextcloud ID access to the database. Type grant all privileges on nextcloud.* to ncdbuser@localhost identified by 'the-same-password-above'; and then press Enter
    6. Now type exit; and press Enter to finish
  4. Enable PHP so that Nextcloud can run
    1.  Fire up a terminal session (or keep using the previous one) and run a2enmod php7
    2. Then restart the apache webserver with apachectl restart
  5. Now install Nextcloud. The version that install with OpenSuse 15.0 is 13.0.2 but, as of writing 13.0.8 is in the update repository. If you have a vanilla install of OpenSuse the Update Repositories should already added to the Software Management module.
    1. Yast | Software | Software Management | Search | nextcloud
    2. Tick nextcloud and then press Accept
    3. A whole load of dependencies will display, press Continue
  6. Now configure Nextcloud.
    1. Fire up a web browser and navigate to locahost/nextcloud
    2. You should see a login screen as asking you to create an admin account and password for Nextcloud. Enter a new user ID and password here (these should be different from the previous userID's and passwords). DO NOT PRESS the Finish Setup button yet!
    3. Select MySQL as the database and boxes for entering the details entered in section 3 will appear ("ncdbuser", "your-password", "nextcloud" and "localhost").
    4. Then you can press the Finish Setup button 
  7. You will now be logged in to Nextcloud as the admin user. Logout (option under the top right icon)
This is an older version of Nextcloud so you need to update but, at least on my install the permissions and a couple of other things are a bit messed up and the online updater won't work. To fix this, do the following in a terminal as root:
  1. cd /srv/www/htdocs
  2. chown wwwrun.www nextcloud
  3. cd nextcloud
  4. chown wwwrun.www * -R
  5. chown wwwrun.www .*
  6. chmod +x occ
  7. rmdir search
Now, in a browser, log in to Nextcloud again as the admin. Do the following...
  1. Click on the top right icon and select Settings
  2. Part way down the screen under the Version heading you should see there is a new version 14.X available (otherwise log on and off again and see if it does a rescan for updates). 
  3. Click to use the Web Updater
  4. You should then allow it to check that the updater will work (if you have reset the permissions above that should go through OK).
  5. Click to carry on with the Web Updater,  you should be taken to an update screen with a list of all the bits to be updated. This is a fresh install so they should all be fine.
  6. Press the button at the bottom to go ahead with the update 
Once that is done you will once more be logged in to the updated Nextcloud instance as an admin. Repeat the above procedure again since there will now be a 15.X update available - at the time of writing that's it, 16.X isn't out yet.

We are not done yet, although we now have Nextcloud 15.X running it now needs a bit of tuning...
  1. In the browser, go to the menu top right and select Settings. Under the Overview | Security and Setup Warnings there is a short list of things to fix...
  2. First of all get the database straightened out after the upgrades. In a terminal, logged on as root, do the following
    1. cd /srv/www/htdocs/nextcloud
    2. sudo -u wwwrun ./occ db:add-missing-indices
    3. sudo -u wwwrun ./occ db:convert-filecache-bigint
    4. The last command will warn you about taking hours, it won't since the install is fresh, so press Y
  3. When running these commands you will notice them complaining about the PHP memory limit so lets change that.
    1. In Dolphin, navigate to /etc/php7/apache2 and click on php.ini. It should open in the kate text editor. 
    2. Scroll down until you find the line memory_limit = 128M and change it to memory_limit = 512M
    3. Save the file and exit
    4. Now navigate to /etc/php7/cli and repeat the process there.
  4. Now lets set up some caching to improve performance...
    1. In Yast go to Yast | Software | Software Management | Search | apcu and check php7-APCu
    2. Then search for php7-opcache and check it
    3. Press Accept to install the packages
    4. In Dolphin, navigate to /etc/php7/apache2 and click on php.ini. It should open in the kate text editor. 
    5. Scroll down until you find the [opcache] section. Remove the leading semicolon and edit (if required) the following lines:
      1. opcache.enable=1
      2. opcache.enable_cli=1
      3. opcache.memory_consumption=128
      4. opcache.interned_strings_buffer=8
      5. opcache.max_accelerated_files=10000
      6. opcache.revalidate_freq=1
      7. opcache.save_comments=1
    6. Now add a new section [apc] at the end with the line apc.enable_cli=1
    7. Save the file and exit
    8. Now navigate to /etc/php7/cli and repeat the process there.
    9. Now navigate to /srv/www/htdocs/nextcloud/config/config.php and open it in the kate editor
    10. Just before the last line add in  'memcache.local' => '\OC\Memcache\APCu',
    11. Save the file
    12. Restart the web server in a terminal using apache2ctl restart
  5. Log on to Nextcloud and there should be a lot less things in the Settings | Overview. I don't care about the CalDav and CardDav issues since it only really affects Apple stuff - which I don't have any of.
However, SSL really does need to be set up, but that is for another posting...

One last thing. I just had a look in the logs and it was full of error messages about using "...a fallback version of the intl extension". Fire up Yast, install php7-intl and then restart apache (again). Problem solved.

Monday, 26 November 2018

OpenSuse 15.0 DHCP Problems

Just patched OpenSuse on my Lenovo C30 and DHCP appears to have stopped working.

It transpires that the DHCP server is rather old and can't deal with newer DHCP requests (it needs RFC 2132 rather than RFC 4361).

The problem is described on Bugzilla.

To save you time, all that needs to be done is to create /etc/wicked/local.xml which contains:

<config>
  <addrconf> 
    <dhcp4> 
      <create-cid>rfc2132</create-cid>
    </dhcp4>
  </addrconf>
</config>

Then restart the wicked service to pick up the new settings with:
systemctl restart wickedd
 
 

Tuesday, 23 October 2018

Unihertz Atom Part 2

Some further observations on the Unihertz Atom now I've had it for a bit...
  1. It's a lot faster than the Jelly Pro, which sometimes felt like a compromise compared to a full sized Android phone. The Atom is as responsive as anything I've used (Samsung Galaxy's and a Sony Xperia Z5).
  2. The GPS is miles better than the Jelly. In fact it seems to get a position lock faster than any of the other devices I have access too - nearly instantaneous. This I find quite remarkable considering the Jelly generally took a few minutes.
  3. The battery life is excellent - even setting it up with lots of downloads and syncing it still gave me nearly 2 days of use. Overnight with Wifi and 4G on it only dropped a couple of percent. The question is: do I charge every two days to try and preserve battery life considering it's not removable?
  4. On a USB PD charger it seems to charge very quickly: 30-85% in under half an hour. It does slow down after reaching around 90% but that's enough charge for a day of operation in half an hour.
  5. Fingerprint reader seems to work very well for me. I would estimate that it works first time 90%+ of the time.
  6. The Calender widget is not as good as the Jelly one, too much screen space wasted on a small screen. That will need replacement.
  7. Even after updates the Jelly is ahead on Android patch level - consequently, I expect more updates soon. 
And now a few more config details now...
  1.  Nova launcher works quite well on the Jelly, and now Atom, since it allows you ta lot of flexibility resizing widgets. In particular, it allows you remove widget padding to maximise their size, and I use full screen widgets to make the most of limited screen real estate.
  2. I use a dark theme on the phone since I find white-on-black easier to read. 
  3. On the first home screen I have a full screen calendar using Simple Calendar Widget which is much more space efficient (and neater) than the inbuilt widget.
  4. On the second-through-fourth home screens I have full screen aquamail widgets for each of my main email accounts. These are all set to update every 15-mins and AquaMail is white-listed under Settings|Smart Assistant|Power save manager  to ensure that it is able to run in the background correctly.
  5. One the fifth screen I have a full screen BBC News widget, also whitelisted like Aquamail so it updates regularly.
  6. On the sixth screen have three widgets running taking up a third of the screen height but at full width: BBC Weather, Music and TuneIn Radio Pro.
  7. There are no app icons on any home screens but the dock at the bottom also scroll sideways to reveal new icon sets. I have set it to hold four icons (one is always the Apps button).
This way I can get to all my key info one-handed by just side scrolling the screen with my thumb. Unlocking using a PIN is actually easier than using the fingerprint reader if the phone is held one handed since the button is so low. This is something most phone makers get wrong and I blame Apple for encouraging that design stupidity. The Xperia Z5 Compact with its fingerprint sensor on the side actually worked better for one handed operation (but only for right handers).     

Thursday, 18 October 2018

Unihertz Atom Setup

Just got a Unihertz Atom phone to replace (partially) my Jelly Pro. It's quite a bit thicker but an awful lot faster. Hopefully the additional power consumption of the CPU and RAM is covered by the bigger battery. With Android 8.1 the Jelly gives me a day of good usage, which is much better than it managed with the Android 7.0 that it shipped with.

My setup on the Jelly developed over several iterations but I intend to largely replicate it on the Atom so here it is.

First of all, after letting Android update, I need to disable various bits, both to improve battery life and limit the amount of data I send to Google. In the Apps Lis,t I disable, force stop and delete the data of...
  • Drive - I'm not going to be working on any documents and presentations on a screen this small!
  • Duo - Cute, don't need
  • Gboard - Only marginally usable on a device this small
  • Gmail - Crap
  • Google - If I really need it, I can fire it up in a browser, didn't miss it on the jelly
  • Google Pay Movies - Are you kidding me, on that screen?
  • Google Play Music - I've got my own stuff ripped
  • Keep - Nope
  • Maps - I want proper downloadable maps
  • Pedometer
  • Photos - Not really going to use this for photo viewing 
  • Talkback - Not needed
  • Trackback - Not needed
  • Zello - I want to use the PTT button for something else
I also disable Backup (under the Google section in Settings) since I have Nextcloud for that. The PTT button is linked to the Camera App (under Smart Assistant| Shortcut button) - mainly for taking pictures of receipts for expenses.

Now the Apps that I do install:
  • AquaMail - much better than Gmail, especially the widgets and multiple account handling
  • BBC iPlayer - Mainly for things linked from the News App
  • BBC News - again a nice widget
  • BBC Weather 
  • Fujifilm Camera Remote - for my X-T20
  • CardDAV-Sync - My contacts sync to my NextCloud server, not Google
  • DROIDCam - My GPD Pocket doesn't have a Webcam, which is generally a good thing for privacy, sometimes, however...
  • FolderSync Pro - Syncs the rest of the stuff on the phone with NextCloud, mainly my music
  • HERE WeGo - Downloadable maps and navigation courtesy of the ex-NavTech/Nokia guys
  • Minuum - Keyboard/predictive text for small screens/fat fingers
  • Nova Launcher - it's just better
  • PasswdSafe - No Google/Chrome you're not doing password autofill for me either
  • TuneIn Radio Pro - It's got a headphone socket!
Next, I fire up HERE WeGo and start the download of maps for all of Europe and N. America which will keep it busy while I set up email and Next Cloud sync...

   

Friday, 3 August 2018

Shoehorning Duallies - The Lenovo C30

Just picked up a Lenovo C30 from ebay, which looks like at least one company thinks like me as far as cramming a lot into a small case. In this case, a more or less EATX dual Socket 2011 motherbard in a case rather smaller than a regular PC case.

I'll be going into this into a bit more detail in a later posting but first a few observations:

  1. The BIOS was rather old and Lenovo has done quite a good job at releasing regular updates to cover Intel's security holes - both in the Management Engine firmware and the whole Meltdown/Spectre debacle. However, the CDROM-based EFI BIOS update failed - judging from the error message, the EFI code on the board was too old to run the update script. So I go to use the DOS update using a Rufus generated bootable USB key - I'm running Linux on this so the Windows update was not an option. This gave me an out-of-memory error which was somewhat annoying - fortunately the error message was accompanied by the command line that flash.bat was trying to execute. Entering this manually, without the overhead of command.com and Lenovo's wrapper code, worked fine.
  2. The motherboard is identical to the considerably larger Lenovo D30  but with half the RAM slots missing (8 instead of 16) to allow better airflow - the D30 has RAM cooling fans but the S30 relies on passive airflow. However, I think that a D30 motherboard would work fine with all the slots if I stick to low voltage DDR3L. If one comes up for a good price I may try that. As it is, 16GB DDR3 DIMMS are getting quite cheap on eBay and 128GB is probably enough.
  3. The C30 is quiet - even with all the cores maxed out running SETI it hardly makes any sound.
  4. There are several versions of the C30 and early ones, the 10xx series, don't support Ivy-Bridge Xeons but the 13xx series do. Most sellers don't distinguish and, frankly, if they're just shifting the boxes that they have, then I wouldn't expect them to know. Lenovo's documentation isn't the clearest on this either. I bought one with dual E5-2609 v2 chips to ensure that it was the right version - and then promptly swapped the CPU's for something less feeble. 
  5. I'm waiting for the more beastly e5 v2 Xeons to come down a bit in price. In pairs, they hold their own against current single socket cpu's in multithreaded benchmarks rather well. I suspect that this is because multithreading tends to be memory constrained and a dual 2011 platform has 8 channels of DDR3 which isn't bettered by today's Epyc and Xeon Gold's. While they do give up a bit in bandwidth (DDR3 1866 vs DDR4 2666) the latency is almost the same - which counts for a lot as thread numbers and consequent randomness of memory accesses rise. 

Thursday, 19 July 2018

Intel Quad Port PRO/1000PT and PCI-E revisited

I was really annoyed that I had to put the Intel Quad Port PRO/1000PT right next to the video card in my new build since it wouldn't work in a PCI-E 3.0 slot - and, in fact, would stop the machine from booting if inserted. That was making the video card 5-10C hotter since it was passively cooled and needed a bit of air circulation.

So I dove into the BIOS and found that I could set the PCI-E version for the PCI-E 3.0 slots (but not the 2.0 slot for some reason). This could be just the thing - so I set the problematic PCI-E slot to PCi-E 2.0 mode, remembering that Supermicro still numbers the slots as if the PCI-X slots that aren't there on the X9SRI are still there, and moved the network card over. Lo and behold! The machine booted.

Unfortunately, this was as a result of the network card just not working at all, as opposed to actively stopping the boot process. Obviously there is a subtle difference between a PCI-E 2.0 slot and a PCI-E 3.0 in 2.0 mode - remember, this is an Intel network card in a motherboard with an Intel CPU and chipset. Moderately unimpressed with both Intel and the mess that seems to be PCI-E standards.

A search for Intel documentation reveals that the low profile PT-cards are actually PCI-E 1.0a (which I wasn't aware even existed) which should work with PCI-E 2.0. Finding this was a lot harder than in the past as Intel seem to have expunged or broken links for older products. I remember when they used to have really good legacy support not so long ago (i.e. 18 months!). So I drop down to PCI-E 1.0 in the BIOS and finally everything works OK.

Outcome, a cooler, working system and increased disillusionment with Intel and the whole PCI-E mess. PCI/PCI-66/PCI-X either inter-operated or was keyed so you couldn't make a broken configuration - this is not progress, guys!  

Monday, 16 July 2018

Mobile Device Table

A summary of the portable computing devices that I have used for work over the years for no reason other than general interest. There are others (such as the Omnibook 600C) that I have owned and toyed with but not used in anger.

The heaviest device was the AST Ascentia J30 at 2650g, a large chunk of which was battery as far as I can remember. The largest screen was the Dell XPS 13 Developer Edition which, with Linux out of the box, was a real delight apart from the trackpad.

I don't get on with trackpads of any sort (yes, I've tried Macs and I find they're even more annoying than PC ones). The Omnibook popout mouse was a great idea, trackpoints are fine and touchscreen are OK provided they have stylus support. The Samsung Tab S is interesting - it has a capacitative screen but works with a special Samsung stylus with a narrow tip. I don't know how they do it since the stylus won't work on other screens.

Mfg Model Year CPU RAM Storage Screen Size Screen Resolution
Casio FX 700P 1983 Hitachi HD61913A01 2K 12K ROM ~2 inch 12 chars
HP Omnibook 300 1993 Intel 386SXLV 16Mhz 4M ~12M ROM
10M SSD
9 inch 640x480 (16 grey levels)
AST Ascentia J30 1996 Intel Pentium 133MHz 40M 800MB HDD 10.4 inch 800x600 DSTN (256 colours)
HP Omnibook 800CT 1996 Intel Pentium MMX 166MHz 80M 2G HDD 10.4 inch 800x600 TFT (16 bit colour)
Fujitsu Lifebook B2154 2000 Intel Mobile Celeron 450MHz 192M 2G HDD 10.4 inch 800x600 TFT (16 bit colour)
Sharp Zaurus SLC1000 2005 Xscale ARM 416MHz 64M 128M SSD 3.7 inch 640x480 ICZ
Fujitsu Lifebook U810 2007 Intel A110 800MHz 1G 60G HDD 5.6 inch 1024x600 TFT
Toshiba NB100 2009 Intel Atom N270 1.6Ghz Hyperthreading 2G 120G HDD 8.9 inch 1024x600 TFT
Dell XPS 13 L322X 2013 Intel Core i73537U 2GHz (3.1 turbo) Dual core+HT 8G 256GB SSD 13.3 inch 1920x1080 IPS
Samsung Galaxy Tab S 8.4 2014 Exynos 5420 Octa 3G 32GB + 128GB MicroSDXC 8.4 Inch 2560x1600 OLED
GPD Pocket 2017 Intel Atom X8750 1.6GHz (2.56GHz turbo) Quad core 8G 128GB SSD + 256Gb MicroSDXC 7-inch 1920x1200 IPS

Mfg Model Year HxWxD (mm) Mass (g) Touch-screen Track-point Conver-tible Notes
Casio FX 700P 1983 71x165x10 116


BASIC Programmable Calculator
HP Omnibook 300 1993 163x282x36 1315


MSDOS 3.3, Windows 3.1, MSOffice in ROM
Popout mouse
AST Ascentia J30 1996 289x228x47 2650
X
Win 95
HP Omnibook 800CT 1996 185x282x40 1770


Win 95, popout mouse
Fujitsu Lifebook B2154 2000 308x274x40 1400 X X
Win 98
Sharp Zaurus SLC1000 2005 128x87x24 298 X
X Cacko Linux, Dpad
Fujitsu Lifebook U810 2007 150x168x33 712 X X X Win Vista (replaced with OpenSuse),
Toshiba NB100 2009 225x191x33 1000


Win XP (replaced with OpenSuse)
Dell XPS 13 L322X 2013 205x316x18 1360


Ubuntu preloaded (replaced with Kubuntu)
Samsung Galaxy Tab S 8.4 2014 214x142x8
(inc. kbd)
647 X
X Android, Removable Bluetooth Keyboard
GPD Pocket 2017 180x106x18.5 480 X X
Win 10

Sunday, 15 July 2018

Old Soundblaster Live Card and Windows 10

One of my Windows 10 boxes has an old noname soundcard based on the CMedia CMI8738SX which only has Windows 7 driver. When I allowed Windows 10 to auto-upgrade the preceding Windows 7 installation, somehow it kept on working. However, at some point recently the Windows installation became borked to the point that it no longer updated - and no amount of repairing would fix it. There was nothing left but to re-install Windows from scratch (upgrade and repair installs both failed). Fortunately, everything of import is kept on my Nextcloud server so I can resync my data afterwards quite easily.

However, I could not persuade the C-Media card to work nicely with Windows 10 (it being 64-bit didn't help). I cast around and found that I had a SoundBlaster Live 5.1 PCI card sat in one of my Linux boxes, mainly because it worked with the 3.3V PCI slot in an H8DCL motherboard. However, having worked out previously that C-Media chipsets support 3.3V PCI, and can be converted merely by filing a suitable notch in the PCI connector, I duly did a swap with the Linux box (Linux supports old CMedia chipsets just fine).

The SoundBlaster is such a standard that surely Windows 10 will support it...? Nope. A visit to the Creative site confirms that there is only a W7 driver. Do I sense a conspiracy to sell new kit when the old stuff works fine? Anyway, a search online turns up the KX Project and, more importantly, their GitHub site which ensure things will hang around a bit. Under Windows 10 64-bit the driver installs fine. Ignore the bit about using KXMixer since it does not work, but the W10 mixer seems to work OK for me.

Unfortunately, they are no longer accepting donations - but a big thank you from me.

Tuesday, 10 July 2018

Fun and Games with the SuperMicro X9SRI

Scored a Supermicro X9SRI off eBay as a useful way of using up my DDR3 memory once I start decomissioning some of the older machines in the house. It has 8 slots so I can get a tidy 64GB into it when fully loaded. It turns out that this board - or maybe Intel's server chipsets - are a little temperamental.

I paired it with a Xeon 1650 v2 which is slightly faster than an i7-4930K and is still quite respectable CPU. That's round about a Ryzen 2600 level in modern terms and a lot cheaper, especially when you factor in the price difference between DDR3 and DDR4 RAM. And there my problems started...

I reset the BIOS, loaded up defaults and proceeded to install Linux. Everything went fine, for a while, and then I started getting random hard freezes - but not associated with any particular activity. After swapping out RAM, video cards and everything else I was till no nearer a solution. In desperation, I acquired another Xeon (E5-2609 this time - cheap enough for a quick test) and sure enough, I dropped it in and everything worked fine. So, it's the CPU, I thought, but I was puzzled by the behaviour - working fine under heavy load (Phoronix CPU Benchmark Suite) and the freezing at idle didn't seem like any other failure I'd come across. So I worked my way through the BIOS Options and discovered that the culprit was in the CPU Power Management Settings. If I set it to Power Saving (the default) then I get freezes, but if I set it to Performance then all is well. Interestingly, Linux still seems to do power saving, dropping the clockspeed and voltage of the CPU so it runs quite cool at idle. So I have no idea what the setting does other than break v2 Xeons!

I dropped an old GT 710 card in so I didn't have to live with the 1280x1024 that the on board video can do. I hesitate to call it a GPU but it's only really meant for IPMI redirection so I'm being a little unfair. That works fine with nouveau but I install the proprietary nVidia drivers which have better power management.

Finally, I drop in an Intel Quad Port PRO/1000PT to give me a few more ethernet ports to play with and the board refuses to boot - giving me beep sequences instead. A few more card swaps and it transpires that the Intel card really hates being in PCI-E 3.0 slots and will only start up in the middle, PCI-E 2.0, slot. I was hoping to put it on the slot further away from the video card since the PT gets quite warm but there you are. Reminds me of the old DOS days fiddling around with interrupt combinations to get all your peripherals to work.

Friday, 19 January 2018

Delegating ORCID Tokens

This is the final blog posting arising from the ORCID Delegation workshop held on the 10th October at Jisc in London (with representatives from Oxford, Imperial, Leeds, LSE, ORCID and Jisc). The previous blogs (Delegating ORCID Tokens – background, Revoking ORCID tokens) covered other incidental outcomes, so I will now get to the main topic – the fact that institutional ORCID users needed to explicitly grant access to third party suppliers in addition to their own institution. This behaviour has a number of undesirable side effects (repeating myself somewhat):
  • Communicating this to users can be difficult since they are not always aware of these third parties
  • Getting consistent takeup across multiple systems can be difficult (user loses interest) which makes downstream integration more awkward than necessary
  • Institution has little visibility of these third party interactions – which can cause problems when suppliers are dropped or other issues arise
  • The only way currently round this is to let a supplier use the institutional key – which however then grants them *ALL* the rights can access that the institution has
ORCID uses the OAuth(2) mechanism for authentication and authorization. OAuth already provides the functionality that will allow an institution to generate secondary tokens for third parties and subsequently revoke them:
  • When an ORCID owner authorises institutional access, the institution receives two digital tokens:
    • The access token acts as a “key” that is used to access ORCID data via the ORCID API
    • The refresh token can be used to request additional tokens via the OAuth API
  • There are two primary ways that the refresh token can be used:
    • To request a new access token when it nears expiry, invalidating the current access token – this has been discussed in the previous posting on revocation
    • To request an additional access token which may have reduced permissions and/or differing expiry, which leaves the current access token intact
  • Multiple additional tokens can be requested
  • Additional tokens can be invalidated in a similar way to regular access tokens
Obviously, this additional token mechanism is exactly what is required to allow delegated access to third parties. The issue is that there is no standard mechanism for a third party to know that they should go to an institution to get a token instead of ORCID themselves, nor is there a standard way for an institution to deliver that that token securely. There are several approaches to solving this issue:
  • ORCID keeps track of additional tokens requested and who they are intended for, and issues them when requested.
    • ORCID will need API enhancements to allow institutions to indicate which tokens are for which supplier (and for a supplier to indicate which institution’s token they require)
    • These enhancements are likely to be ORCID specific rather than vanilla OAuth2 so existing code libraries will not exist
    • Institutions will need to implement and use this API, which may involve rather more information release than is desirable
    • Supplier will need to implement and use this API
    • It is unclear how a person with multiple institutional affiliations might be handled without adding significant complexity
    • Short lived tokens would require a three-way interaction between supplier, institution and ORCID – this will be complex and is unlikely to scale effectively
  • Institutions provide an endpoint which the third party always contacts when it needs an access token.
    • This could be implemented as an OAuth2 proxy type of service, which could forward token requests to ORCID on behalf of the institution if an additional token does not already exist, or return an institutional token if the institution in question was not interested in delegation. If developed as a standardised packaged software appliance suitable for running on virtual or cloud infrastructures this could be deployed at an institutional level with minimal effort.
    • Institutions could automatically request and issue short lived tokens relatively easily
    • Institutions retain control over third part interactions
    • Institutions would need a secure (SSL, VPN etc.) network channel to the supplier. This is quite likely to exist already, in practice
  • A third party could maintain a shared proxy-type service for use by multiple organisation
    • This would add another party that needs to be trusted into the interaction, adding effectively a second level of delegation.
    • Cost saving against a locally deployed appliance (as described above) may be minimal when the additional complexity of management is taken into account
Ideally, to make the system robust and workable, ORCID owners should have a verified institutional affiliation (or more than one if necessary) attached to their account so that a third party supplier knows who to contact for a delegation token (either directly or via ORCID). Otherwise, another mechanism would need to be found to indicate which institutions can issue tokens for a particular ORCID owners, which would be somewhat redundant. This relationship would also need to be deasserted promptly when the relationship ends. Any of these approaches will require some investment of effort by both ORCID and member institutions for development and ongoing maintenance. The key questions for the community are thus:
  1. Primarily, whether there is sufficient interest and desire for a solution to the delegation problem for such an investment to be worthwhile
  2. Secondarily, which route is the preferred one. On initial analysis on the day of the workshop, the feeling of the group was that an institutional proxy appliance seemed to be the most attractive option.
As a footnote, Will Simpson of ORCID noted during the meeting that using additional tokens internally for different systems within the institution was also a valid use case in that it allowed ORCID to separate requests from different sources in their logs. This greatly simplifies troubleshooting problems with interactions with multiple institutional systems.

This posting originally appeared on the UK ORCID Consortium blog.

Thursday, 16 November 2017

Retconning this Blog

I've got a load of bits and pieces laying around the internet that I've posted over the years. I'm going to collect them all here with their original dates. I would like to claim it's for preservation but frankly, it just that I can't keep track of the stuff.

Wednesday, 15 November 2017

Thoughts on Fixity Checking in Digital Preservation Systems

I would like to query the rationale for actually doing periodic fixity checking in isolation. This has bugged me for a bit so I am going to unload.

As far as I can see, the main reasons would be undetected corruption on storage and tampering that doesn’t hijack the chain of custody.

All storage media now have built-in error detection and correction using Reed-Solomon, Hamming or something similar which is generally capable of dealing with small multi-bit errors. In modern environments, this gives unrecoverable read error rates of at worst around 1 in 10^14 and generally several orders of magnitude better – which is around one in 12TB total read. Write errors are less frequent – they do occur but can be detected by device firmware and retried elsewhere on the medium. These are absolute worst case figures and result in *detectable* failure long before we even get to computing fixity. The chance of bit flips occurring in such a pattern as to defeat error correction coding is several orders of magnitude less – it is similar to bit flips resulting in an unchanged MD5 hash. Interestingly, in most cases the mere act of reading data allows devices to detect and correct future errors as the storage medium becomes marginal so there is value in doing that.

Consequently, however, undetected corruption is most likely when data moves from the error corrected environment of the medium to less robust environments. At an interconnect level protocols such as SCSI, SATA, Ethernet and FC are all error corrected as is the PCI-E bus itself. The most likely failure points are likely to be a curator’s PC or software. How many curators work on true workstation grade systems with error corrected RAM and error corrected CPU caches? How well tested are your hashing implementations (MD5 had a bug not so long ago)? How about all the scripts that tie everything together? How about every tool in your preservation toolchain? How many of these fail properly when an unrecoverable media error is encountered?

If we consider malicious activity then, again, we have to ask whether it is easier to attack the storage (which may require targeting several geographically dispersed and reasonably secure targets) or the curation workflow, which is localised, generally in a less secure location than a machine room, and can legitimise changes. A robust digital signature environment is the way to deal with this – and fixity hashes *can* be used to make this more efficient (sign the hash rather than the whole object).  

Locally computed hashes can be very useful as a bandwidth efficient way of comparing multiple copies of an object (rsync has done this for ages) to ensure that they are in sync.

So there are reasons to compute hashes, when needed, but fixity is not necessarily a compelling reason given the way modern systems are engineered.

In practice, these checks do detect failures but they are almost exclusively transmission errors as a result of uncontrolled (and unauditable) activities - often by sysadmins or third party suppliers not well versed in digital preservation. In these cases, the wrong data is actually written to storage so there is no fixity to lose. Periodic "fixity" checking can catch these cases, but ideally you want to have visibility of these processes and checking immediately after completion. If the errors are in automated processes, waiting for a periodic check to come round may allow significant damage to occur.

Originally posted to the PASIG mailing list, with updates as a result of discussion with Kyle Rimkus (University of Illinois at Urbana-Champaign).

...also now posted on the DPC blog.