[SOLVED] Re-use disks from Linux software RAID array

lafaki

Reputable
Jun 4, 2016
9
0
4,520
Hi!

I have a RAID 1 array with two disks running Debian (not an up to date OS version).
I provide at the bottom of the email the fdisk -l command output.

The disks are formatted with NTFS-3G, they have only data and not any primary partition for booting the OS.

What I want to do is:
  • stop the RAID
  • remove the disks
  • keep all data in one of the two disks so that the data is accessible by another PC running Windows
  • format the other disk and use it in a Windows PC

When searching a bit, I have come across the below commands. Would they work?

Any help and advice would be highly appreciated!

Thanks in advance,
Akis

STEP 1 - Remove one drive (/dev/sdb1) from the RAID array
mdadm /dev/md0 --fail /dev/sdb1
mdadm /dev/md0 --remove /dev/sdb1

Question: after this step, can I access all data on the /dev/sdb1 from a Windows PC? What about the remaining software RAID metadata?

STEP 2 - Remove the RAID metadata from the other drive (/dev/sda1)
mdadm --zero-superblock /dev/sda1

Question: after this step, can I properly reformat /dev/sdb1 and reuse in a Windows PC?

Question: Do I need to run any stop command at any stage? e.g. mdadm --stop /dev/md0

_

sudo fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00019772

Device Boot Start End Blocks Id System
/dev/sda1 1 243201 1953512001 fd Linux raid autodetect

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006d8a1

Device Boot Start End Blocks Id System
/dev/sdb1 1 243201 1953512001 fd Linux raid autodetect

Disk /dev/md0: 2000.4 GB, 2000396222464 bytes
2 heads, 4 sectors/track, 488377984 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb11cc0b1

Device Boot Start End Blocks Id System
/dev/md0p1 1 488377984 1953511934 7 HPFS/NTFS


Disk /dev/sdc: 3999 MB, 3999268864 bytes
124 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 7688 * 512 = 3936256 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00061b0f

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 753 2891776 83 Linux
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 32, 33) logical=(0, 33, 3)
Partition 1 has different physical/logical endings:
phys=(360, 34, 58) logical=(752, 68, 8)
Partition 1 does not end on cylinder boundary.
/dev/sdc2 753 1016 1010689 5 Extended
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(360, 67, 26) logical=(752, 101, 9)
Partition 2 has different physical/logical endings:
phys=(486, 22, 48) logical=(1015, 91, 62)
Partition 2 does not end on cylinder boundary.
/dev/sdc5 753 1016 1010688 82 Linux swap / Solaris
 
Solution
You should not stop the array if you want to get back the data you have stored on it. However I would strongly recommend you make both disks run a long SMART self-test before this. Also, perform all reformats, data transfer etc. on Debian, as Windows won't be able to access a Linux RAId array. Deleting the superblock also makes it so the disk is unreadable (that's where the partition table is stored), and not simply remove the RAID data.
Other than that, your progression seems correct.
You should not stop the array if you want to get back the data you have stored on it. However I would strongly recommend you make both disks run a long SMART self-test before this. Also, perform all reformats, data transfer etc. on Debian, as Windows won't be able to access a Linux RAId array. Deleting the superblock also makes it so the disk is unreadable (that's where the partition table is stored), and not simply remove the RAID data.
Other than that, your progression seems correct.
 
Solution

lafaki

Reputable
Jun 4, 2016
9
0
4,520
Hi,

Thanks all for your help!

After considering the risk of loosing the data, I decided to follow another path that worked at the end fine.

  • In the Disk Utility of the Debian OS, I removed one disk from the RAID 1 array
  • For that disk (/dev/sdb)
o I deleted the RAID partition
o I created a GUID partition and formatted the drive as NTFS
o I mounted the new NTFS partition and copied all data from the RAID array to this drive (I also connected this drive to a Windows PC and checked that all data was accessible)
  • I then unmounted the RAID 1 array and stopped it
  • For the remaining disk in the array (/dev/sda)
o I deleted the RAID partition
o I created a GUID partition and formatted the drive as NTFS

In my case transferring the data internally from one SATA disk to another was faster than to an external USB drive.

Cheers,
Akis