In Linux, it is possible to expand an existing filesystem over multiple disk drives. I recently had to do this for a few VPS as part of my day job, since they were running out of disk space and causing some instability with one of our core services.

Here’s how to do it, mainly for my own benefit, for when I inevitably have to do it again and have forgotten how…

  1. First, after you have connected your new drive (either physically or virtually), you need to create a new logical partition on that drive using cfdisk. You can use fdisk -l to find out the drive’s name (e.g. /dev/sdc)
  2. Create a new physical volume for this partition using pvcreate, e.g. pvcreate /dev/sdc5
  3. Extend the existing volume group to include this, e.g. vgextend VOLUMEGROUP /dev/sdc5, where VOLUMEGROUP is the name of the volume group. You can find out what the volume group is called by using the command vgdisplay.
  4. Extend the logical volume to include this extra space, e.g. lvextend -l +100%FREE /dev/VOLUMEGROUP/root
  5. Resist the filesystem. The command for this varies depending on what filesystem is currently installed, so for ext4 this would be resize2fs, and in my case for xfs this is xfs_growfs. E.g. xfs_growfs /dev/VOLUMEGROUP/root

After which, you should be able to type df -h and see increased disk space available to you.

The Interplanetary File System (IPFS) is a distributed, peer to peer, file system. It’s pretty cool. So, here’s an experimental plugin that adds backend file system support for this protocol for Known. 

Currently this functions as a drop in replacement for the Known file storage system, along the same lines as the S3 plugin. It’ll store photos, profile pictures, and any other stored data to IPFS instead of on the local file system, or in Mongo (if you’re using Mongo).

Usage 

You’ll need an IPFS server to talk to. For development I installed go-ipfs, so you can use that, or one of the public ones.

Next, copy the IPFS directory to your IdnoPlugins directory, and activate it.

By default, the plugin is set up to talk to localhost but you probably don’t want to do that forever, so update your config.ini as follows:

[IPFS]
host = 'servername'
port = 1234
apiport = 5678

Replace the values accordingly, but make sure you keep the [IPFS] section header.

Still to do

At the moment, this is a drop in functional replacement for file storage, and doesn’t go into some of the cooler things you can do with Content-Addressable storage.

As pointed out in this ticket, an obvious improvement would be to cache stuff from the image proxy to IPFS (which already takes place), but to directly reference them via their content hash (which doesn’t currently take place), as this should be more efficient.

Anyway, that’s future development and would require some core hooks. I’ll get to that next, I’m sure.

Anyway, kick the tires and let me know your thoughts. Pull requests more than welcome!

» Visit the project on Github...