All of lore.kernel.org
 help / color / mirror / Atom feed
* RAID 1 | Restore based on Image of /dev/sda
@ 2020-05-04 10:48 Stefanie Leisestreichler
  2020-05-04 10:59 ` Reindl Harald
  2020-05-04 11:07 ` Wols Lists
  0 siblings, 2 replies; 9+ messages in thread
From: Stefanie Leisestreichler @ 2020-05-04 10:48 UTC (permalink / raw)
  To: linux-raid

Hi.
I have a running RAID 1 based on /dev/sda1 and /dev/sda2 with 
metadata=1.2 with mdadm version 3.2.5.

I took an image of /dev/sda using dd.
There is a computer with identical hardware (test-env) where I put in 
this image. When I start this computer, it is booting and recognizing 
the raid active as md0 with state [2/1] [U_] like expected.

My target is to restore the raid using another new and blank hard disk 
in the test-env computer. I know I have to format the new disk 
identically to the format the image is providing, but I am unsure about 
how to add the new disk to the raid array.

Could you please guide me?

Thanks,
Steffi

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 10:48 RAID 1 | Restore based on Image of /dev/sda Stefanie Leisestreichler
@ 2020-05-04 10:59 ` Reindl Harald
  2020-05-04 11:13   ` Stefanie Leisestreichler
  2020-05-04 11:07 ` Wols Lists
  1 sibling, 1 reply; 9+ messages in thread
From: Reindl Harald @ 2020-05-04 10:59 UTC (permalink / raw)
  To: Stefanie Leisestreichler, linux-raid



Am 04.05.20 um 12:48 schrieb Stefanie Leisestreichler:
> Hi.
> I have a running RAID 1 based on /dev/sda1 and /dev/sda2 with
> metadata=1.2 with mdadm version 3.2.5.
> 
> I took an image of /dev/sda using dd.
> There is a computer with identical hardware (test-env) where I put in
> this image. When I start this computer, it is booting and recognizing
> the raid active as md0 with state [2/1] [U_] like expected.
> 
> My target is to restore the raid using another new and blank hard disk
> in the test-env computer. I know I have to format the new disk
> identically to the format the image is providing, but I am unsure about
> how to add the new disk to the raid array.
> 
> Could you please guide me?

mdadm /dev/mdX --add /dev/sdx{1,2}

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 10:48 RAID 1 | Restore based on Image of /dev/sda Stefanie Leisestreichler
  2020-05-04 10:59 ` Reindl Harald
@ 2020-05-04 11:07 ` Wols Lists
  2020-05-04 11:26   ` Stefanie Leisestreichler
  1 sibling, 1 reply; 9+ messages in thread
From: Wols Lists @ 2020-05-04 11:07 UTC (permalink / raw)
  To: Stefanie Leisestreichler, linux-raid

On 04/05/20 11:48, Stefanie Leisestreichler wrote:
> Hi.
> I have a running RAID 1 based on /dev/sda1 and /dev/sda2 with
> metadata=1.2 with mdadm version 3.2.5.
> 
> I took an image of /dev/sda using dd.
> There is a computer with identical hardware (test-env) where I put in
> this image. When I start this computer, it is booting and recognizing
> the raid active as md0 with state [2/1] [U_] like expected.
> 
> My target is to restore the raid using another new and blank hard disk
> in the test-env computer. I know I have to format the new disk
> identically to the format the image is providing, but I am unsure about
> how to add the new disk to the raid array.
> 
> Could you please guide me?
> 
https://raid.wiki.kernel.org/index.php/Linux_Raid

Is the drive formatted with one big partition? I guess it is. What it
really cares about is that the new partition you are adding is identical
in size to the partition the raid is on.

There are tools that will copy a partition table for you - BEWARE - a
lot of things rely on GUIDs and at least the tools I know of don't reset
them by default - duplicate unique ids are not a good idea :-) So as you
copied this drive using dd DO NOT put it back in the original computer ...

