Mount ext4 partition with >4KiB block size

2

I'm attempting to mount a partition from a NAS and the block size is 65536 bytes, this is above my distribution's precompiled kernel memory paging size of 4KiB, so I cannot mount it normally.

Which kernel compilation parameters would I need to change to get a memory paging size large enough? Would it be possible under the x86-64 architecture?

EDIT: There doesn't seem to be an option for it in make xconfig unless I'm just missing it.

From page_types.h under arch\x86\include\asm

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT  12
#define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK   (~(PAGE_SIZE-1))`

It doesn't look to be configurable. I could change this number directly to 16 and it would probably make pretty explosions and destroy Tokyo. I shall probably try it later this evening.

OmnipotentEntity

Posted 2011-05-31T20:18:16.070

Reputation: 1 322

1

as per this answer it seems this can be fixed with fuse-ext2

– phuclv – 2017-09-11T16:45:32.757

Answers

1

From page_types.h under arch\x86\include\asm

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT  12
#define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK   (~(PAGE_SIZE-1))

changing the 12 into a 16 results in

arch/x86/kernel/head64.c: In function ‘x86_64_start_kernel’:
arch/x86/kernel/head64.c:71: error: negative width in bit-field ‘<anonymous>’
make[2]: *** [arch/x86/kernel/head64.o] Error 1

Because this is just sanity checking code for modules offsets it seems that changing the memory paging size has a lot of unintended side effects which will make this far from simple. I guess I'm stuck with finding another arch to run on. :(

Here is a list of the archs that support 64KiB or greater page sizes: ia64, mips, pa-risc, powerpc, sh, sparc64. So it looks like my best bet it to find an old-PPC Mac.

OmnipotentEntity

Posted 2011-05-31T20:18:16.070

Reputation: 1 322

Why don't just grab a MIPS or PPC (or any of the above supported architectures) emulator (like qemu)? You can then mount the partition in the VM – phuclv – 2017-09-10T11:37:26.520

1@LưuVĩnhPhúc At the time I wrote this I was working for Geek Squad in their data recovery department, and we had strict rules on software that we could and could not use. But that would be the most reasonable thing to do, yes. – OmnipotentEntity – 2017-09-10T15:02:29.773

0

You need to change your kernel page size. Not recommending it, but possible I suppose.

It has nothing to do with your architecture though. (i.e. if its possible, it can be done with your architecture, and if it can't its not because of your architecture)

soandos

Posted 2011-05-31T20:18:16.070

Reputation: 22 744

http://superuser.com/questions/242055/mounting-ext4-fs-with-block-size-of-65536 ;) I also definitely have an ext4 partition with 64k block size. – OmnipotentEntity – 2011-05-31T20:25:07.153

Didn't see that :) but it seems that the upvoted answer agrees with me. I guess that means that you need to change the kernel page size to get it to work. – soandos – 2011-05-31T20:27:23.473

Yes, and my specific question was is it possible with the x86_64 arch and if so, which parameters do I need to change. :D – OmnipotentEntity – 2011-05-31T20:32:01.140

So yes, it is, you need to change the kernel page size in the kernel. It not some option lying around, but probably (speculation) will require a recompilation of the kernel (or have someone do it for you). Why does it matter btw? – soandos – 2011-05-31T20:36:37.497

Yes, it will require recompiling the kernel, this is not that big of a deal to me, I just need to know which parameter I need to change in the kernel's configuration wizard. All of this I mentioned in the original question btw. ;) It matters because my NAS died and I need the information off of it. – OmnipotentEntity – 2011-05-31T20:38:14.453

Ah. I have no idea. – soandos – 2011-05-31T20:44:45.230