"inode_size (128) * inodes_count (0) too big for a filesystem with 0 blocks" while creating a file system
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?
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.
You have to run the
partprobe command to update the table
In a RHEL8 I created the new partition extended as type "Linux".
mkfs.ext4 to format it, and
And after many reboots the partition remains.
cat /proc/partitions will result in
major minor #blocks name 8 0 292968750 sda 8 1 1048576 sda1 8 2 70637568 sda2 **8 3 1 sda3** 8 16 292968750 sdb 8 17 143373716 sdb1 253 0 63463424 dm-0 253 1 7168000 dm-1 11 0 1048575 sr0
partprobe and ran
major minor #blocks name 8 0 292968750 sda 8 1 1048576 sda1 8 2 70637568 sda2 8 3 221281582 sda3 8 16 292968750 sdb 8 17 143373716 sdb1 253 0 63463424 dm-0 253 1 7168000 dm-1 11 0 1048575 sr0
After above results. I ran below command successfully.
mkfs -t ext4 /dev/sda3