All of lore.kernel.org
 help / color / mirror / Atom feed
* Mdadm with data offsets
@ 2015-12-13  6:18 TheGerwazy .
  2015-12-13 23:50 ` Phil Turmel
  0 siblings, 1 reply; 8+ messages in thread
From: TheGerwazy . @ 2015-12-13  6:18 UTC (permalink / raw)
  To: linux-raid

Hello
I have to recreate mdadm raid 6 made with different data offsets. Some
drives have 2048 and others 262144.
I am looking for mdadm version with data offsets option for each drive.
Could somebody help me. Please ?

Regards. Gerard

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

* Re: Mdadm with data offsets
  2015-12-13  6:18 Mdadm with data offsets TheGerwazy .
@ 2015-12-13 23:50 ` Phil Turmel
  2015-12-13 23:56   ` Phil Turmel
  0 siblings, 1 reply; 8+ messages in thread
From: Phil Turmel @ 2015-12-13 23:50 UTC (permalink / raw)
  To: TheGerwazy ., linux-raid

On 12/13/2015 01:18 AM, TheGerwazy . wrote:
> Hello
> I have to recreate mdadm raid 6 made with different data offsets. Some
> drives have 2048 and others 262144.
> I am looking for mdadm version with data offsets option for each drive.
> Could somebody help me. Please ?

version 3.3 and above, I believe.  If in doubt, just compile the latest
version yourself -- no root privileges are required to compile it.  Then
run it from the current directory.

git clone git://neil.brown.name/mdadm

make
[sudo] ./mdadm ......



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

* Re: Mdadm with data offsets
  2015-12-13 23:50 ` Phil Turmel
@ 2015-12-13 23:56   ` Phil Turmel
  2015-12-14 12:03     ` TheGerwazy .
  0 siblings, 1 reply; 8+ messages in thread
From: Phil Turmel @ 2015-12-13 23:56 UTC (permalink / raw)
  To: TheGerwazy ., linux-raid

On 12/13/2015 06:50 PM, Phil Turmel wrote:
> On 12/13/2015 01:18 AM, TheGerwazy . wrote:
>> Hello
>> I have to recreate mdadm raid 6 made with different data offsets. Some
>> drives have 2048 and others 262144.
>> I am looking for mdadm version with data offsets option for each drive.
>> Could somebody help me. Please ?
> 
> version 3.3 and above, I believe.  If in doubt, just compile the latest
> version yourself -- no root privileges are required to compile it.  Then
> run it from the current directory.
> 
> git clone git://neil.brown.name/mdadm
> 
> make
> [sudo] ./mdadm ......

I should add that using --create to reconstruct an array is incredibly
dangerous (to your data) and should only be used as a last resort and
when you are 100% confident you know how to do it.  Your question
suggests that might not be true....  in which case sharing your problem
here might be wise.

Phil

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

* Re: Mdadm with data offsets
  2015-12-13 23:56   ` Phil Turmel
@ 2015-12-14 12:03     ` TheGerwazy .
  2015-12-14 12:55       ` Phil Turmel
  0 siblings, 1 reply; 8+ messages in thread
From: TheGerwazy . @ 2015-12-14 12:03 UTC (permalink / raw)
  To: Phil Turmel; +Cc: linux-raid

2015-12-14 0:56 GMT+01:00 Phil Turmel <philip@turmel.org>:
> On 12/13/2015 06:50 PM, Phil Turmel wrote:
>> On 12/13/2015 01:18 AM, TheGerwazy . wrote:
>>> Hello
>>> I have to recreate mdadm raid 6 made with different data offsets. Some
>>> drives have 2048 and others 262144.
>>> I am looking for mdadm version with data offsets option for each drive.
>>> Could somebody help me. Please ?
>>
>> version 3.3 and above, I believe.  If in doubt, just compile the latest
>> version yourself -- no root privileges are required to compile it.  Then
>> run it from the current directory.
>>
>> git clone git://neil.brown.name/mdadm
>>
>> make
>> [sudo] ./mdadm ......
>
> I should add that using --create to reconstruct an array is incredibly
> dangerous (to your data) and should only be used as a last resort and
> when you are 100% confident you know how to do it.  Your question
> suggests that might not be true....  in which case sharing your problem
> here might be wise.
>
> Phil

Hi  Phil
Thanks for the message .... but,
In the last version of mdadm I get:

./mdadm --create --raid-devices=8 --level=6 --assume-clean /dev/md7
/dev/mapper/ovsdb1:1024 /dev/mapper/ovsdc1:4096
/dev/mapper/ovsdd1:1024 /dev/mapper/ovsde1:1024
/dev/mapper/ovsdf1:1024 /dev/mapper/ovsdg1:1024
/dev/mapper/ovsdh1:1024 /dev/mapper/ovsdi1:4096
mdadm: cannot open /dev/mapper/ovsdb1:1024: No such file or directory

but, There is branch data_offset of mdadm 3.2.5:

sudo ./mdadm --create --raid-devices=8 --level=6 --assume-clean
/dev/md7 /dev/mapper/ovsdb1 /dev/mapper/ovsdc1:4096
/dev/mapper/ovsdd1:1024 /dev/mapper/ovsde1:1024
/dev/mapper/ovsdf1:1024 /dev/mapper/ovsdg1:1024
/dev/mapper/ovsdh1:1024 /dev/mapper/ovsdi1:4096

dadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md7 started.

so it is exactly what I need :)

BTW is it possible to find right data offset without superblock on drive ?

Regards, Gerard

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

* Re: Mdadm with data offsets
  2015-12-14 12:03     ` TheGerwazy .
