3

I've done that:

mkfs.ext4 -j -b 8192 /dev/sda3

Now I'm trying to mount it with:

sudo mount -t ext4 /dev/sda3 foo 

But I'm getting this error:

mount: wrong fs type, bad option, bad superblock on /dev/sda3

What's the problem?

2

1 Answer 1

2

As I know, such huge block is not supported on x86 platform. The problem is: ext*fs is based on generic VFS framework and it can't work when block size is greater than page size (4096 on x86). On Itanium and other exotic architectures with > 4KB memory pages (but not on x86/x86_64 with 2MB or 4MB pages) such blocksize may work. The same problem in linux is with ufs2 with fragment size > 4096.

This knowledge is based on information from one UFS2/Linux developer. There are also some letters in lists, like question answer

Citing answer from "Andreas Dilger"

Linux requires blocksize <= PAGE_SIZE, so basically all filesystems use blocksize <= 4096 unless they implement support internally for reading/writing partial disk blocks from the page or buffer cache.

With ext2/3 it is possible to change the number of inodes allocated without changing the blocksize (less inodes per block group).

For UFS2 there is an explicit check for fragment_size <= 4096. I think there is the same check in ext*fs.

Basically you need not to set so huge blocksize for ext4, if extents are enabled. Extents are very like huge blocks for huge files. With extens you will have more performance and less fragmentation, but they are unsupported (not backward compatible) in older Linux kernels or some older drivers for third OSes, like Windows.

4
  • So at my x86 is impossible to have an partition with block size greater than 4096? Even if it's not ext*? Mar 8, 2012 at 14:39
  • This is true for UFS1/UFS2, ext2, sunVFS and similar fs. Any other may work or may not work. Also, What is your task? If you want less fragmentation, use ext4 with extens enabled (extent is just like huge variable-sized blocks); if you want to use more space of your HDD, play with options of mkfs.
    – osgx
    Mar 8, 2012 at 14:41
  • x86 can also support huge page size
    – phuclv
    Sep 7, 2017 at 15:57
  • Linux VFS uses 4Kb pages internally (logically), not any of "huge" or "large" or "super" or "PDPE1GB" pages. Your comment is not relevant to the VFS problem I had. There is possible variant of reimplementing the target FS in userspace and mounting it as FUSE (or searching for ext4-fuse or ufs2-fuse and testing their 8kb block/fragment support).
    – osgx
    Sep 7, 2017 at 17:23

Not the answer you're looking for? Browse other questions tagged .