32 votes
Accepted

When adding a new disk to RAID 1, why does it sync unused space?

RAID works below the filesystem level - it doesn't know or care what parts of the disk are "used" or not, it just sees a bunch of blocks and their mirrored counterpart for RAID1. So it has ...
Grant's user avatar
  • 18k
25 votes

How to re-add a drive when RAID is in degraded mode?

Adding Back a RAID 1 Member To add a RAID member back into the array, use: mdadm <RAID Device> -a <Device to add into the array> For example: $ mdadm /dev/md0 -a /dev/sdc1 mdadm: re-...
Tolsadus's user avatar
  • 1,193
10 votes

Does Linux md-raid store backup metadata anywhere on the disk?

Your guess is only partially right: MDRAID does not store a backup superblock on the same disk, but the superblock on the other disks describe the same array geometry, effectively serving as a backup ...
shodanshok's user avatar
  • 50.5k
5 votes
Accepted

(Why) Does lvmraid6 need 5 drives?

This seems to be hardcoded in the source code. Here a minimum of 3 stripes is the minimum, which excludes the parity disks. So that in turn is 5 disks for a RAID6. Unfortunately the commit message ...
Thomas's user avatar
  • 4,305
4 votes
Accepted

mdadm: Resume initial sync

You need to use the repair action - ie: echo repair > /sys/block/md2/md/sync_action In theory you can use the array during the repair, but I would let this first-time repair/resync to finish ...
shodanshok's user avatar
  • 50.5k
4 votes

MD RAID - disable NCQ

Thanks for your answer. Wikipedia states "NCQ can negatively interfere with the operating system's I/O scheduler, actually decreasing performance" and it refers to this article http://www.cs.albany....
Javier Franck's user avatar
4 votes
Accepted

mdadm: power failure during raid1 rebuild

Both your drives appear marked as "spare". Stop the array then try reassembling it with the scan option: mdadm --stop /dev/md0 mdadm --assemble --scan If that doesn't work, try mdadm -...
wazoox's user avatar
  • 6,998
3 votes
Accepted

How do I make grub install on a software-raid disk?

Ok - so this is how I've solved it. The fact that /dev/sdd has a partition called /dev/sdd1 and that the sector starts at 2048 was of great help. This wikiarticle on the Arch Wiki was of great help ...
Oleg's user avatar
  • 413
3 votes
Accepted

mdadm --zero-superblock for all devices of a mdraid?

If you know the array component devices, you can simply issue something as mdadm --zero-superblock /dev/sd[abcd] to remove the superblock from multiple devices with a single command. Please note that ...
shodanshok's user avatar
  • 50.5k
3 votes

2 disk raid0, move all data to one disk, so the other can be removed

a) Backup your data b) Break the RAID leaving two individual disks left c) Format single disk with a local file system d) Get your data back from the backup done with (a) e) Unmount your unneeded disk
RiGiD5's user avatar
  • 1,291
3 votes
Accepted

Data scrubbing and repairing a RAID1 mirror?

If code has not changed, 3-way RAID1 is not going to give you smart/better recovery comparable to BTRFS/ZFS scrubs. From the main mdraid developer's blog: It is my position that if there is an ...
shodanshok's user avatar
  • 50.5k
3 votes
Accepted

SSD fstrim on CentOS 6.x with software raid5

mdraid support for discard on RAID 5 wasn't available in the 2.6 kernel series; it was added in the 3.7 kernel. I'm not aware of Red Hat backporting this functionality. Once you get a kernel with ...
Michael Hampton's user avatar
2 votes
Accepted

MD RAID sector repair

