linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* alignment of metadata 1.2 and mkfs.ext4
@ 2011-07-06  7:10 Tyler J. Wagner
  0 siblings, 0 replies; 8+ messages in thread
From: Tyler J. Wagner @ 2011-07-06  7:10 UTC (permalink / raw)
  To: linux-raid

Hi all (well, Neil, really),

The the following, Neil states that that is no issue with alignment of
metadata 1.2 and mkfs.ext4 on 4K drives:

http://www.issociate.de/board/post/507176/filesystem_on_mdadm_raid_from_unpartioned_block_devices.html

Sorry to ask again, but I just want to clarify. Metadata 1.2 puts the
data 4K from the start of the device/partition. Does mkfs put the start
of the filesystem at 64K from the start? IE, will the following align,
without any need for options?

(create partitions starting 2048 512-byte sectors from start = 1MB)
mdadm --create /dev/md0 -v --raid-devices=4 --level=raid10
--metadata=1.2 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
mkfs.ext4 /dev/md0

And, slightly off-topic, it's not necessary to define stride and stripe
any longer?
mkfs.ext4 -E stride=16,stripe-width=32 /dev/md0

Regards,
Tyler

-- 
Tyler J. Wagner
Chief Technical Officer, Talia Ltd
http://www.talia.net
email: tyler@talia.net
mobile: +44 790 863 1442
office: +44 203 3181 500 x503
fax: +44 207 631 3343


^ permalink raw reply	[flat|nested] 8+ messages in thread

* alignment of metadata 1.2 and mkfs.ext4
@ 2011-07-06  7:11 Tyler J. Wagner
  2011-07-06  8:35 ` Werner Fischer
  2011-07-06  9:20 ` Roman Mamedov
  0 siblings, 2 replies; 8+ messages in thread
From: Tyler J. Wagner @ 2011-07-06  7:11 UTC (permalink / raw)
  To: linux-raid

Hi all (well, Neil, really),

The the following, Neil states that that is no issue with alignment of
metadata 1.2 and mkfs.ext4 on 4K drives:

http://www.issociate.de/board/post/507176/filesystem_on_mdadm_raid_from_unpartioned_block_devices.html

Sorry to ask again, but I just want to clarify. Metadata 1.2 puts the
data 4K from the start of the device/partition. Does mkfs put the start
of the filesystem at 64K from the start? IE, will the following align,
without any need for options?

(create partitions starting 2048 512-byte sectors from start = 1MB)
mdadm --create /dev/md0 -v --raid-devices=4 --level=raid10
--metadata=1.2 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
mkfs.ext4 /dev/md0

And, slightly off-topic, it's not necessary to define stride and stripe
any longer?
mkfs.ext4 -E stride=16,stripe-width=32 /dev/md0

Regards,
Tyler


-- 
"The belief in immortality has always seemed cowardly to me. When very
young I learned that all things die, and all that we wish of good must
be won on this earth or not at all."
   -- Anne Smedley


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: alignment of metadata 1.2 and mkfs.ext4
  2011-07-06  7:11 Tyler J. Wagner
@ 2011-07-06  8:35 ` Werner Fischer
  2011-07-06  9:20 ` Roman Mamedov
  1 sibling, 0 replies; 8+ messages in thread
From: Werner Fischer @ 2011-07-06  8:35 UTC (permalink / raw)
  To: Tyler J. Wagner; +Cc: linux-raid

Hi all,

like Tyler I'm also asking me those questions.
Reason is that newer Solid-State Drives (like the Intel 320 Series) have
Flash-Chips with page size of 8KiB (the former SSDs have mostly 4KiB
pages). So in the best case, all data written to such an SSD should be
at least 8KiB aligned - which I think is not the case for MD-RAID with
metadata 1.2 superblocks - because of the "4K from the beginning of the
device":
https://raid.wiki.kernel.org/index.php/RAID_superblock_formats#Sub-versions_of_the_version-1_superblock
When I understand the wiki page correctly, the metadata 1.2 superblock
has a size of 1024 Bytes (256 Bytes + 2 Bytes/device for a maximum of
384 devices), right?

