Feb 112013
 

Given the probable circumstances (it isn’t totally clear just yet), it seems strange to claim that it is good news that the pope is to resign. After all, it is hardly good news that anyone is having trouble with their health.

Traditionally a pope stays in office for life no matter how their health might affect their ability to do their job. And whether or not you are a catholic, you have to admit it’s an important job that needs a competent person in control. Not only does the organisation suffer from having an unhealthy head, but the person in that job suffers too – who wants to work when you’re unwell?

Which means it is good news that he is resigning – leave the job for someone else to pick up. And enjoy a well earned retirement.

 

Feb 112013
 

One of the obvious things to do with a ZFS storage pool is to increase the size of the disks in it – after all disks get bigger and cheaper over time. Not that it is a very difficult thing to do, but it is always worth doing a quick search to find out what others have done before setting forth. And if nobody blogs their own experience, there’s nothing for anybody to find!

So I started off with four 2Tbyte drives configured as two vdevs each of which was a mirror. And I had two 3Tbyte disks to swap in. So I was going to be swapping one of the vdevs (consisting of two 2Tbyte drives) with the 3Tbyte drives.

In the details below, I have a storage pool called zroot and the two disks being replaced are gpt/disk3 and gpt/disk2. As you will notice, I am growing the storage pool I boot off; however the disks I am using do not contain a boot partition with the boot code.

The first job was to swap out one of the 2Tbyte drives. This was done by :-

  1. Take disk to be swapped out offline: zpool offline zroot gpt/disk3
  2. Shut down the server and take the selected drive out. Swap over the disk caddy onto a new 3Tbyte drive, and swap that back in.
  3. Power on the server.
  4. Create an EFI partition table: gpart create -s gpt ada3
  5. Optionally create a swap partition: gpart add -t freebsd-swap -s 4G -l swap3 ada3
  6. Create a ZFS partion: gpart add -t freebsd-zfs -l disk3 ada3
  7. Replace the device: zpool replace zroot gpt/disk3

Now is the time to wait for the resilvering process to complete. Once that has finished, the steps above can be repeated for the other drive in the vdev. Once the resilvering for that replacement has finished, you may want to check the size of the pool.

If the size has not increased, you may need to do: zpool online -e zroot gpt/disk2 gpt/disk3.

Feb 082013
 

The news is swamped at the moment with the story about horse meat being found in various cheap meat products that were labelled as containing beef. Interestingly this has crowded out the news that pork has also been found in Halal meat products – which could be more of a concern to a certain segment of the British population than unexpected horses turning up.

To summarise :-

  1. If you’ve been tucking into cheap meat-based meals then you have probably had a bit of horse. That’s not good, but don’t get too excited – a horse isn’t too much cuter than a cow. Besides, did you really believe that the ultra-cheap products you were buying only contained premium quality beef? It’s a surprise that the contaminant wasn’t found to be rat!
  2. It isn’t just horse meat. Those who don’t eat it may be surprised, but horse meat is eaten quite widely in Europe. European regulation very carefully distinguishes between horse meat intended for human consumption, and horses carcases originating from pets or race horses who have received certain drugs as pain killers.
  3. Horses can be given bute (a pain killer), but only if they are not intended for human consumption. Bute was previously approved for use by people as a pain killer, but approval was withdrawn after it was shown after prolonged use to have certain adverse health effects. Europe goes a long way to avoid allowing human consumption of horse meat contaminated with bute, so it is unlikely in the extreme that any food in the UK contained any. Even if it did contain bute, it is still unlikely to have a significant adverse effect.
  4. If you’ve been eating meat products contaminated with pork, it is worth remembering that god (if he or she exists) is likely to point the blame for that squarely where it belongs – with those who labelled the product incorrectly.

There is a serious issue here. Food products should only contain what is listed on the ingredients list, and companies who cheat should be punished in some form. It’s a curious coincidence that we happen to have a government packed full of Tories who insist that government regulation is a bad thing, when government regulation is the only thing that protects us :-

  1. It’s government regulation enforcers who found this stuff out.
  2. It’s only government regulation that makes the sellers feel guilty rather than shrugging and asking “What did you expect for a pound?”.
  3. It’s only European regulation that means that the horse meat you’ve mistakenly eaten is almost certainly safe to eat.

