I have a machine at a datacenter with 3HDDs and running Debian Wheezy, at one of them I have an ext4 filesystem mounted on /data that has ran out of inodes (I've chosen an inappropriate inode size at install/had more tiny files than expected).

There's no problem in copying the partition content to another one, but I want to know which preventive measures should I have to do this process in a "production environment" (nothing serious btw).

I need to avoid rebooting the machine and make the new filesystem -recreated- mountable at boot

Thanks! -Rodrigo


If you cannot add/replace disks (in which case, if you used LVM, you could grow your ext4 and hence number of inodes on it), you best path is:

  1. backup data to some other partition having enough free space (using tar(1), or if you need to minimize downtime for accessing data: rsync(1))
  2. this step only if you need to minimize downtime: rsync again, then shutdown access to that partition, do rsync again (which will now be fast, as it only transfers changes), and point/symlink your data directory to new partition directory, and then reenable access to new (temporary) partition directory.
  3. reformat the now unused partition with more inodes
  4. restore data back (using same tricks from (2) if you needed to minimize downtime)
  5. remove temporary .tar.gz/rsync directory (or keep it as free backup)

In production, you'll be using LVM so you can resize your filesystems (ext4 will also grow inodes on resize). And you would always err on the side on too much inodes (or space in general), not too little. And/or using XFS which have dynamic inodes instead of ext4.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.