Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How can I increase the number of inodes in an ext4 filesystem?

An old headless no-X backup server I use has a small hard drive with three primary ext4 partitions: /, /home and /swap. The system is unable to run updates, as there are insufficient inodes available on the 1.5GB / partition. There is unused space available on /home.

Would resizing the / partition from a live GParted environment solve this? Would more inodes be created by this process?

This answer indicates that it is not possible to create more inodes after a filesystem has been created. I assume that this does not involve resizing the partition. This answer suggests recreating the filesystem to obtain more inodes.

share|improve this question

marked as duplicate by Gilles, Renan, rahmu, Thor, uther Jan 31 '13 at 2:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

While you can resize an ext partition (with eg. gparted), it would seem that you cannot adjust the number of inodes, which by implication means that the bytes-per-inode increases or decreases with resizing. Beware the fact that "bytes-per-inode" and "inode size" are not the same thing.

So: you can resize your /home partition down (decreasing the bytes-per-inode), but with regard to the root partition, you will have to reformat it if you want to increase the number of inodes.

Another option would be to resize the root partition down, create a new partition with a smaller bytes-per-inode (see the -i option in man mke2fs), and mount /usr/share (or something with a lot of small files) there.

tune2fs -l will give you the "Inode count:" and other information regarding a ext filesystem.

rsync -aE will be useful if you have to mirror/backup and resize a partition.

share|improve this answer
    
Thanks. Please explain what you mean by "mirror the partitions". Do you mean backup/copy them elsewhere, reformat, then restore? – SabreWolfy Jan 30 '13 at 8:16
2  
Just copy the contents into a subdirectory of another filesystem. So you need a) another drive of sufficient size, and b) a means of copying them. rsync -aE will do this, and it can even be done over a network. But try gparted first, I'm sure if you shrink home it will lose inodes and when you grow / it will get them. You can check before and after with fsck. – goldilocks Jan 30 '13 at 8:20
1  
The documentation of mke2fs explicitly states “it is not possible to expand the number of inodes on a filesystem after it is created”. tune2fs can't do it. resize2fs can't do it. So what makes you think against all odds that it is in fact possible? – Gilles Jan 30 '13 at 23:02
1  
@Gilles: Because other documentation states that the inode size cannot change either, and I took "inode size" as synonymous with "bytes-per-inode", which it turns out not to be, lol...but if it were, then when you resize a partition, one of those (inode size or number of inodes) must change. I tried this just now with gparted and indeed, the number of inodes does not change. So I substantially re-wrote the post to reflect this -- all apologies ;) I think my advice WRT backup and reformat was/is sound, – goldilocks Jan 31 '13 at 2:06
1  
goldilocks was right the first time. man mkfs.ext4, search for -i option (bytes-per-inode). "Note that resizing a filesystem changes the numer of inodes to maintain this ratio." Verified experimentally, resizing from 1G to 10G and looking at tune2fs /dev/X | grep Inode. (It's easy to experiment like this if you installed your system using LVM partitions & left yourself free space to play with :). – sourcejedi Jan 7 at 13:52

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