5

My partition table looks like this:

 Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    32505855    16251904   83  Linux
/dev/sda2        32505856    33554431      524288   83  Linux

When I went to lay down a filesystem on sda2, it threw this error:

sudo mkfs -t ext4 /dev/sda2
mke2fs 1.42.9 (4-Feb-2014)
mkfs.ext4: inode_size (128) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i) or lower inode count (-N).

I have tried both with an extended partition and a primary partition and get the same error. I have Ubuntu 14.04TLS. What to do?

  • You reached 15 point of reputation, from now you can upvote questions (next to accepting them), if you are satisfied with them. – peterh Aug 29 '14 at 14:15
6

1: it doesn't have to do anything with primary/extended/logical partitions.

2: I think you wanted to say "logical" partition instead of "extended".

3: mkfs thinks your partition size if 0 bytes. It was very surely, because the kernel wasn't able to update the partition table after a repartitioning. After you edited the partition table, didn't you get some warnings about that a reboot is needed?

On Linux, there is two different partition table: there is one on the zeroth block of the hard disk. And there is one in the kernel memory. You can read the first with an fdisk -l /dev/sda command. And the second can you read with a cat /proc/partitions command. These two need to be in sync, but it is not always possible. For example, you can't change the limits of a currently used partition. In this case, the kernel partition table won't changed.

You can let the kernel re-read the disk partition table with the command blockdev --rereadpt /dev/sda. Most partitioning tools execute this command after they wrote out your newly changed partition table to the disk.

The problem is that only newer linux kernels are capable to re-read a partition table of a used hard disk. From this viewpoint, a hard disk is considered as "used" if there is a simple partition which is used on it, either by a tool, or a mount point or it is an active swap partition.

And even these newer kernels aren't able to change the limits of a partition currently being used.

I think, your root system is on /dev/sda, thus you need to do a reboot after you did a repartitioning.

  • Yep, you're right. I haven't rebooted. So as you can see I wiped out my swap partition and commented it out in fstab, so do you think there will be an issue with the reboot? I have been told you really don't need a swap partition. – user53029 Aug 29 '14 at 21:51
  • also, I ran the blockdev command and it failed as well so cat /proc/partitions still reflect the old kernel mapping. The error I got after running the blockdev command was a resource busy error - like I needed to reboot for that as well. Kernel is 3-13-0-29 – user53029 Aug 29 '14 at 21:59
  • @user53029 Sorry for the late react - ein blockdev --rereadpt /dev/sdX re-reads the partition table, if it is possible (and gives an error if it is not). – peterh Oct 10 '18 at 11:47

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.