When I simply put an Ext4 file system with a block size of 4KiB on the
RAID, there is no problem as there will always be two Ext4 blocks
residing in a single 8 KiB page of the SSD.

My questions:
1) But when I use LVM2 with a PE size of 4 MiB on top of a RAID, I will 
   not be perfectly aligned any more, right?
2) Are there any plans that e.g. the first 1MiB will be reserved for 
   metadata (like fdisk does when creating new partitions), so that 
   there won't be any alignment issues in the future?
     (btw: haven the metadata at the end of the device like in the 
     metadata format 0.90 or 1.0 would also not interfere the alignment 
     - is there a special reason why the metadata has been put to the 
     beginning of the device?)

best regards,
Werner

On Wed, 2011-07-06 at 08:11 +0100, Tyler J. Wagner wrote:
> Hi all (well, Neil, really),
> 
> The the following, Neil states that that is no issue with alignment of
> metadata 1.2 and mkfs.ext4 on 4K drives:
> 
> http://www.issociate.de/board/post/507176/filesystem_on_mdadm_raid_from_unpartioned_block_devices.html
> 
> Sorry to ask again, but I just want to clarify. Metadata 1.2 puts the
> data 4K from the start of the device/partition. Does mkfs put the start
> of the filesystem at 64K from the start? IE, will the following align,
> without any need for options?
> 
> (create partitions starting 2048 512-byte sectors from start = 1MB)
> mdadm --create /dev/md0 -v --raid-devices=4 --level=raid10
> --metadata=1.2 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
> mkfs.ext4 /dev/md0
> 
> And, slightly off-topic, it's not necessary to define stride and stripe
> any longer?
> mkfs.ext4 -E stride=16,stripe-width=32 /dev/md0
> 
> Regards,
> Tyler
> 
> 

-- 
: Werner Fischer
: Technology Specialist
: Thomas-Krenn.AG | The server-experts
: http://www.thomas-krenn.com | http://www.thomas-krenn.com/wiki


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: alignment of metadata 1.2 and mkfs.ext4
  2011-07-06  7:11 Tyler J. Wagner
  2011-07-06  8:35 ` Werner Fischer
@ 2011-07-06  9:20 ` Roman Mamedov
  2011-07-06  9:52   ` Tyler J. Wagner
  1 sibling, 1 reply; 8+ messages in thread
From: Roman Mamedov @ 2011-07-06  9:20 UTC (permalink / raw)
  To: Tyler J. Wagner; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

On Wed, 06 Jul 2011 08:11:16 +0100
"Tyler J. Wagner" <tyler@tolaris.com> wrote:

> Metadata 1.2 puts the data 4K from the start of the device/partition.

This is not correct. See mdadm -E /dev/sdX.

$ sudo mdadm -E /dev/sdc3
/dev/sdc3:
...
        Version : 1.2
...
    Data Offset : 2048 sectors
...


-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: alignment of metadata 1.2 and mkfs.ext4
  2011-07-06  9:20 ` Roman Mamedov
@ 2011-07-06  9:52   ` Tyler J. Wagner
  2011-07-06 10:02     ` Roman Mamedov
  2011-07-06 10:03     ` Robin Hill
  0 siblings, 2 replies; 8+ messages in thread
From: Tyler J. Wagner @ 2011-07-06  9:52 UTC (permalink / raw)
  To: Roman Mamedov; +Cc: linux-raid

On Wed, 2011-07-06 at 15:20 +0600, Roman Mamedov wrote:
> On Wed, 06 Jul 2011 08:11:16 +0100
> "Tyler J. Wagner" <tyler@tolaris.com> wrote:
> 
> > Metadata 1.2 puts the data 4K from the start of the device/partition.
> 
> This is not correct. See mdadm -E /dev/sdX.
> 
> $ sudo mdadm -E /dev/sdc3
> /dev/sdc3:
> ...
>         Version : 1.2
> ...
>     Data Offset : 2048 sectors
> ...

That is very interesting. The mdadm man page, and everything I've seen
online, all say "The different sub-versions store the superblock at
different locations on the device, either at the end (for 1.0), at the
start (for 1.1) or 4K from the start (for 1.2)."

Regards,
Tyler

-- 
"Religion is the opiate of the masses, so long as the masses are straight. 
However, amass a bunch of lesbians and you're going to need actual drugs."
   -- OKCupid Blog, with apologies to Karl Marx
      http://blog.okcupid.com/index.php/gay-sex-vs-straight-sex/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: alignment of metadata 1.2 and mkfs.ext4
  2011-07-06  9:52   ` Tyler J. Wagner
@ 2011-07-06 10:02     ` Roman Mamedov
  2011-07-06 13:40       ` Tyler J. Wagner
  2011-07-06 10:03     ` Robin Hill
  1 sibling, 1 reply; 8+ messages in thread
From: Roman Mamedov @ 2011-07-06 10:02 UTC (permalink / raw)
  To: Tyler J. Wagner; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

On Wed, 06 Jul 2011 10:52:34 +0100
"Tyler J. Wagner" <tyler@tolaris.com> wrote:

> That is very interesting. The mdadm man page, and everything I've seen
> online, all say "The different sub-versions store the superblock at
> different locations on the device, either at the end (for 1.0), at the
> start (for 1.1) or 4K from the start (for 1.2)."

And? The quote is about location of the mdadm superblock (metadata), not alignment or offset of user data.

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: alignment of metadata 1.2 and mkfs.ext4
  2011-07-06  9:52   ` Tyler J. Wagner
  2011-07-06 10:02     ` Roman Mamedov
@ 2011-07-06 10:03     ` Robin Hill
  1 sibling, 0 replies; 8+ messages in thread
From: Robin Hill @ 2011-07-06 10:03 UTC (permalink / raw)
  To: Tyler J. Wagner; +Cc: Roman Mamedov, linux-raid

[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]

On Wed Jul 06, 2011 at 10:52:34AM +0100, Tyler J. Wagner wrote:

> On Wed, 2011-07-06 at 15:20 +0600, Roman Mamedov wrote:
> > On Wed, 06 Jul 2011 08:11:16 +0100
> > "Tyler J. Wagner" <tyler@tolaris.com> wrote:
> > 
> > > Metadata 1.2 puts the data 4K from the start of the device/partition.
> > 
> > This is not correct. See mdadm -E /dev/sdX.
> > 
> > $ sudo mdadm -E /dev/sdc3
> > /dev/sdc3:
> > ...
> >         Version : 1.2
> > ...
> >     Data Offset : 2048 sectors
> > ...
> 
> That is very interesting. The mdadm man page, and everything I've seen
> online, all say "The different sub-versions store the superblock at
> different locations on the device, either at the end (for 1.0), at the
> start (for 1.1) or 4K from the start (for 1.2)."
> 
That's the RAID superblock at 4K, not the data.

Cheers,
    Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <robin@robinhill.me.uk> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: alignment of metadata 1.2 and mkfs.ext4
  2011-07-06 10:02     ` Roman Mamedov
@ 2011-07-06 13:40       ` Tyler J. Wagner
  0 siblings, 0 replies; 8+ messages in thread
From: Tyler J. Wagner @ 2011-07-06 13:40 UTC (permalink / raw)
  To: Roman Mamedov; +Cc: linux-raid

On Wed, 2011-07-06 at 16:02 +0600, Roman Mamedov wrote:
> And? The quote is about location of the mdadm superblock (metadata),
>  not alignment or offset of user data.

Ah, I mistyped in my original email. However, you've shown me how to
find out where user data begins, which is what I needed to know. Thank
you.

Regards,
Tyler

-- 
"The paradox of dictating democracy, of enforcing freedom, of extorting 
emancipation."
   -- Niall Ferguson, Colossus: The Price of America's Empire (2004)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-07-06 13:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-06  7:10 alignment of metadata 1.2 and mkfs.ext4 Tyler J. Wagner
  -- strict thread matches above, loose matches on Subject: below --
2011-07-06  7:11 Tyler J. Wagner
2011-07-06  8:35 ` Werner Fischer
2011-07-06  9:20 ` Roman Mamedov
2011-07-06  9:52   ` Tyler J. Wagner
2011-07-06 10:02     ` Roman Mamedov
2011-07-06 13:40       ` Tyler J. Wagner
2011-07-06 10:03     ` Robin Hill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).