@ 2015-12-14 12:55       ` Phil Turmel
  2015-12-15 11:30         ` TheGerwazy .
  0 siblings, 1 reply; 8+ messages in thread
From: Phil Turmel @ 2015-12-14 12:55 UTC (permalink / raw)
  To: TheGerwazy .; +Cc: linux-raid

On 12/14/2015 07:03 AM, TheGerwazy . wrote:

> Hi  Phil
> Thanks for the message .... but,
> In the last version of mdadm I get:
> 
> ./mdadm --create --raid-devices=8 --level=6 --assume-clean /dev/md7
> /dev/mapper/ovsdb1:1024 /dev/mapper/ovsdc1:4096
> /dev/mapper/ovsdd1:1024 /dev/mapper/ovsde1:1024
> /dev/mapper/ovsdf1:1024 /dev/mapper/ovsdg1:1024
> /dev/mapper/ovsdh1:1024 /dev/mapper/ovsdi1:4096
> mdadm: cannot open /dev/mapper/ovsdb1:1024: No such file or directory

The final version of that feature requires --data-offset=variable before
the :offset syntax is recognized on the devices.

> sudo ./mdadm --create --raid-devices=8 --level=6 --assume-clean

> mdadm: array /dev/md7 started.

You're committed now.  I hope it works out for you.

> BTW is it possible to find right data offset without superblock on drive ?

Only if the content of that member device has searchable content in a
predictable location.  In practice that means finding the offset of the
first member by locating filesystem magic, or otherwise locating the
transition from all zeros to randomish data.

Good luck.

Phil


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

* Re: Mdadm with data offsets
  2015-12-14 12:55       ` Phil Turmel
@ 2015-12-15 11:30         ` TheGerwazy .
  2015-12-15 13:44           ` Phil Turmel
  0 siblings, 1 reply; 8+ messages in thread
From: TheGerwazy . @ 2015-12-15 11:30 UTC (permalink / raw)
  To: Phil Turmel; +Cc: linux-raid

2015-12-14 13:55 GMT+01:00 Phil Turmel <philip@turmel.org>:
> On 12/14/2015 07:03 AM, TheGerwazy . wrote:
>
>> Hi  Phil
>> Thanks for the message .... but,
>> In the last version of mdadm I get:
>>
>> ./mdadm --create --raid-devices=8 --level=6 --assume-clean /dev/md7
>> /dev/mapper/ovsdb1:1024 /dev/mapper/ovsdc1:4096
>> /dev/mapper/ovsdd1:1024 /dev/mapper/ovsde1:1024
>> /dev/mapper/ovsdf1:1024 /dev/mapper/ovsdg1:1024
>> /dev/mapper/ovsdh1:1024 /dev/mapper/ovsdi1:4096
>> mdadm: cannot open /dev/mapper/ovsdb1:1024: No such file or directory
>
> The final version of that feature requires --data-offset=variable before
> the :offset syntax is recognized on the devices.
>
>> sudo ./mdadm --create --raid-devices=8 --level=6 --assume-clean
>
>> mdadm: array /dev/md7 started.
>
> You're committed now.  I hope it works out for you.
>
>> BTW is it possible to find right data offset without superblock on drive ?
>
> Only if the content of that member device has searchable content in a
> predictable location.  In practice that means finding the offset of the
> first member by locating filesystem magic, or otherwise locating the
> transition from all zeros to randomish data.
>
> Good luck.
>
> Phil
>

"Good Luck" seems to be working ... ;)

I finally recovered files with magic cmd:

sudo ./mdadm --create --raid-device=8 --level=6 --assume-clean
--size=974508544 /dev/md7 /dev/mapper/ovsde2:1024
/dev/mapper/ovsdh1:100352 /dev/mapper/ovsdg1:100352
/dev/mapper/ovsdc1:131072 /dev/mapper/ovsda1:1024
/dev/mapper/ovsdb1:1024 /dev/mapper/ovsdf1:131072
/dev/mapper/ovsdd1:100352


The main problem is the data offsets are not stored elsewhere than in
superblock. I have some drives from debian 6.0.5 and some were changed
in debian 7.5. In 6.0.5 default data offset was at 2048 sector while
int 7.5 it is 262144.

But - when add new drive to existing array and partition (or drive) is
smaller than 262144 plus array data (array device size) when mdadm
calculates something between 2048 and 262144. -> so as above magic
cmd's in my case it was 200704 sector.

I recovered it by doing all steps regarding mdadm in virtual
enviroment and I am surprised by the non standard data offsets.

Thanks for Phil

regards
Gerard

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

* Re: Mdadm with data offsets
  2015-12-15 11:30         ` TheGerwazy .