But it isn’t necessarily Findus or Tesco at fault here. And when you come down to it, that horse meat in the freezer was pretty tasty yesterday before you knew, so shouldn’t it be just as tasty today?

And if you object to eating horses, please remember that whilst being ground up and sold as a beef burger is hardly the end we would want, being ground up, sold as a beef burger and then being thrown away is even worse!

Feb 062013
 

If you have previously used Linux’s volume manager (LVM) to set up disk storage, you may want to know about how to grow a filesystem safely.

Which is probably the big feature of any decent volume manager because accurately predicting the size of filesystems is a black art, and the only alternative – to make the root filesystem contain all of the storage is a dumb idea.

It’s actually really easy and can be done non-disruptively. It is done in two parts – effectively growing the “disk” device and then growing the filesystem itself.

Extending The Volume

First identify the volume you need to extend. You can of course simply run lvscan which will show a list of the volumes, and if you have named them sensibly will allow you to pick out the volume to extend. But the simplest way is simply to run df to look at the filesystem you want to extend :-

/dev/mapper/ssd-opt         7.9G  5.5G  2.1G  73% /opt

The device (in the first column) is what we extend. Now to decide how much to grow the volume by; just for the case of this example, we’ll assume that 2Gbytes is a sensible amount to grow the volume by. The command needed is :-

lvextend --size +2G /dev/mapper/ssd-opt

And that’s it. No need to shut down the server, dismount the filesystem, etc. Of course we haven’t quite finished yet.

Growing The Filesystem

What we have done at this point is the equivalent of making the disk bigger. We also need to tell the filesystem it is sitting on a bigger disk, and to do so we need to know the type of the filesystem. The canonical place for checking that is the file /etc/fstab (actually it’s the filesystem itself but that is going too far) :-

# grep opt /etc/fstab
/dev/mapper/ssd-opt	/opt		ext4	noatime		0 3

It is probable that you are looking at growing an ext3, ext4, or xfs filesystem. If not you will have to look up the details yourself.

Growing ext3, or ext4 Filesystems

This is done with the resize2fs command :-

resize2fs /dev/mapper/ssd-opt

Several points :-

  1. Yes it can be done “online” whilst the filesystem is mounted (and applications are busy using it).
  2. You need to specify the device containing the filesystem to grow and not the mount point.
  3. There is no need to specify the size … the size will be determined from the size of the device underneath the filesystem.

Growing xfs Filesystems

This is done with the xfs_growfs command :-

# xfs_growfs /opt

Several points :-

  1. Yes, it can be done “online”. In fact you have to do it with the filesystem mounted.
  2. You need to specify the mountpoint of the filesystem and not the device. Irritatingly different from the above!
  3. There is no need to specify the size.

How Reliable Is This?

Very.

There is always the chance that something could go wrong especially if you are operating “at the edge” (say you have a filesystem that is unusually large – several petabytes). But I’ve done online filesystem resizing for years in countless circumstances without an issue.

I’ll quite happily do it on the most important systems during working hours without losing a moment’s thought. However I do work in a place that takes backups seriously!

Feb 052013
 

So we’ve seen in the last few minutes that as expected a whole bunch of Tories have voted against the proposal to legalise gay marriage. Frankly nobody expected the “hang ’em high and whip ’em” branch of the Tories to vote for gay marriage.

Of course the media and the anti-Tories are gleefully announcing that the Tories are split down the middle and that this might just be the beginning of the end. Of what I’m not sure.

Much as I would like to see the Tories self-destruct, it is very unlikely to happen. This was a free vote – where MPs were encouraged to vote with the conscience rather than according to the party whip. Whilst it is entirely possible that a party who wants to get something through that will be unpopular with their own members, will resort to a free vote, it is a move to be encouraged.

After all, it would be nice to see MPs always voting with their conscience!