Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

add comment

1 Answer 1

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
1  
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
    
@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
    
Bytes per inode isn't a filesystem feature, it's just the ratio of the number of bytes divided by the number of inodes. The inode size rarely changes, it's only useful to enlarge this to store more extended attributes. The number of inodes is fixed at filesystem creation time with ext4. resize2fs changes the number of data blocks. A data block stores a fragment of a file; with more data blocks, you can store files whose total size is larger, but you still need one inode per file so at some point you may run into the inode limit. –  Gilles Jan 31 '13 at 12:43
show 1 more comment

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