@ 2015-12-15 13:44           ` Phil Turmel
  2015-12-15 14:11             ` TheGerwazy .
  0 siblings, 1 reply; 8+ messages in thread
From: Phil Turmel @ 2015-12-15 13:44 UTC (permalink / raw)
  To: TheGerwazy .; +Cc: linux-raid

On 12/15/2015 06:30 AM, TheGerwazy . wrote:

> The main problem is the data offsets are not stored elsewhere than in
> superblock. I have some drives from debian 6.0.5 and some were changed
> in debian 7.5. In 6.0.5 default data offset was at 2048 sector while
> int 7.5 it is 262144.

There have been other defaults, and various adjustments to the
algorithms that handle special cases.  The purpose of the superblock is
to store the data needed by the features supported.  Where else
would/could you store this information?

This highlights why --create is such a terrible way to recover an array,
and highlights the danger posed by well-intentioned bloggers who
cavalierly suggest using it.

Pretty much everyone who comes here for advice *before* trying --create
has been successfully helped.  The results after --create are decidedly
mixed.

> Thanks for Phil

You're welcome.

Phil


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

* Re: Mdadm with data offsets
  2015-12-15 13:44           ` Phil Turmel
@ 2015-12-15 14:11             ` TheGerwazy .
  0 siblings, 0 replies; 8+ messages in thread
From: TheGerwazy . @ 2015-12-15 14:11 UTC (permalink / raw)
  To: Phil Turmel; +Cc: linux-raid

2015-12-15 14:44 GMT+01:00 Phil Turmel <philip@turmel.org>:
> On 12/15/2015 06:30 AM, TheGerwazy . wrote:
>
>> The main problem is the data offsets are not stored elsewhere than in
>> superblock. I have some drives from debian 6.0.5 and some were changed
>> in debian 7.5. In 6.0.5 default data offset was at 2048 sector while
>> int 7.5 it is 262144.
>
> There have been other defaults, and various adjustments to the
> algorithms that handle special cases.  The purpose of the superblock is
> to store the data needed by the features supported.  Where else
> would/could you store this information?
>
maybe mdadm.conf, maybe syslog ?
It the same problem like partitions, ext3 superblocks
We need only a few parameters to recover whole array - some of them we
could guess.
Meybe its a good idea to spare some backups of mdadm superblock like in EXT3 ?

Even though mdadm is, in my opinion, reliable system and I suggest it
to my clients because of easy recovery.

> This highlights why --create is such a terrible way to recover an array,
> and highlights the danger posed by well-intentioned bloggers who
> cavalierly suggest using it.
>
> Pretty much everyone who comes here for advice *before* trying --create
> has been successfully helped.  The results after --create are decidedly
> mixed.

Due to that there are production systems, sometimes there is no time
to wait even an hour for advice - your boss would ask you "I need my
data, why you are waitng ?"
Another problem is when you are asking on the Internet - you sometimes
receive completly wrong advice what lead you to losing the data...

>
>> Thanks for Phil
>
> You're welcome.
>
> Phil
>
Best regards, Gerard

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

end of thread, other threads:[~2015-12-15 14:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-13  6:18 Mdadm with data offsets TheGerwazy .
2015-12-13 23:50 ` Phil Turmel
2015-12-13 23:56   ` Phil Turmel
2015-12-14 12:03     ` TheGerwazy .
2015-12-14 12:55       ` Phil Turmel
2015-12-15 11:30         ` TheGerwazy .
2015-12-15 13:44           ` Phil Turmel
2015-12-15 14:11             ` TheGerwazy .

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.