SHORT ANSWER: mirroring and parity-based RAID layouts support repairing a bad sector with supposedly good data, both during normal reads and during scrubs. However classical RAID (both hardware and ...
shodanshok's user avatar
  • 50.5k
2 votes

How to re-add a drive when RAID is in degraded mode?

I solved my own issue. I did not understand that mdX are partitions and sda and sdb are actual physical discs. So sdb was missing, so I needed to add it back. I executed the following commands: ...
captain lizard's user avatar
2 votes

Teaming a drive in multiple RAID groups

Get 4 similar (same?) disks and build RAID10. You won't be happy with parity rebuild times on your 8TB spindles.
BaronSamedi1958's user avatar
2 votes

Readahead Settings for LVM, Device-Mapper, Software Raid and Block Devices - what wins?

That's for the explanation. I made some tests with a RAID and LVM setup to prove you are right: https://fatalfailure.wordpress.com/2017/05/13/where-to-set-readahead-lvm-raid-devices-device-mapper-...
victorgp's user avatar
  • 531
2 votes

2 disk raid0, move all data to one disk, so the other can be removed

You cannot do this. RAID0 works by writing stripes alternating between drives. So, first x MB of your virtual drive is on drive 0, next x MB on drive 1 etc. You need to set up the drives from scratch.
Tero Kilkanen's user avatar
2 votes
Accepted

Why do md array rebuilds start?

This is not a rebuild, but a check. [>....................] check = 0.0% (2816/33520640) finish=197.2min speed=2816K/sec Debian (and I suppose, Ubuntu as a derivative) installs a cron job ...
Nikita Kipriyanov's user avatar
1 vote

mdadm --zero-superblock for all devices of a mdraid?

There isn't a single command (mdadm …) that will remove the superblock from all devices of a mdraid. However, it's fairly straightforward to write a script that then becomes a one-liner: #!/bin/bash ...
Chris Davies's user avatar
  • 1,720
1 vote

Cancel `md --grow` operation

I would not risk to undo a running RAID5 grow, especially considering that not having a partition table on some component devices is not such a great issue. Let it finish and if and only if you really ...
shodanshok's user avatar
  • 50.5k
1 vote
Accepted

RAID is healthy but one device is unpartitioned - should I replace it?

Actually non-partitioned drives are easier to replace: you don't need to create a partition of the right size, just to use a big enough replacement drive. You also can't misalign partitions with ...
wazoox's user avatar
  • 6,998
1 vote

MD RAID - disable NCQ

From the Wikipedia article on NCQ: NCQ can negatively interfere with the operating system's I/O scheduler, actually decreasing performance;[6] this has been observed in practice on Linux with RAID-...
Mikael H's user avatar
  • 5,089
1 vote

How to pre-emptively repair/replace drive in linux md array without going degraded first?

I'm not sure how resilient this technique is, but it "should work". I'd want to give this procedure some test runs on other drives before doing it for real. If you have a two disk RAID-1, you can ...
Mike Andrews's user avatar
1 vote
Accepted

md raid fails to boot with missing drive

As an update and the answer - in the meantime I figured out that the only thing really missing here was the nofail flag in fstab. The filesystem was degraded and it would not mount the filesystem in a ...
bardiir's user avatar
  • 71
1 vote

How to re-add a drive when RAID is in degraded mode?

Before adding the drive as suggested by @Tolsadus its a good idea to check your drive health using smartmontools by executing short and long tests: Initially you have to ensure that the hard disk ...
Vikelidis Kostas's user avatar
1 vote

GPT, grub and mdadm. sda drive replaced, raid rebuilt in recovery mode, but now server won't boot

Seems like you forgot to call grub-install /dev/sda after replication partition table. As a simple workaround you can enter bios and tell it to boot first from /dev/sdb (second disk visible in bios). ...
drookie's user avatar
  • 8,759
1 vote

raid0 (soft-RAID using Linux md drivers) hosting XFS: how to repair after replacing bad disk?

You can not. As you were said before, raid0 provides no redundancy, regardless of the fact is it interleaved or sequential. One disk in raid0 still functioning while the same is not it's basically the ...
drookie's user avatar
  • 8,759
1 vote

md raid10: how to make sure that replicated data is stored in right place?

I imagine you probably found a way around this by now but the following should do the trick: mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sda missing /dev/sdc missing Where sda and sdc ...
Joren Love's user avatar
1 vote

md raid1 reading from one disk only

If I read sequentially with one thread, it all goes to one drive. If I read in two threads from two different files, the first thread goes to one drive, and the second randomly shifts from one drive ...
Tim Starling's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible