LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-30-2019, 06:00 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,564

Rep: Reputation: 177Reputation: 177
Confusion on RAID chunk size


I'm creating a 2TB RAID-1, which I've done before, but I'm puzzled on this one. I've created /dev/md0 as:
Code:
mdadm --create /dev/md0 --metadata=0.9 --verbose --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
When it finished, /proc/mdstat gives:
Code:
md0 : active raid1 sdb2[1] sda2[0]
      1936736256 blocks [2/2] [UU]
      bitmap 0/15 pages [0KB], 65536KB chunk
I'm about to format /dev/md0, and I've normally used:
Code:
mkfs.ext4 -v -m .1 -b 4096 -E stride=<s>,stripe-width=<w> /dev/md0
where stride <s> = chunk / block size; and stripe-width <w> = stride * 2.

However, my documentation and Internet examples show typical chunk sizes of 128KB (with some variation) whereas mdstat show mine as 65536KB, This is quite different and no examples show chunk sizes that big. I'm wondering if that's a qood number? If I use 65536 to calculate my stride and strip-size I get 16384 (assuming block size of 4KB) and 32768 respectively.

I understand that chunk size is the number of consecutive blocks written to each drive. 65536 seems like a rather large number.

These values just seem wrong. Can someone please straighten me out?

Last edited by mfoley; 11-30-2019 at 06:04 AM.
 
Old 12-01-2019, 03:46 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The man page states (typos included)
Quote:
The default when creating an array is 512KB. To ensure compatibility with earlier versions, the default when Building and array with no persistent metadata is 64KB.
Your relatively small chunk size can be explained by the old metadata version you requested.

There is also a paragraph on chunks in the md wiki.

I don't think the stride and stripe-width parameters make sense for a RAID1, which is not striped but simply mirrored (though they probably don't hurt either).

Last edited by berndbausch; 12-01-2019 at 03:52 AM.
 
  


Reply

Tags
raid1



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When growing raid: "mdadm: component size must be larger than chunk size." - but it is... Paul.C Linux - Server 7 01-18-2019 12:58 AM
writing to a file chunk by chunk manolakis Programming 10 10-25-2014 07:40 AM
[SOLVED] Can anyone explain what is chunk size and spare size in unyaffs chinabenjamin66 Linux - Newbie 1 10-22-2012 12:01 AM
software raid 0 and raid 5: which chunk size to choose? malo_umoran Linux - General 2 02-26-2007 06:19 PM
disk druid and raid chunk size Zvezda Red Hat 0 05-08-2004 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:39 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