No space left on device

Last night I decided to do some tests with portage inside a virtual machine using iloog livecd. I fired up vmware player (it’s free) and created one 1Gb partition, type Linux and one 1Gb partition, type swap with fdisk. Then I issued :

#mke2fs -j /dev/hda1
#mkdir /mnt/hda1
#mount /dev/hda1 /mnt/hda1
#mkdir /mnt/hda1/portage
#mkdir /usr/portage
#mount --bind /mnt/hda1/portage /usr/portage
#emerge --sync

The syncing with gentoo portage had started.. After a while though, my screen got full off errors about not having enough space left on the device. That was a bit weird since 1Gb is more than enough for just the portage without any distfiles or packages… Issuing a “df -HT” gave me something like this:

/dev/hda1 ext3 985M 557M 379M 60% /mnt/hda1

So, I do have space free…where was the problem ? Luckilly some friends on IRC gave me the answer…

#df -i
/dev/hda1 120000 120000 0 100% /mnt/hda1

I was out of inodes…The portage has so many small files that made me run out of inodes and the only solution was to run mke2fs again but with options that look like the following, in order to increase the inode number by decreasing the block size:
mke2fs -j -b 1024 -i 1024 /dev/hda1

That gave me enough inodes to store the portage 🙂

Ευρωπαικά Ερευνητικά Δίκτυα

Στα πλαίσια της τελευταίας εκδήλωσης του ΕΔΕΤ Grnet Tech Event o κ. Μάγκλαρης, πρόεδρος του NREN-PC έδωσε μια ομιλία για τα ευρωπαικά ερευνητικά δίκτυα, μέλος των οποίων είναι το ΕΔΕΤ. Εξηγεί αρκετά καλά την ιστορία των δικτύων στην Ευρώπη καθώς και ποιες είναι οι τάσεις αυτό το καιρό (10-40-100Gbit, dark fiber, virtual open source routers, κτλ).

Δείτε το Video για να καταλάβετε τον νέο “ψηφιακό πόλεμο” και το “ψηφιακό χάσμα” στην “δημοκρατική Ευρώπη”.

dynamic hostname updates with DHCPd + BIND

The following text describes the way to make DHCPd create DNS records of dhcp clients. This scenario is usually called a DDNS server.

We will first setup up BIND and then DHCPd.
1) We need to create a “key”. A key is a password that allows dhcpd to update bind… imagine something like an authentication scheme. In order to create such a key file to the following:
# rndc-confgen -a
A key file will be created. On Gentoo Linux this file is put inside /etc/bind/ and is called “rndc.key”.
Now open up your named.conf file and put these line inside:
include "/etc/bind/rndc.key";
controls {
inet allow { localhost; } keys { rndc-key; };

If you already have a controls section just modify it to include the keys { } directive.

Now, in your zones that you want to be dynamically updated modify them to look like this:

zone "" {
type master;
file "pri/";
allow-update { key "rndc-key"; };
notify yes;
zone "" {
type master;
file "pri/";
allow-update { key "rndc-key"; };
notify yes;

The “allow-update” is the crucial part here.
If you’ve done that changes we are finished from the BIND configuration. Restart the service and you are done.

2)Time for DHCPd configuration.
Remember your rndc-key file ? Open it and paste it contents inside your dhcpd.conf file so it looks a bit like this:
key "rndc-key" {
algorithm hmac-md5;
secret "goa6aw7a9WwapCyai0naZQ==";

Among others you have to put the zone files that you want to be updated. Following my previous zone declaration in named.conf and supposing that the primary nameserver is, that should be:

zone {
key rndc-key;
zone {
key rndc-key;

Now some generic configuration stuff to allow dynamic dns updates:

ddns-update-style interim;
ddns-domainname "";
use-host-decl-names on;
allow client-updates;
option oe-key code 159 = string;
option oe-gateway code 160 = ip-address;
on commit {
if (not static and
((config-option server.ddns-updates = null) or
(config-option server.ddns-updates != 0))) {
if exists oe-key {
set ddns-rev-name =
concat (binary-to-ascii (10, 8, ".",
reverse (1, leased-address)), ".",
pick (config-option server.ddns-rev-domainname,
set full-oe-key = option oe-key;
switch (ns-update (delete (IN, 25, ddns-rev-name, null),
add (IN, 25, ddns-rev-name, full-oe-key,
lease-time / 2)))
unset ddns-rev-name;
on release or expiry {
switch (ns-update (delete (IN, 25, ddns-rev-name, null))) {
unset ddns-rev-name;

(weird huh ? Nope that’s not mine … I just copied it from someplace on the web)

I will now show you my subnet configuration. Change it to fit your needs:

subnet netmask {
option domain-name-servers;
option domain-name "";
option routers;
default-lease-time 600;
max-lease-time 7200;
update-static-leases on;
host PC1 {
hardware ethernet 00:12:34:56:78:ab;
option host-name "PC1";
DDNS-hostname "PC1";

With this configuration, all clients on the subnet will be given IP addresses in the range –, except from the PC with MAC address 00:12:34:56:78:ab that will be given IP The ” update-static-leases on;” is very important for PC1. Unless it is defined no updates to DNS records would be created for it.

Now restart DHCPd, make a client DHCP request and check your log file (/var/log/messages probably) for the results.

You can read more about the ddns server subject at the following places:

It’s quite usefull if you have a need for it 🙂

Netroute firmware 577

After asking some people, I have finally decided to post netroute’s firmware version 577 on my blog.

I hope I won’t be forced to remove it any time soon…so here it is: netroute-firmware-577.tar.gz

I won’t publish any update instructions. You are on your own…I don’t want to be held responsible if you bork your router…