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.

Just got a new 2TB hardrive for my Debian Squeeze Box. Trying to format it in ext4 after creating a Primary partition using cfdisk.

I just did this exact process with a 120GB drive on the same system with no problems.

After searching for the returned error on Google, it seems that it usually comes up when people are trying to format an Extended partition, not a Primary. Mine is a primary and is still showing the error.

See my shell output below for the details. Any idea why this is giving so much trouble?

Output of fdisk -l:

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes  
255 heads, 63 sectors/track, 243201 cylinders  
Units = cylinders of 16065 * 512 = 8225280 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x00000000  


   Device Boot      Start         End      Blocks   Id  System  
/dev/sdb1               1      243201  1953512001   83  Linux

And then:

:~# mkfs.ext4 /dev/sdb1  
mke2fs 1.41.12 (17-May-2010)  
**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).**

tried again using /dev/sdb:

:~# mkfs.ext4 /dev/sdb  
mke2fs 1.41.12 (17-May-2010)  
/dev/sdb is entire device, not just one partition!  
Proceed anyway? (y,n) y  
/dev/sdb is apparently in use by the system; will not make a filesystem here!  
:~#
share|improve this question

migrated from stackoverflow.com May 3 '11 at 19:59

This question came from our site for professional and enthusiast programmers.

    
Possibly related: spinics.net/lists/linux-ext4/msg07885.html –  Andy May 3 '11 at 18:10
    
Is that the actual output? You have two blank lines between Disk identifier: 0x00000000 and Device Boot. Normally there is only one. Did you omit an error message such as Disk /dev/sdb doesn't contain a valid partition table? –  Mikel May 6 '11 at 23:26
    
What does partx -l /dev/sdb print? –  Mikel May 6 '11 at 23:28

2 Answers 2

Sounds like you might be running into an issue with new drives having 4KB sectors. It's a pretty new thing, and lots of tools either don't support it or need special options specified. See this LWN article for more background.

In this case the drive is reporting 512B sectors as a compatibility thing, but when you're doing sector level stuff fdisk needs to know the real sector size; what you're seeing looks exactly like what happened to this guy. Basically, run fdisk -b 4096 -u /dev/XXXX, use the c command to disable MS-DOS compat mode, then partition as you like.

share|improve this answer

You've got a couple contradictory things going on there. You can make a file system on the whole disk without a partition, but if you want to go that route (not particularly recommended for physical hardware, more useful for virtual drives) then you need to delete the partition first.

I would suggest deleting the partition, writing to disk, then creating again and writing. Something about the partition table isn't-quite-right. I can't put my finger on what but recreating it from scratch using default options is the best thing I can think of.

If that fails, create the partition a few blocks in from each end of the disk. Start at block 10 and end $total-20 or something like that and see if it goes.

share|improve this answer

Your Answer

 
discard

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