https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm#Adding_a_drive_to_a_mirror

Cheers,
Wol

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 10:59 ` Reindl Harald
@ 2020-05-04 11:13   ` Stefanie Leisestreichler
  2020-05-04 15:15     ` Stefanie Leisestreichler
  0 siblings, 1 reply; 9+ messages in thread
From: Stefanie Leisestreichler @ 2020-05-04 11:13 UTC (permalink / raw)
  To: Reindl Harald, linux-raid



On 04.05.20 12:59, Reindl Harald wrote:
> mdadm /dev/mdX --add /dev/sdx{1,2}

Thanks, Harald.
Will do it like you suggested.

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 11:07 ` Wols Lists
@ 2020-05-04 11:26   ` Stefanie Leisestreichler
  2020-05-04 11:36     ` Johannes Truschnigg
  2020-05-04 12:07     ` Wols Lists
  0 siblings, 2 replies; 9+ messages in thread
From: Stefanie Leisestreichler @ 2020-05-04 11:26 UTC (permalink / raw)
  To: Wols Lists, linux-raid



On 04.05.20 13:07, Wols Lists wrote:
> https://raid.wiki.kernel.org/index.php/Linux_Raid
> 
> Is the drive formatted with one big partition? I guess it is. What it
> really cares about is that the new partition you are adding is identical
> in size to the partition the raid is on.
> 
> There are tools that will copy a partition table for you - BEWARE - a
> lot of things rely on GUIDs and at least the tools I know of don't reset
> them by default - duplicate unique ids are not a good idea :-) So as you
> copied this drive using dd DO NOT put it back in the original computer ...
> 
> https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm#Adding_a_drive_to_a_mirror
> 
> Cheers,
> Wol

Thanks, Wol, especially for the hint with the GUIDs, will keep this in 
mind. If ever using it again - maybe in case of a quick temporary 
replacement in the original computer - I will wipe it with zeros before.

The partition layout will be cloned using sfdisk.

Thanks for the wiki links. I read the wiki before asking but it was not 
clear to me how to do it...

Btw, I will stay with mdadm/lvm/ext4 and not switch to btrfs.

Thanks again,
Steffi

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 11:26   ` Stefanie Leisestreichler
@ 2020-05-04 11:36     ` Johannes Truschnigg
  2020-05-04 11:52       ` Stefanie Leisestreichler
  2020-05-04 12:07     ` Wols Lists
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Truschnigg @ 2020-05-04 11:36 UTC (permalink / raw)
  To: Stefanie Leisestreichler; +Cc: Wols Lists, linux-raid

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

Hi Steffi,

On Mon, May 04, 2020 at 01:26:35PM +0200, Stefanie Leisestreichler wrote:
> [...]
> Thanks, Wol, especially for the hint with the GUIDs, will keep this in mind.
> If ever using it again - maybe in case of a quick temporary replacement in
> the original computer - I will wipe it with zeros before.
> 
> The partition layout will be cloned using sfdisk.

When dealing with GPT partitions, you might want to consider using `sgdisk`
instead. It features -G|--randomize-guids and will be able to clone a GPT
table from one drive to another in one go, without you having to iron out
UUID-related problems that "naive" cloning (which I believe `sfdisk` will
perform) will introduce.

Hth!

-- 
with best regards:
- Johannes Truschnigg ( johannes@truschnigg.info )

www:   https://johannes.truschnigg.info/
phone: +43 650 2 133337
xmpp:  johannes@truschnigg.info

Please do not bother me with HTML-email or attachments. Thank you.

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

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 11:36     ` Johannes Truschnigg
@ 2020-05-04 11:52       ` Stefanie Leisestreichler
  0 siblings, 0 replies; 9+ messages in thread
From: Stefanie Leisestreichler @ 2020-05-04 11:52 UTC (permalink / raw)
  To: Johannes Truschnigg; +Cc: Wols Lists, linux-raid



On 04.05.20 13:36, Johannes Truschnigg wrote:
> Hi Steffi,
> 
> On Mon, May 04, 2020 at 01:26:35PM +0200, Stefanie Leisestreichler wrote:
>> [...]
>> Thanks, Wol, especially for the hint with the GUIDs, will keep this in mind.
>> If ever using it again - maybe in case of a quick temporary replacement in
>> the original computer - I will wipe it with zeros before.
>>
>> The partition layout will be cloned using sfdisk.
> 
> When dealing with GPT partitions, you might want to consider using `sgdisk`
> instead. It features -G|--randomize-guids and will be able to clone a GPT
> table from one drive to another in one go, without you having to iron out
> UUID-related problems that "naive" cloning (which I believe `sfdisk` will
> perform) will introduce.
> 
> Hth!
> 

This also found its way in my private wiki, thanks!

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 11:26   ` Stefanie Leisestreichler
  2020-05-04 11:36     ` Johannes Truschnigg
@ 2020-05-04 12:07     ` Wols Lists
  1 sibling, 0 replies; 9+ messages in thread
