Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #171543 > unrolled thread
| Started by | Frédéric Marchal <frederic.marchal@wowtechnology.com> |
|---|---|
| First post | 2016-08-30 07:40 +0200 |
| Last post | 2016-08-30 20:20 +0200 |
| Articles | 6 — 4 participants |
Back to article view | Back to linux.debian.user
Reuniting disks in a raid1 array Frédéric Marchal <frederic.marchal@wowtechnology.com> - 2016-08-30 07:40 +0200
Re: Reuniting disks in a raid1 array Lars Noodén <lars.nooden@gmail.com> - 2016-08-30 10:40 +0200
Re: Reuniting disks in a raid1 array Lars Noodén <lars.nooden@gmail.com> - 2016-08-30 10:50 +0200
Re: Reuniting disks in a raid1 array Frédéric Marchal <frederic.marchal@wowtechnology.com> - 2016-08-30 11:10 +0200
Re: Reuniting disks in a raid1 array Mirko Parthey <mirko.parthey@web.de> - 2016-08-30 12:30 +0200
Re: Reuniting disks in a raid1 array Pascal Hambourg <pascal@plouf.fr.eu.org> - 2016-08-30 20:20 +0200
| From | Frédéric Marchal <frederic.marchal@wowtechnology.com> |
|---|---|
| Date | 2016-08-30 07:40 +0200 |
| Subject | Reuniting disks in a raid1 array |
| Message-ID | <sbJW9-BZ-1@gated-at.bofh.it> |
Hello, I had two disks in a mdadm software raid1 on an old computer. I moved sda to a new computer. It ran there in a degraded raid1 for months. The second disk, sdb, kept running as the lone survivor of the original raid1 on the old computer. Now, it's time for the old computer to retire and sdb to join its partner in the new raid1 on the new computer. How can I do this safely? Do I have to wipe sdb before adding it to the new computer? If so, how do I make sure raid data is gone from every one of the three partitions? Or maybe mdadm will see that sda was used more recently than sdb and will synchronize sda onto sdb? Thanks, Frederic
[toc] | [next] | [standalone]
| From | Lars Noodén <lars.nooden@gmail.com> |
|---|---|
| Date | 2016-08-30 10:40 +0200 |
| Message-ID | <sbMKm-2qE-13@gated-at.bofh.it> |
| In reply to | #171543 |
On 08/30/2016 08:33 AM, Frédéric Marchal wrote:
>...
> Now, it's time for the old computer to retire and sdb to join its partner in
> the new raid1 on the new computer.
>
> How can I do this safely?
Here is what I did when I restored a drive to a RAID 1 array. I'm not
an expert, so you'll want to verify these steps.
First I cleared the start of the drive-to-be-added using "dd" reading
from /dev/zero for 1MB (probably unnecessarily large). Then I copied
the partition table from the existing disk in the array to the
disk-to-be-added. I used a different method, but looking around the
correct way might have been to pipe output from "sfdisk -d" on the
existing drive to "sfdisk" on the drive-to-be-added. That put the
partition(s) in the right place(s). Then I added the "new" RAID
partition to the array using "mdadm". e.g.
mdadm --add /dev/md129 /dev/sdb3
Then it was just a matter of waiting and checking. e.g.
mdadm -D /dev/md129
When it was finished, it showed that it was again clean and that both
devices were present and in use.
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
YMMV
Regards,
Lars
[toc] | [prev] | [next] | [standalone]
| From | Lars Noodén <lars.nooden@gmail.com> |
|---|---|
| Date | 2016-08-30 10:50 +0200 |
| Message-ID | <sbMU1-2tK-3@gated-at.bofh.it> |
| In reply to | #171545 |
> On 08/30/2016 08:33 AM, Frédéric Marchal wrote: >> How can I do this safely? PS. It goes without saying, and thus I forgot to say it, but start this by making a fresh backup of your new system. Preferably you have multiple, older backups around, too, and not just one. Sorry if that's obvious but its importance can't be overemphasized. Regards, Lars
[toc] | [prev] | [next] | [standalone]
| From | Frédéric Marchal <frederic.marchal@wowtechnology.com> |
|---|---|
| Date | 2016-08-30 11:10 +0200 |
| Message-ID | <sbNdo-2Ps-15@gated-at.bofh.it> |
| In reply to | #171545 |
On Tuesday 30 August 2016 11:32:55 Lars Noodén wrote: > On 08/30/2016 08:33 AM, Frédéric Marchal wrote: > >... > > > > Now, it's time for the old computer to retire and sdb to join its partner > > in the new raid1 on the new computer. > > > > How can I do this safely? > > Here is what I did when I restored a drive to a RAID 1 array. I'm not > an expert, so you'll want to verify these steps. > > First I cleared the start of the drive-to-be-added using "dd" reading > from /dev/zero for 1MB (probably unnecessarily large). Then I copied > the partition table from the existing disk in the array to the > disk-to-be-added. I used a different method, but looking around the > correct way might have been to pipe output from "sfdisk -d" on the > existing drive to "sfdisk" on the drive-to-be-added. That put the > partition(s) in the right place(s). I suspect this step won't work because the second hard disk was part of the array in the past. Its partition table is identical to the one on the active disk currently in the array.. If I wipe the partition table from sdb and clone the partition table from sda, sdb will end up with the exact same partition table as before. I suspect the raid superblocks and file systems will be detected as if I hadn't changed anything. The only difference between sda and sdb is that they lived, as degraded raid1, on different computers for a few months. I would like to avoid dd'ing a 1TB disk with /dev/zero. Syncing the two disks will take long enough… Frederic
[toc] | [prev] | [next] | [standalone]
| From | Mirko Parthey <mirko.parthey@web.de> |
|---|---|
| Date | 2016-08-30 12:30 +0200 |
| Message-ID | <sbOsO-3yX-41@gated-at.bofh.it> |
| In reply to | #171543 |
On Tue, Aug 30, 2016 at 07:33:02AM +0200, Frédéric Marchal wrote: > I had two disks in a mdadm software raid1 on an old computer. > > I moved sda to a new computer. It ran there in a degraded raid1 for months. > > The second disk, sdb, kept running as the lone survivor of the original raid1 > on the old computer. > > Now, it's time for the old computer to retire and sdb to join its partner in > the new raid1 on the new computer. > > How can I do this safely? > > Do I have to wipe sdb before adding it to the new computer? If so, how do I > make sure raid data is gone from every one of the three partitions? The wipefs tool can remove RAID signatures. Deleting and recreating the partitions with the same size doesn't help on its own, because it will not affect the signatures. Overwriting the beginning of the disk or the partitions may not be sufficient either, because depending on the RAID superblock version, it might be stored at the end. > Or maybe mdadm will see that sda was used more recently than sdb and will > synchronize sda onto sdb? I would advise against such experiments. It's best to wipe the signatures while the disk is still in the old computer, then transfer it to the new one. A bootable rescue system such as GRML can be very handy for this job. Regards Mirko
[toc] | [prev] | [next] | [standalone]
| From | Pascal Hambourg <pascal@plouf.fr.eu.org> |
|---|---|
| Date | 2016-08-30 20:20 +0200 |
| Message-ID | <sbVND-8n7-21@gated-at.bofh.it> |
| In reply to | #171549 |
Le 30/08/2016 à 12:14, Mirko Parthey a écrit : > On Tue, Aug 30, 2016 at 07:33:02AM +0200, Frédéric Marchal wrote: >> >> Do I have to wipe sdb before adding it to the new computer? If so, how do I >> make sure raid data is gone from every one of the three partitions? > > The wipefs tool can remove RAID signatures. Or mdadm --zero-superblock > Deleting and recreating the partitions with the same size doesn't help > on its own, because it will not affect the signatures. > Overwriting the beginning of the disk or the partitions may not be > sufficient either, because depending on the RAID superblock version, it > might be stored at the end. The default superblock format 1.2 stores the superblock 4 KiB after the beginning. However the OP wrote the disk was divided in several RAID partitions, so it would not erase all the superblocks. >> Or maybe mdadm will see that sda was used more recently than sdb and will >> synchronize sda onto sdb? > > I would advise against such experiments. It's best to wipe the signatures > while the disk is still in the old computer, then transfer it to the new > one. I second this advice. > A bootable rescue system such as GRML can be very handy for this job. Or you can just use the initramfs shell. Add "break" to the kernel command line to trigger it. Or the Debian installer shell.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web