Index: uspace/srv/bd/hr/raid1.c
===================================================================
--- uspace/srv/bd/hr/raid1.c	(revision d0f074457b5f4784be5e962dba29681ee959bf5c)
+++ uspace/srv/bd/hr/raid1.c	(revision b8409b9c4af46ca08e0a3c04c51cfa85776b5671)
@@ -331,5 +331,14 @@
 	case HR_BD_WRITE:
 		for (i = 0; i < vol->dev_no; i++) {
-			if (vol->extents[i].status != HR_EXT_ONLINE)
+			if (vol->extents[i].status != HR_EXT_ONLINE ||
+			    (vol->extents[i].status == HR_EXT_REBUILD &&
+			    ba >= vol->rebuild_blk))
+				/*
+				 * When the extent is being rebuilt,
+				 * we only write to the part that is already
+				 * rebuilt. If ba is more than vol->rebuild_blk,
+				 * the write is going to be replicated later
+				 * in the rebuild. TODO: test
+				 */
 				continue;
 			rc = block_write_direct(vol->extents[i].svc_id, ba, cnt,
@@ -395,4 +404,5 @@
 	size_t hotspare_idx = vol->hotspare_no - 1;
 
+	vol->rebuild_blk = 0;
 	vol->extents[bad].svc_id = vol->hotspares[hotspare_idx].svc_id;
 	hr_update_ext_status(vol, bad, HR_EXT_REBUILD);
@@ -430,4 +440,5 @@
 	hr_add_ba_offset(vol, &ba);
 	while (left != 0) {
+		vol->rebuild_blk = ba;
 		cnt = min(max_blks, left);
 		for (size_t i = 0; i < vol->dev_no; i++) {
Index: uspace/srv/bd/hr/var.h
===================================================================
--- uspace/srv/bd/hr/var.h	(revision d0f074457b5f4784be5e962dba29681ee959bf5c)
+++ uspace/srv/bd/hr/var.h	(revision b8409b9c4af46ca08e0a3c04c51cfa85776b5671)
@@ -73,4 +73,6 @@
 	uint32_t strip_size;
 
+	uint64_t rebuild_blk;
+
 	service_id_t svc_id;
 	hr_vol_status_t status;
