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 🙂