LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-21-2016, 05:13 AM   #1
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Defining 64KiB block size for VirtualBox VDI hard disk


Hi there,

I would like to do some testing of the ext4 filesystem on a device with a 64KiB block size. Not having one of those to hand, unsurprisingly, I thought I could look into creating a VirtualBox VM hard disk with a 64KiB block size, then installing Linux on it.

Does anybody know how (i) I can specify the block size of a VirtualBox VDI hard disk when I am creating it (or am I constrained by the physical structure of the underlying disk where the VDI is stored?); (ii) Whether I'll have any problems installing Linux on such a device?

Of course there may be alternative ways of emulating a 64KiB block sized device so that mke2fs allows creation of a 64KiB-blocksize ext4 filesystem on it without producing warnings - I'm all ears!
 
Old 05-21-2016, 08:39 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You have to emulate it (use the "-b block-size" of mke2fs).

As far as I know, there are no disks that implement a 64k block size. A RAID controller CAN do that (it would take 16 disks with a 4k native block size) - but even there it still defaults (to my knowledge) to a 4K default (and you want to make the block size the span size of the RAID configuration).

Part of the reason for using that size would be to force preallocation (the smallest file would be one block - 64kb in size)...

Last edited by jpollard; 05-21-2016 at 08:43 AM.
 
1 members found this post helpful.
Old 05-21-2016, 09:52 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Note that the kernel's ext4 driver does not support block sizes larger than 4096 bytes. That's what the warning is about. You would have to install the fuseext2 package to use such a filesystem.
 
1 members found this post helpful.
Old 05-21-2016, 10:23 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
That 4k limit is not rigid - it does I/O in page size units which are 4K.

But you can also specify the stripe (https://www.kernel.org/doc/Documenta...stems/ext4.txt)

Code:
stripe=n		Number of filesystem blocks that mballoc will try
			to use for allocation size and alignment. For RAID5/6
			systems this should be the number of data
			disks *  RAID chunk size in file system blocks.
And there is no specific limitation on the block size.

From what I can find, it appears the only limitations is the system page size...
 
Old 05-21-2016, 12:31 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by jpollard View Post
That 4k limit is not rigid - it does I/O in page size units which are 4K.

But you can also specify the stripe (https://www.kernel.org/doc/Documenta...stems/ext4.txt)

Code:
stripe=n		Number of filesystem blocks that mballoc will try
			to use for allocation size and alignment. For RAID5/6
			systems this should be the number of data
			disks *  RAID chunk size in file system blocks.
And there is no specific limitation on the block size.

From what I can find, it appears the only limitations is the system page size...
Yes, and the system page size on x86 is 4096 bytes. If you build a filesystem with a larger block size ("-b" option), the kernel's driver won't be able to mount it. The "stripe=n" parameter is a mount option. You can use that to get allocation and alignment in units larger than the filesystem block size.
 
1 members found this post helpful.
Old 05-21-2016, 04:21 PM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048

Original Poster
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Thanks to both of you.

I've just confirmed that I can force a 64KiB block-sized ext4 filesystem but that the kernel ext4 driver refuses to mount it.
 
Old 05-21-2016, 05:52 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by hydrurga View Post
Thanks to both of you.

I've just confirmed that I can force a 64KiB block-sized ext4 filesystem but that the kernel ext4 driver refuses to mount it.
Out of curiosity, did you try to mount using the stripe= option instead?
 
Old 05-22-2016, 01:48 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048

Original Poster
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by jpollard View Post
Out of curiosity, did you try to mount using the stripe= option instead?
No, because I wanted to try out the 64KiB block size, as in create, mount and run the filesystem with the actual structure oriented round 64KiB blocks and the superblock field s_log_block_size set to 6. I assumed that the stripe=n mount option would keep the structure at 4KiB and s_log_block_size set at 2, only affecting mballoc's allocation of contiguous blocks, or something like that.

However, to be honest, I don't really understand RAID or strides/stripes.
 
Old 05-22-2016, 08:01 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Did you try the fuseext2 package, which is available for Mint 17? My understanding is that the fuseext2 command should be able to mount that filesystem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot resize VirtualBox .vdi file when created from physical disk Vanyel Linux - Virtualization and Cloud 1 02-16-2013 10:53 PM
Resizing VirtualBox VDI hard drive for Windows XP on a Fedora 17 host gelam Linux - Virtualization and Cloud 1 06-03-2012 11:08 PM
Is there a way to increase the VDI size in VirtualBox on Fedora 9? Mr. Rey Linux - Software 10 05-24-2010 08:05 AM
VirtualBox virtual disk image backup? .vdi .sav brianpbarnes Linux - Software 3 07-17-2009 02:12 PM
copy hard disk from xp to vdi file for virtualbox[zenwalk] deathalele Linux - Software 3 06-23-2009 06:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration