Partition shrink

Several times we need re-size our storage area. Normally, we expand volumes, but never shrink. Although it’s not common, this is possible too. Surfing on the web, I found that great article.

My tests worked gracefully! I extended this article above re-sizing the virtual disk image file, with qemu-img.

qemu-img convert -f qcow2 -O raw resize.img resize_raw.img
qemu-img resize resize_raw.img 5360321024
qemu-img convert -f raw -O qcow2 resize_raw.img resize.img

5360321024 is exactly the size in bytes of the sum of all partitions.

LinuX Containers in Slackware64

Linux Containers, or LXC, is a type of virtualization in process level. It uses cgroup feature of Linux to work. This way, it creates namespaces to create isolated environment for its process. More details can be found here.

This is a lightweight model of virtualization, because it isn’t a full virtual machine. The same kernel that runs on the host, serves directly the isolated process. Using containers have security impact, once the process encapsulated doesn’t see processes outside of container, and several times you run just needed services in it.

As I said before, the magic happens using cgroup kernel feature, so it must be enabled. The lxc userspace tool must be installed as well. Some templates comes with lxc tool, for debian, fedora, ubuntu… but I never tested it. I have tested on my Slackware64 14.0, following this template. Worth reading.