From: Wols Lists @ 2020-05-04 12:07 UTC (permalink / raw)
  To: Stefanie Leisestreichler, linux-raid

On 04/05/20 12:26, Stefanie Leisestreichler wrote:
> 

> 
> Thanks, Wol, especially for the hint with the GUIDs, will keep this in
> mind. If ever using it again - maybe in case of a quick temporary
> replacement in the original computer - I will wipe it with zeros before.

And what Johannes said ... oh and I believe gdisk has an option that
will change guids for you without affecting anything else.

Wiping it with zeroes will take a long time - it might well be mdadm I
think it has an option to wipe the raid superblock.

Note that both the partitions and the raid will have guids, so moving
drives around can be fraught ...
> 
> The partition layout will be cloned using sfdisk.
> 
> Thanks for the wiki links. I read the wiki before asking but it was not
> clear to me how to do it...
> 
> Btw, I will stay with mdadm/lvm/ext4 and not switch to btrfs.
> 
That's good - my feelings entirely as btrfs may be a decent file system,
but I gather parity raid is experimental as in it will probably eat your
data at some point and may be unfixable. I gather it also does NOT
mirror your data by default (typical computer scientists - they consider
the filesystem structure valuable and assume the user can retrieve the
data from backup ... :-(

lvm gives you snapshotting and stuff ...

And my current (and planned new) systems both have the root filesystem
on a separate partition from /home, so if I wanted I could have root on
a 1.0 mirror - not especially recommended but there are good reasons for
it ...

> Thanks again,
> Steffi

Cheers,
Wol

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

* Re: RAID 1 | Restore based on Image of /dev/sda
  2020-05-04 11:13   ` Stefanie Leisestreichler
@ 2020-05-04 15:15     ` Stefanie Leisestreichler
  0 siblings, 0 replies; 9+ messages in thread
From: Stefanie Leisestreichler @ 2020-05-04 15:15 UTC (permalink / raw)
  To: Reindl Harald, linux-raid



On 04.05.20 13:13, Stefanie Leisestreichler wrote:
> 
> 
> On 04.05.20 12:59, Reindl Harald wrote:
>> mdadm /dev/mdX --add /dev/sdx{1,2}
> 
> Thanks, Harald.
> Will do it like you suggested.

Array is recoverd and [UU] again.
Thanks again.

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

end of thread, other threads:[~2020-05-04 15:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 10:48 RAID 1 | Restore based on Image of /dev/sda Stefanie Leisestreichler
2020-05-04 10:59 ` Reindl Harald
2020-05-04 11:13   ` Stefanie Leisestreichler
2020-05-04 15:15     ` Stefanie Leisestreichler
2020-05-04 11:07 ` Wols Lists
2020-05-04 11:26   ` Stefanie Leisestreichler
2020-05-04 11:36     ` Johannes Truschnigg
2020-05-04 11:52       ` Stefanie Leisestreichler
2020-05-04 12:07     ` Wols Lists

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.