Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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