* Re: [PATCH 1/3] badblocks: Add core badblock management code
From: Jens Axboe @ 2015-11-24 19:19 UTC (permalink / raw)
To: Vishal Verma, linux-nvdimm
Cc: linux-block, linux-raid, linux-scsi, NeilBrown, Jeff Moyer
In-Reply-To: <1448066960-20119-2-git-send-email-vishal.l.verma@intel.com>
On 11/20/2015 05:49 PM, Vishal Verma wrote:
> Take the core badblocks implementation from md, and make it generally
> available. This follows the same style as kernel implementations of
> linked lists, rb-trees etc, where you can have a structure that can be
> embedded anywhere, and accessor functions to manipulate the data.
>
> The only changes in this copy of the code are ones to generalize
> function/variable names from md-specific ones. Also add init and free
> functions.
Split this into a .c file with the code.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH 2/3] block: Add badblock management for gendisks
From: Verma, Vishal L @ 2015-11-24 20:10 UTC (permalink / raw)
To: jmoyer@redhat.com
Cc: linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-block@vger.kernel.org, neilb@suse.com, axboe@fb.com,
linux-nvdimm@ml01.01.org
In-Reply-To: <x498u5n1a7h.fsf@segfault.boston.devel.redhat.com>
On Tue, 2015-11-24 at 14:14 -0500, Jeff Moyer wrote:
>
> I'm not sure whether it makes sense to continue without badblock
> management for the RAID code. I was hoping Neil would comment on
> that.
>
> -Jeff
Not sure I follow? I believe I've kept all the badblocks functionality
RAID already had..
On a related note, something I observed when testing with md:
md's badblock list is per-device, and can be seen at:
/sys/block/md0/md/dev-pmem0/bad_blocks
Now if we have badblocks in the gendisks too, there is also:
/sys/block/pmem0/bad_blocks
The two are separate 'accounts' maintained by separate drivers (md for
the former, and pmem for the latter). This can potentially be
confusing..
Should we consolidate the two, i.e. make md (re)use the gendisk
badblocks for its purposes too?
-Vishal
^ permalink raw reply
* Re: [PATCH 2/3] block: Add badblock management for gendisks
From: Dan Williams @ 2015-11-24 21:31 UTC (permalink / raw)
To: Verma, Vishal L
Cc: jmoyer@redhat.com, linux-block@vger.kernel.org,
linux-scsi@vger.kernel.org, axboe@fb.com,
linux-nvdimm@ml01.01.org, neilb@suse.com,
linux-raid@vger.kernel.org
In-Reply-To: <1448395840.14996.8.camel@intel.com>
On Tue, Nov 24, 2015 at 12:10 PM, Verma, Vishal L
<vishal.l.verma@intel.com> wrote:
> On Tue, 2015-11-24 at 14:14 -0500, Jeff Moyer wrote:
>>
>> I'm not sure whether it makes sense to continue without badblock
>> management for the RAID code. I was hoping Neil would comment on
>> that.
>>
>> -Jeff
>
> Not sure I follow? I believe I've kept all the badblocks functionality
> RAID already had..
>
>
> On a related note, something I observed when testing with md:
>
> md's badblock list is per-device, and can be seen at:
> /sys/block/md0/md/dev-pmem0/bad_blocks
>
> Now if we have badblocks in the gendisks too, there is also:
> /sys/block/pmem0/bad_blocks
>
> The two are separate 'accounts' maintained by separate drivers (md for
> the former, and pmem for the latter). This can potentially be
> confusing..
>
> Should we consolidate the two, i.e. make md (re)use the gendisk
> badblocks for its purposes too?
If we get agreement that tracking bad blocks at the gendisk is useful
for more than just nvdimms then yes, I think it makes sense to move md
bad_blocks to the gendisk layer. That is provided we can add a
symlink to make the move transparent to existing md userspace tooling.
The use cases I can envision being useful for other disks is:
1/ Bypassing / avoiding known bad blocks on disks / drivers that
inject long completion latency for error handling.
2/ Simulating bad blocks for disks that can't store them locally.
Similar to the md use case, if one encounters errors restoring a disk
image from a backup it's useful to have the option to record the error
in a bad block list and keep going.
^ permalink raw reply
* [PATCH] md: dm-bufio: Use BUG_ON instead of if BUG
From: Anup Limbu @ 2015-11-25 10:16 UTC (permalink / raw)
To: agk, snitzer, dm-devel, neilb, linux-raid, linux-kernel; +Cc: Anup Limbu
Use BUG_ON instead of if BUG
Signed-off-by: Anup Limbu <anuplimbu14@gmail.com>
---
drivers/md/dm-bufio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 2dd3308..788a905 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1891,8 +1891,7 @@ static void __exit dm_bufio_exit(void)
bug = 1;
}
- if (bug)
- BUG();
+ BUG_ON(bug);
}
module_init(dm_bufio_init)
--
1.9.1
^ permalink raw reply related
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Semyon Enskiy @ 2015-11-25 12:12 UTC (permalink / raw)
To: Phil Turmel, linux-raid@vger.kernel.org
In-Reply-To: <565359F6.3020201@turmel.org>
Hi Phil.
Thanks for your suggestions, I have followed them, but RAID5 at md3 not
recovered at yet, maybe you will find time to suggest anything else.
Exactly, power and data connections of SATA disks was not reliable, fixed
this and after boot get no errors in kernel logs.
md3 was replaced with "<ingore>" in mdadm.conf and commented in fstab before
poweroff, things returned back after boot.
# mdadm --assemble --update=revert-reshape /dev/md3
# mdadm --assemble --scan -vv
mdadm: looking for devices for /dev/md1
mdadm: no recogniseable superblock on /dev/dm-1
mdadm: no recogniseable superblock on /dev/dm-0
mdadm: no recogniseable superblock on /dev/sdj4
mdadm: /dev/sdj3 has wrong uuid.
mdadm: /dev/sdj2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdj1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdj
mdadm: no recogniseable superblock on /dev/sdi4
mdadm: /dev/sdi3 has wrong uuid.
mdadm: /dev/sdi2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdi1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdi
mdadm: no recogniseable superblock on /dev/sdh4
mdadm: /dev/sdh3 has wrong uuid.
mdadm: /dev/sdh2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdh1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdh
mdadm: no recogniseable superblock on /dev/md/2
mdadm: no recogniseable superblock on /dev/md1
mdadm: no recogniseable superblock on /dev/sdg4
mdadm: /dev/sdg3 has wrong uuid.
mdadm: /dev/sdg2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdg1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdg
mdadm: no recogniseable superblock on /dev/sdb4
mdadm: /dev/sdb3 has wrong uuid.
mdadm: /dev/sdb2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdb1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdb
mdadm: no recogniseable superblock on /dev/sdf4
mdadm: /dev/sdf3 has wrong uuid.
mdadm: /dev/sdf2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdf1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdf
mdadm: no recogniseable superblock on /dev/sde4
mdadm: /dev/sde3 has wrong uuid.
mdadm: /dev/sde2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sde1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sde
mdadm: no recogniseable superblock on /dev/sdd4
mdadm: /dev/sdd3 has wrong uuid.
mdadm: /dev/sdd2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdd1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdd
mdadm: no recogniseable superblock on /dev/sdc4
mdadm: /dev/sdc3 has wrong uuid.
mdadm: /dev/sdc2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdc1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sdc
mdadm: no recogniseable superblock on /dev/sda4
mdadm: /dev/sda3 has wrong uuid.
mdadm: /dev/sda2 has wrong uuid.
mdadm: UUID differs from /dev/md/2.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sda1 is busy - skipping
mdadm: Cannot assemble mbr metadata on /dev/sda
mdadm: looking for devices for /dev/md/2
mdadm: no RAID superblock on /dev/dm-1
mdadm: no RAID superblock on /dev/dm-0
mdadm: no RAID superblock on /dev/sdj4
mdadm: /dev/sdj3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdj2 is busy - skipping
mdadm: no RAID superblock on /dev/sdj1
mdadm: no RAID superblock on /dev/sdj
mdadm: no RAID superblock on /dev/sdi4
mdadm: /dev/sdi3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdi2 is busy - skipping
mdadm: no RAID superblock on /dev/sdi1
mdadm: no RAID superblock on /dev/sdi
mdadm: no RAID superblock on /dev/sdh4
mdadm: /dev/sdh3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdh2 is busy - skipping
mdadm: no RAID superblock on /dev/sdh1
mdadm: no RAID superblock on /dev/sdh
mdadm: no RAID superblock on /dev/md/2
mdadm: no RAID superblock on /dev/md1
mdadm: no RAID superblock on /dev/sdg4
mdadm: /dev/sdg3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdg2 is busy - skipping
mdadm: no RAID superblock on /dev/sdg1
mdadm: no RAID superblock on /dev/sdg
mdadm: no RAID superblock on /dev/sdb4
mdadm: /dev/sdb3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdb2 is busy - skipping
mdadm: no RAID superblock on /dev/sdb1
mdadm: no RAID superblock on /dev/sdb
mdadm: no RAID superblock on /dev/sdf4
mdadm: /dev/sdf3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdf2 is busy - skipping
mdadm: no RAID superblock on /dev/sdf1
mdadm: no RAID superblock on /dev/sdf
mdadm: no RAID superblock on /dev/sde4
mdadm: /dev/sde3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sde2 is busy - skipping
mdadm: no RAID superblock on /dev/sde1
mdadm: no RAID superblock on /dev/sde
mdadm: no RAID superblock on /dev/sdd4
mdadm: /dev/sdd3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdd2 is busy - skipping
mdadm: no RAID superblock on /dev/sdd1
mdadm: no RAID superblock on /dev/sdd
mdadm: no RAID superblock on /dev/sdc4
mdadm: /dev/sdc3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sdc2 is busy - skipping
mdadm: no RAID superblock on /dev/sdc1
mdadm: no RAID superblock on /dev/sdc
mdadm: no RAID superblock on /dev/sda4
mdadm: /dev/sda3 has wrong uuid.
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/3.
mdadm: /dev/sda2 is busy - skipping
mdadm: no RAID superblock on /dev/sda1
mdadm: no RAID superblock on /dev/sda
mdadm: looking for devices for /dev/md/3
mdadm: no RAID superblock on /dev/dm-1
mdadm: no RAID superblock on /dev/dm-0
mdadm: no RAID superblock on /dev/sdj4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdj3 is busy - skipping
mdadm: /dev/sdj2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdj1
mdadm: no RAID superblock on /dev/sdj
mdadm: no RAID superblock on /dev/sdi4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdi3 is busy - skipping
mdadm: /dev/sdi2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdi1
mdadm: no RAID superblock on /dev/sdi
mdadm: no RAID superblock on /dev/sdh4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdh3 is busy - skipping
mdadm: /dev/sdh2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdh1
mdadm: no RAID superblock on /dev/sdh
mdadm: no RAID superblock on /dev/md/2
mdadm: no RAID superblock on /dev/md1
mdadm: no RAID superblock on /dev/sdg4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdg3 is busy - skipping
mdadm: /dev/sdg2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdg1
mdadm: no RAID superblock on /dev/sdg
mdadm: no RAID superblock on /dev/sdb4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdb3 is busy - skipping
mdadm: /dev/sdb2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdb1
mdadm: no RAID superblock on /dev/sdb
mdadm: no RAID superblock on /dev/sdf4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdf3 is busy - skipping
mdadm: /dev/sdf2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdf1
mdadm: no RAID superblock on /dev/sdf
mdadm: no RAID superblock on /dev/sde4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sde3 is busy - skipping
mdadm: /dev/sde2 has wrong uuid.
mdadm: no RAID superblock on /dev/sde1
mdadm: no RAID superblock on /dev/sde
mdadm: no RAID superblock on /dev/sdd4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdd3 is busy - skipping
mdadm: /dev/sdd2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdd1
mdadm: no RAID superblock on /dev/sdd
mdadm: no RAID superblock on /dev/sdc4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sdc3 is busy - skipping
mdadm: /dev/sdc2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdc1
mdadm: no RAID superblock on /dev/sdc
mdadm: no RAID superblock on /dev/sda4
mdadm: UUID differs from /dev/md1.
mdadm: UUID differs from /dev/md/2.
mdadm: /dev/sda3 is busy - skipping
mdadm: /dev/sda2 has wrong uuid.
mdadm: no RAID superblock on /dev/sda1
mdadm: no RAID superblock on /dev/sda
Note the difference in --display and --examine outputs (see below) about
total and delta device numbers, 10 in detail and 11 in examine.
Also note, that sda3 is marked as "spare" device, I am wrote before in first
message, that some useless commands was executed.
# mdadm --add /dev/md3 --re-add /dev/sda3
mdadm: Cannot get array info for /dev/md3
# This is because array is not started?
# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid10 sdd2[8] sdg2[6] sdh2[4] sdj2[5] sdi2[11] sdb2[1] sdc2[10] sdf2[0] sde2[9] sda2[12]
35653120 blocks super 1.2 512K chunks 2 near-copies [10/10] [UUUUUUUUUU]
bitmap: 1/1 pages [4KB], 65536KB chunk
md3 : inactive sdg3[3](S) sdh3[2](S) sdj3[10](S) sdi3[12](S) sdb3[6](S) sdc3[11](S) sdf3[0](S) sdd3[4](S) sde3[5](S) sda3[14](S)
38995474635 blocks super 1.2
md1 : active raid1 sdd1[4] sdg1[3] sdh1[2] sdj1[8] sdi1[1] sdb1[6] sdc1[7] sdf1[0] sde1[5] sda1[9]
203712 blocks [10/10] [UUUUUUUUUU]
bitmap: 0/1 pages [0KB], 65536KB chunk
# mdadm --detail /dev/md3
/dev/md3:
Version : 1.2
Raid Level : raid0
Total Devices : 10
Persistence : Superblock is persistent
State : inactive
Delta Devices : 1, (-1->0)
New Level : raid5
New Layout : left-symmetric
New Chunksize : 512K
Name : ubuntu:3
UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Events : 21586
Number Major Minor RaidDevice
- 8 3 - /dev/sda3
- 8 19 - /dev/sdb3
- 8 35 - /dev/sdc3
- 8 51 - /dev/sdd3
- 8 67 - /dev/sde3
- 8 83 - /dev/sdf3
- 8 99 - /dev/sdg3
- 8 115 - /dev/sdh3
- 8 131 - /dev/sdi3
- 8 147 - /dev/sdj3
# mdadm --examine /dev/sd?3
/dev/sda3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : c0155214:a9c8e378:d368b6f6:735048a8
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 952a55f2 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : spare
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 375d85e2:9077dd68:bc1327af:8fee4112
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 75b99505 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 6
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 67cd2bfa:affa578c:e0c1286a:bd4d2627
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 80c895f3 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 7
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 4490843e:d2c5c2e7:d222fa0a:f98b277c
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 1656c2d2 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 4
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sde3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 1d41056f:88149b1a:48e939e5:8c775e23
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : fb26746a - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 5
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdf3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : fa7c541d:a25babd8:14ffe1c0:c6c1578c
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : ac275763 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 0
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdg3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : a4b8b425:b0307fe5:9eb8e3ac:ae985311
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 3258f890 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 3
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdh3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 345b0212:6c3a0ae8:d8ed9273:ecc53573
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 49c30753 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 2
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdi3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 70afdaad:b0979fb1:1b99ef18:dd58cc3a
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 1c2bf759 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 1
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdj3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : a5f2cea8:a89c88a0:0dd3900c:624f0491
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 4fda6fb3 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 9
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
# for x in /dev/sd[a-z] ; do echo $x ; smartctl -i -A $x ; done
/dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1657399
LU WWN Device Id: 5 0014ee 2b4caa93a
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 179 179 021 Pre-fail Always - 8033
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 9
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 089 089 000 Old_age Always - 8756
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 9
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 66
194 Temperature_Celsius 0x0022 117 102 000 Old_age Always - 35
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
/dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1643332
LU WWN Device Id: 5 0014ee 25f74cf3c
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 182 181 021 Pre-fail Always - 7866
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 19
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 084 084 000 Old_age Always - 11724
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 19
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 5
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 106
194 Temperature_Celsius 0x0022 117 102 000 Old_age Always - 35
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
/dev/sdc
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1649141
LU WWN Device Id: 5 0014ee 25f74a7c9
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 185 183 021 Pre-fail Always - 7741
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 14
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 085 085 000 Old_age Always - 11439
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 14
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 84
194 Temperature_Celsius 0x0022 118 105 000 Old_age Always - 34
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
/dev/sdd
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E0340253
LU WWN Device Id: 5 0014ee 20921e030
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 175 173 021 Pre-fail Always - 8241
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 28
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 081 081 000 Old_age Always - 14575
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 28
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 9
193 Load_Cycle_Count 0x0032 001 001 000 Old_age Always - 1496402
194 Temperature_Celsius 0x0022 114 108 000 Old_age Always - 38
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
/dev/sde
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1658818
LU WWN Device Id: 5 0014ee 20a1fca11
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 185 183 021 Pre-fail Always - 7733
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 15
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 084 084 000 Old_age Always - 11700
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 15
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 101
194 Temperature_Celsius 0x0022 116 109 000 Old_age Always - 36
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
/dev/sdf
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1349511
LU WWN Device Id: 5 0014ee 2b4a00452
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 178 176 021 Pre-fail Always - 8100
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 27
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 082 082 000 Old_age Always - 13576
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 27
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 8
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 120
194 Temperature_Celsius 0x0022 117 110 000 Old_age Always - 35
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
/dev/sdg
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1265787
LU WWN Device Id: 5 0014ee 25f483dfb
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 55
3 Spin_Up_Time 0x0027 177 175 021 Pre-fail Always - 8141
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 23
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 084 084 000 Old_age Always - 11746
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 23
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 9
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 104
194 Temperature_Celsius 0x0022 115 107 000 Old_age Always - 37
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
/dev/sdh
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1639809
LU WWN Device Id: 5 0014ee 25f7425d2
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 180 179 021 Pre-fail Always - 7958
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 17
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 084 084 000 Old_age Always - 11722
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 17
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 103
194 Temperature_Celsius 0x0022 115 107 000 Old_age Always - 37
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
/dev/sdi
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1639009
LU WWN Device Id: 5 0014ee 25f752df3
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Nov 25 14:25:50 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 179 177 021 Pre-fail Always - 8016
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 12
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 085 085 000 Old_age Always - 11393
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 12
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 83
194 Temperature_Celsius 0x0022 117 105 000 Old_age Always - 35
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
/dev/sdj
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-57-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EFRX-68WT0N0
Serial Number: WD-WCC4E1228884
LU WWN Device Id: 5 0014ee 209e58132
Firmware Version: 80.00A80
User Capacity: 4 000 787 030 016 bytes [4,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Nov 25 14:25:51 2015 MSK
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 175 174 021 Pre-fail Always - 8208
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 27
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 082 082 000 Old_age Always - 13598
10 Spin_Retry_Count 0x0032 100 253 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 27
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 8
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 120
194 Temperature_Celsius 0x0022 117 102 000 Old_age Always - 35
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
END OF MESSAGE
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] dm-ioctl: fix 4-characters indentations
From: Geliang Tang @ 2015-11-25 12:45 UTC (permalink / raw)
To: Alasdair Kergon, Mike Snitzer, dm-devel, Neil Brown
Cc: Geliang Tang, linux-raid, linux-kernel
Change 4-characters indentations to 8-characters.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
drivers/md/dm-ioctl.c | 58 +++++++++++++++++++++++++--------------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 80a4395..39aae6b 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -45,10 +45,10 @@ struct dm_table {
};
struct vers_iter {
- size_t param_size;
- struct dm_target_versions *vers, *old_vers;
- char *end;
- uint32_t flags;
+ size_t param_size;
+ struct dm_target_versions *vers, *old_vers;
+ char *end;
+ uint32_t flags;
};
@@ -557,36 +557,36 @@ static int list_devices(struct dm_ioctl *param, size_t param_size)
static void list_version_get_needed(struct target_type *tt, void *needed_param)
{
- size_t *needed = needed_param;
+ size_t *needed = needed_param;
- *needed += sizeof(struct dm_target_versions);
- *needed += strlen(tt->name);
- *needed += ALIGN_MASK;
+ *needed += sizeof(struct dm_target_versions);
+ *needed += strlen(tt->name);
+ *needed += ALIGN_MASK;
}
static void list_version_get_info(struct target_type *tt, void *param)
{
- struct vers_iter *info = param;
-
- /* Check space - it might have changed since the first iteration */
- if ((char *)info->vers + sizeof(tt->version) + strlen(tt->name) + 1 >
- info->end) {
-
- info->flags = DM_BUFFER_FULL_FLAG;
- return;
- }
-
- if (info->old_vers)
- info->old_vers->next = (uint32_t) ((void *)info->vers -
- (void *)info->old_vers);
- info->vers->version[0] = tt->version[0];
- info->vers->version[1] = tt->version[1];
- info->vers->version[2] = tt->version[2];
- info->vers->next = 0;
- strcpy(info->vers->name, tt->name);
-
- info->old_vers = info->vers;
- info->vers = align_ptr(((void *) ++info->vers) + strlen(tt->name) + 1);
+ struct vers_iter *info = param;
+
+ /* Check space - it might have changed since the first iteration */
+ if ((char *)info->vers + sizeof(tt->version) + strlen(tt->name) + 1 >
+ info->end) {
+
+ info->flags = DM_BUFFER_FULL_FLAG;
+ return;
+ }
+
+ if (info->old_vers)
+ info->old_vers->next = (uint32_t) ((void *)info->vers -
+ (void *)info->old_vers);
+ info->vers->version[0] = tt->version[0];
+ info->vers->version[1] = tt->version[1];
+ info->vers->version[2] = tt->version[2];
+ info->vers->next = 0;
+ strcpy(info->vers->name, tt->name);
+
+ info->old_vers = info->vers;
+ info->vers = align_ptr(((void *) ++info->vers) + strlen(tt->name) + 1);
}
static int list_versions(struct dm_ioctl *param, size_t param_size)
--
2.5.0
^ permalink raw reply related
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Phil Turmel @ 2015-11-25 13:22 UTC (permalink / raw)
To: Semyon Enskiy, linux-raid@vger.kernel.org
In-Reply-To: <3822301448453563@web17m.yandex.ru>
On 11/25/2015 07:12 AM, Semyon Enskiy wrote:
> Hi Phil.
>
> Thanks for your suggestions, I have followed them, but RAID5 at md3 not
> recovered at yet, maybe you will find time to suggest anything else.
>
> Exactly, power and data connections of SATA disks was not reliable, fixed
> this and after boot get no errors in kernel logs.
> md3 was replaced with "<ingore>" in mdadm.conf and commented in fstab before
> poweroff, things returned back after boot.
>
> # mdadm --assemble --update=revert-reshape /dev/md3
This ^^^ is a mistake. It did nothing because you didn't list all of
the component partitions. Stop md3 and try this part again. If it
still doesn't work, add --force.
> # mdadm --assemble --scan -vv
> Note the difference in --display and --examine outputs (see below) about
> total and delta device numbers, 10 in detail and 11 in examine.
--display is pretty much useless on an inactive array. The --examine
reports are the ones that matter.
> Also note, that sda3 is marked as "spare" device, I am wrote before in first
> message, that some useless commands was executed.
This is from the --add operation you should not have done.
> # mdadm --add /dev/md3 --re-add /dev/sda3
Augh! Don't guess at what to do! And even if the right thing, the
syntax is wrong (never put --add and --re-add together).
> mdadm: Cannot get array info for /dev/md3
> # This is because array is not started?
Yes.
[trim /]
> # mdadm --examine /dev/sd?3
[trim /]
Very good, you have device roles 0-7 & 9, plus one spare, matching the
array state. Put these devices in the --assemble --update command.
> # for x in /dev/sd[a-z] ; do echo $x ; smartctl -i -A $x ; done
[trim /]
Your drives are entirely healthy. No apparent lasting effects from the
problem cables/power.
For reference, your drive name to serial numbers to roles:
/dev/sda3 ==> WD-WCC4E1657399 ==> spare
/dev/sdb3 ==> WD-WCC4E1643332 ==> role 6
/dev/sdc3 ==> WD-WCC4E1649141 ==> role 7
/dev/sdd3 ==> WD-WCC4E0340253 ==> role 4
/dev/sde3 ==> WD-WCC4E1658818 ==> role 5
/dev/sdf3 ==> WD-WCC4E1349511 ==> role 0
/dev/sdg3 ==> WD-WCC4E1265787 ==> role 3
/dev/sdh3 ==> WD-WCC4E1639809 ==> role 2
/dev/sdi3 ==> WD-WCC4E1639009 ==> role 1
/dev/sdj3 ==> WD-WCC4E1228884 ==> role 9
Your next operations are:
mdadm --stop /dev/md3
mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
If successful, it should begin rebuilding onto /dev/sda3 (role 8).
If the above fails, repeat with --force. If that fails show the output
and do nothing else.
Phil
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Semyon Enskiy @ 2015-11-25 14:48 UTC (permalink / raw)
To: Phil Turmel, linux-raid@vger.kernel.org
In-Reply-To: <5655B62F.2070806@turmel.org>
> Your next operations are:
>
> mdadm --stop /dev/md3
>
> mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
>
> If successful, it should begin rebuilding onto /dev/sda3 (role 8).
>
> If the above fails, repeat with --force. If that fails show the output
> and do nothing else.
>
> Phil
# mdadm --stop /dev/md3
mdadm: stopped /dev/md3
# mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
mdadm: looking for devices for /dev/md3
mdadm: /dev/sda3 is identified as a member of /dev/md3, slot -1.
mdadm: /dev/sdb3 is identified as a member of /dev/md3, slot 6.
mdadm: /dev/sdc3 is identified as a member of /dev/md3, slot 7.
mdadm: /dev/sdd3 is identified as a member of /dev/md3, slot 4.
mdadm: /dev/sde3 is identified as a member of /dev/md3, slot 5.
mdadm: /dev/sdf3 is identified as a member of /dev/md3, slot 0.
mdadm: /dev/sdg3 is identified as a member of /dev/md3, slot 3.
mdadm: /dev/sdh3 is identified as a member of /dev/md3, slot 2.
mdadm: /dev/sdi3 is identified as a member of /dev/md3, slot 1.
mdadm: added /dev/sdi3 to /dev/md3 as 1
mdadm: added /dev/sdh3 to /dev/md3 as 2
mdadm: added /dev/sdg3 to /dev/md3 as 3
mdadm: added /dev/sdd3 to /dev/md3 as 4
mdadm: added /dev/sde3 to /dev/md3 as 5
mdadm: added /dev/sdb3 to /dev/md3 as 6
mdadm: added /dev/sdc3 to /dev/md3 as 7
mdadm: no uptodate device for slot 16 of /dev/md3
mdadm: no uptodate device for slot 18 of /dev/md3
mdadm: no uptodate device for slot 20 of /dev/md3
mdadm: added /dev/sda3 to /dev/md3 as -1
mdadm: added /dev/sdf3 to /dev/md3 as 0
mdadm: /dev/md3 assembled from 8 drives and 1 spare - not enough to start the array.
# mdadm -v --assemble --update=revert-reshape --force /dev/md3 /dev/sd[a-i]3
mdadm: looking for devices for /dev/md3
mdadm: /dev/sda3 is identified as a member of /dev/md3, slot -1.
mdadm: /dev/sdb3 is identified as a member of /dev/md3, slot 6.
mdadm: /dev/sdc3 is identified as a member of /dev/md3, slot 7.
mdadm: /dev/sdd3 is identified as a member of /dev/md3, slot 4.
mdadm: /dev/sde3 is identified as a member of /dev/md3, slot 5.
mdadm: /dev/sdf3 is identified as a member of /dev/md3, slot 0.
mdadm: /dev/sdg3 is identified as a member of /dev/md3, slot 3.
mdadm: /dev/sdh3 is identified as a member of /dev/md3, slot 2.
mdadm: /dev/sdi3 is identified as a member of /dev/md3, slot 1.
mdadm: added /dev/sdi3 to /dev/md3 as 1
mdadm: added /dev/sdh3 to /dev/md3 as 2
mdadm: added /dev/sdg3 to /dev/md3 as 3
mdadm: added /dev/sdd3 to /dev/md3 as 4
mdadm: added /dev/sde3 to /dev/md3 as 5
mdadm: added /dev/sdb3 to /dev/md3 as 6
mdadm: added /dev/sdc3 to /dev/md3 as 7
mdadm: no uptodate device for slot 16 of /dev/md3
mdadm: no uptodate device for slot 18 of /dev/md3
mdadm: no uptodate device for slot 20 of /dev/md3
mdadm: added /dev/sda3 to /dev/md3 as -1
mdadm: added /dev/sdf3 to /dev/md3 as 0
mdadm: /dev/md3 assembled from 8 drives and 1 spare - not enough to start the array.
# mdadm --examine /dev/sd?3
/dev/sda3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : c0155214:a9c8e378:d368b6f6:735048a8
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 952aa5ef - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : spare
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 375d85e2:9077dd68:bc1327af:8fee4112
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 75b9e502 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 6
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 67cd2bfa:affa578c:e0c1286a:bd4d2627
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 80c8e5f0 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 7
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 4490843e:d2c5c2e7:d222fa0a:f98b277c
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 165712cf - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 4
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sde3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 1d41056f:88149b1a:48e939e5:8c775e23
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : fb26c467 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 5
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdf3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : fa7c541d:a25babd8:14ffe1c0:c6c1578c
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : ac27a760 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 0
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdg3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : a4b8b425:b0307fe5:9eb8e3ac:ae985311
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 3259488d - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 3
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdh3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 345b0212:6c3a0ae8:d8ed9273:ecc53573
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 49c35750 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 2
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdi3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 70afdaad:b0979fb1:1b99ef18:dd58cc3a
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 1c2c4756 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 1
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdj3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 11
Avail Dev Size : 7799094927 (3718.90 GiB 3993.14 GB)
Array Size : 38995471360 (37188.98 GiB 39931.36 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 262144 sectors
New Offset : 251904 sectors
Super Offset : 8 sectors
State : clean
Device UUID : a5f2cea8:a89c88a0:0dd3900c:624f0491
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : 1 (10->11)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 4fda6fb3 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 9
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Semyon Enskiy @ 2015-11-25 14:55 UTC (permalink / raw)
To: Phil Turmel, linux-raid@vger.kernel.org
In-Reply-To: <240681448462882@web25o.yandex.ru>
Maybe assemble command should include sdj3 device too?
Like
# mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
not
# mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
^ permalink raw reply
* Re: [PATCH 2/3] block: Add badblock management for gendisks
From: Jeff Moyer @ 2015-11-25 15:37 UTC (permalink / raw)
To: Verma, Vishal L
Cc: linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-block@vger.kernel.org, neilb@suse.com, axboe@fb.com,
linux-nvdimm@ml01.01.org
In-Reply-To: <1448395840.14996.8.camel@intel.com>
"Verma, Vishal L" <vishal.l.verma@intel.com> writes:
> On Tue, 2015-11-24 at 14:14 -0500, Jeff Moyer wrote:
>>
>> I'm not sure whether it makes sense to continue without badblock
>> management for the RAID code. I was hoping Neil would comment on
>> that.
>>
>> -Jeff
>
> Not sure I follow? I believe I've kept all the badblocks functionality
> RAID already had..
What I mean to say is that the RAID code had previously embedded the
badblocks structure in one of its other data structures. As a result,
you would never get an allocation failure for it.
> On a related note, something I observed when testing with md:
>
> md's badblock list is per-device, and can be seen at:
> /sys/block/md0/md/dev-pmem0/bad_blocks
>
> Now if we have badblocks in the gendisks too, there is also:
> /sys/block/pmem0/bad_blocks
>
> The two are separate 'accounts' maintained by separate drivers (md for
> the former, and pmem for the latter). This can potentially be
> confusing..
>
> Should we consolidate the two, i.e. make md (re)use the gendisk
> badblocks for its purposes too?
I agree with what Dan said.
Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Phil Turmel @ 2015-11-25 15:44 UTC (permalink / raw)
To: Semyon Enskiy, linux-raid@vger.kernel.org
In-Reply-To: <939171448463324@web17m.yandex.ru>
On 11/25/2015 09:55 AM, Semyon Enskiy wrote:
> Maybe assemble command should include sdj3 device too?
> Like
> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
> not
> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
Yes, my mistake. :-( Try again, including 'sdj3'.
Phil
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Semyon Enskiy @ 2015-11-25 16:29 UTC (permalink / raw)
To: Phil Turmel, linux-raid@vger.kernel.org
In-Reply-To: <5655D75B.9020901@turmel.org>
>> Maybe assemble command should include sdj3 device too?
>> Like
>> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
>> not
>> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
>
> Yes, my mistake. :-( Try again, including 'sdj3'.
>
> Phil
# mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
mdadm: looking for devices for /dev/md3
mdadm: superblock on /dev/sdj3 doesn't match others - assembly aborted
# mdadm -v --assemble --update=revert-reshape --force /dev/md3 /dev/sd[a-j]3
mdadm: looking for devices for /dev/md3
mdadm: superblock on /dev/sdj3 doesn't match others - assembly aborted
Note, that --examine in previous message shows delta devices value "-1" for
all members of array, excepting sdj3, which has value "1", without minus
symbol.
According to mdadm wiki 1.2v superblock placed on device after first 4K and
has size 256 Bytes, plus 2 Bytes per device in the array, in current case
this is 276 Bytes. Dumping superblock:
# for i in /dev/sd?3; do dd ibs=1c skip=4000 count=276 if=$i of=`echo $i | tr -d /`-superblock.raw; done
# for i in devsd*.raw; do echo -e "\n$i" && hd -v $i; done > superblock-dump-000.txt
devsda3-superblock.raw
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 0e 00 00 00 00 00 00 00 c0 15 52 14 a9 c8 e3 78 |..........R....x|
00000110 d3 68 b6 f6 |.h..|
00000114
devsdb3-superblock.raw
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 06 00 00 00 00 00 00 00 37 5d 85 e2 90 77 dd 68 |........7]...w.h|
00000110 bc 13 27 af |..'.|
00000114
devsdc3-superblock.raw
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 0b 00 00 00 00 00 00 00 67 cd 2b fa af fa 57 8c |........g.+...W.|
00000110 e0 c1 28 6a |..(j|
00000114
devsdd3-superblock.raw
00000000 4e fc 4f 03 50 51 50 4e fe 4f 02 50 4e 4e fe 4f |N.O.PQPN.O.PNN.O|
00000010 ff 4b ff 49 1b 4a 4e 4d 4a 4d 4b 4c 49 4a 46 47 |.K.I.JNMJMKLIJFG|
00000020 47 49 48 49 48 47 46 45 45 46 46 45 47 48 46 48 |GIHIHGFEEFFEGHFH|
00000030 46 fe 45 fe 46 00 42 fe 46 08 44 45 44 47 46 46 |F.E.F.B.F.DEDGFF|
00000040 45 45 46 fd 45 05 46 45 46 46 45 45 fc 46 03 45 |EEF.E.FEFFEE.F.E|
00000050 46 46 45 fc 46 13 45 44 46 45 44 46 45 45 46 45 |FFE.F.EDFEDFEEFE|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 04 00 00 00 00 00 00 00 44 90 84 3e d2 c5 c2 e7 |........D..>....|
00000110 d2 22 fa 0a |."..|
00000114
devsde3-superblock.raw
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 05 00 00 00 00 00 00 00 1d 41 05 6f 88 14 9b 1a |.........A.o....|
00000110 48 e9 39 e5 |H.9.|
00000114
devsdf3-superblock.raw
00000000 3c 39 37 39 3a 3a 39 38 36 39 38 37 34 35 35 36 |<979::9869874556|
00000010 36 31 37 35 35 31 31 35 36 31 34 35 37 35 35 37 |6175511561457557|
00000020 37 35 31 36 36 35 37 38 36 35 34 38 37 37 35 39 |7516657865487759|
00000030 3a 37 3a 3b ff 38 09 3b 3a 3a 3b 3a 3d 3b 3c 3c |:7:;.8.;::;:=;<<|
00000040 40 fe 3d fc 41 03 45 43 43 41 fe 43 ff 46 02 45 |@.=.A.ECCA.C.F.E|
00000050 48 48 fa 4a 14 4b 4a 4e 4a 4d 4d 4f 4f 4e 4e 51 |HH.J.KJNJMMOONNQ|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 00 00 00 00 00 00 00 00 fa 7c 54 1d a2 5b ab d8 |.........|T..[..|
00000110 14 ff e1 c0 |....|
00000114
devsdg3-superblock.raw
00000000 5e 75 7c 7f 74 7b 81 8a 97 a0 a8 af b0 be c6 da |^u|.t{..........|
00000010 e5 e9 f2 f3 f6 f7 f2 ef ee ed e9 e7 e8 e8 e3 de |................|
00000020 df e1 df e0 da de e2 e0 df d9 dc d5 d3 ce d3 d3 |................|
00000030 d1 ce cb 07 d2 d5 d7 d7 da d7 d7 db fe da 4a d9 |..............J.|
00000040 d6 d6 d5 d5 d6 d2 ce cc d2 d1 cf d0 d2 d4 d9 db |................|
00000050 db dc da db da da d8 da da d7 cf d3 cf ce ce d2 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 03 00 00 00 00 00 00 00 a4 b8 b4 25 b0 30 7f e5 |...........%.0..|
00000110 9e b8 e3 ac |....|
00000114
devsdh3-superblock.raw
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 02 00 00 00 00 00 00 00 34 5b 02 12 6c 3a 0a e8 |........4[..l:..|
00000110 d8 ed 92 73 |...s|
00000114
devsdi3-superblock.raw
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0a 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 ff ff ff ff 02 00 00 00 00 04 00 00 00 28 00 00 |.............(..|
000000e0 00 d8 03 00 00 00 00 00 8f e6 dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 0c 00 00 00 00 00 00 00 70 af da ad b0 97 9f b1 |........p.......|
00000110 1b 99 ef 18 |....|
00000114
devsdj3-superblock.raw
00000000 8b f5 bf f2 9f 03 b5 cb fd 29 28 17 15 d9 c5 6a |.........)(....j|
00000010 37 52 cb f3 72 47 43 45 3c 44 23 33 2e d2 de fa |7R..rGCE<D#3....|
00000020 e1 d6 e4 da fb f1 7e c9 ec 0c ea e1 c9 f0 f2 f2 |......~.........|
00000030 db cd c9 2f 3a 70 d1 2a ed a0 d0 d1 f9 da 4c cd |.../:p.*......L.|
00000040 b7 05 f1 cb 2d ad 6b b9 db 39 54 8a 92 cb 90 72 |....-.k..9T....r|
00000050 3c 67 65 43 90 fa ba ba b0 b7 dd b4 af a4 a1 b1 |<geC............|
00000060 fc 4e 2b a9 01 00 00 00 45 00 00 00 00 00 00 00 |.N+.....E.......|
00000070 9b dc 09 39 48 38 89 af b6 7c 19 9b 2a ae cb 4e |...9H8...|..*..N|
00000080 75 62 75 6e 74 75 3a 33 00 00 00 00 00 00 00 00 |ubuntu:3........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 c8 f6 d0 53 00 00 00 00 05 00 00 00 02 00 00 00 |...S............|
000000b0 00 bc dc d0 01 00 00 00 00 04 00 00 0b 00 00 00 |................|
000000c0 08 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 01 00 00 00 02 00 00 00 00 04 00 00 00 d8 ff ff |................|
000000e0 00 00 04 00 00 00 00 00 8f be dc d0 01 00 00 00 |................|
000000f0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000100 0a 00 00 00 00 00 00 00 a5 f2 ce a8 a8 9c 88 a0 |................|
00000110 0d d3 90 0c |....|
00000114
END OF MESSAGE
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Phil Turmel @ 2015-11-25 16:58 UTC (permalink / raw)
To: Semyon Enskiy, linux-raid@vger.kernel.org
In-Reply-To: <166511448468944@web24o.yandex.ru>
On 11/25/2015 11:29 AM, Semyon Enskiy wrote:
>>> Maybe assemble command should include sdj3 device too?
>>> Like
>>> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
>>> not
>>> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-i]3
>>
>> Yes, my mistake. :-( Try again, including 'sdj3'.
>>
>> Phil
>
> # mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
> mdadm: looking for devices for /dev/md3
> mdadm: superblock on /dev/sdj3 doesn't match others - assembly aborted
>
> # mdadm -v --assemble --update=revert-reshape --force /dev/md3 /dev/sd[a-j]3
> mdadm: looking for devices for /dev/md3
> mdadm: superblock on /dev/sdj3 doesn't match others - assembly aborted
>
> Note, that --examine in previous message shows delta devices value "-1" for
> all members of array, excepting sdj3, which has value "1", without minus
> symbol.
Hmmm. That's interesting. That means mdadm wrote the revert-reshape
before it finished assembly. Try this:
mdadm --stop /dev/md3
mdadm --assemble --update=revert-reshape /dev/md3 /dev/sdj3
That should fail w/ not enough to start, but apply the revert to that
one drive. Then --stop again, and try with [a-j].
Phil
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Semyon Enskiy @ 2015-11-25 17:32 UTC (permalink / raw)
To: Phil Turmel, linux-raid@vger.kernel.org
In-Reply-To: <5655E8D1.2050906@turmel.org>
> Hmmm. That's interesting. That means mdadm wrote the revert-reshape
> before it finished assembly. Try this:
>
> mdadm --stop /dev/md3
>
> mdadm --assemble --update=revert-reshape /dev/md3 /dev/sdj3
>
> That should fail w/ not enough to start, but apply the revert to that
> one drive. Then --stop again, and try with [a-j].
Phil, thanks for your sustaining.
Does you think, that problem is that "Raid Devices : 10", but
"Array State : AAAAAAAA.A.", where the extra, 11th, device is sdj3, which
was rejected from system in past, but record about it leave in superblock?
# mdadm --stop /dev/md3
mdadm: error opening /dev/md3: No such file or directory
# mdadm --assemble --update=revert-reshape /dev/md3 /dev/sdj3
mdadm: /dev/md3 assembled from 1 drive - not enough to start the array.
# mdadm --stop /dev/md3
mdadm: error opening /dev/md3: No such file or directory
# mdadm -v --assemble --update=revert-reshape /dev/md3 /dev/sd[a-j]3
mdadm: looking for devices for /dev/md3
mdadm: /dev/sda3 is identified as a member of /dev/md3, slot -1.
mdadm: /dev/sdb3 is identified as a member of /dev/md3, slot 6.
mdadm: /dev/sdc3 is identified as a member of /dev/md3, slot 7.
mdadm: /dev/sdd3 is identified as a member of /dev/md3, slot 4.
mdadm: /dev/sde3 is identified as a member of /dev/md3, slot 5.
mdadm: /dev/sdf3 is identified as a member of /dev/md3, slot 0.
mdadm: /dev/sdg3 is identified as a member of /dev/md3, slot 3.
mdadm: /dev/sdh3 is identified as a member of /dev/md3, slot 2.
mdadm: /dev/sdi3 is identified as a member of /dev/md3, slot 1.
mdadm: /dev/sdj3 is identified as a member of /dev/md3, slot 9.
mdadm: added /dev/sdi3 to /dev/md3 as 1
mdadm: added /dev/sdh3 to /dev/md3 as 2
mdadm: added /dev/sdg3 to /dev/md3 as 3
mdadm: added /dev/sdd3 to /dev/md3 as 4
mdadm: added /dev/sde3 to /dev/md3 as 5
mdadm: added /dev/sdb3 to /dev/md3 as 6
mdadm: added /dev/sdc3 to /dev/md3 as 7
mdadm: no uptodate device for slot 16 of /dev/md3
mdadm: added /dev/sdj3 to /dev/md3 as 9
mdadm: no uptodate device for slot 20 of /dev/md3
mdadm: added /dev/sda3 to /dev/md3 as -1
mdadm: added /dev/sdf3 to /dev/md3 as 0
mdadm: /dev/md3 assembled from 9 drives and 1 spare - not enough to start the array.
# mdadm -v --assemble --update=revert-reshape --force /dev/md3 /dev/sd[a-j]3
mdadm: looking for devices for /dev/md3
mdadm: /dev/sda3 is identified as a member of /dev/md3, slot -1.
mdadm: /dev/sdb3 is identified as a member of /dev/md3, slot 6.
mdadm: /dev/sdc3 is identified as a member of /dev/md3, slot 7.
mdadm: /dev/sdd3 is identified as a member of /dev/md3, slot 4.
mdadm: /dev/sde3 is identified as a member of /dev/md3, slot 5.
mdadm: /dev/sdf3 is identified as a member of /dev/md3, slot 0.
mdadm: /dev/sdg3 is identified as a member of /dev/md3, slot 3.
mdadm: /dev/sdh3 is identified as a member of /dev/md3, slot 2.
mdadm: /dev/sdi3 is identified as a member of /dev/md3, slot 1.
mdadm: /dev/sdj3 is identified as a member of /dev/md3, slot 9.
mdadm: added /dev/sdi3 to /dev/md3 as 1
mdadm: added /dev/sdh3 to /dev/md3 as 2
mdadm: added /dev/sdg3 to /dev/md3 as 3
mdadm: added /dev/sdd3 to /dev/md3 as 4
mdadm: added /dev/sde3 to /dev/md3 as 5
mdadm: added /dev/sdb3 to /dev/md3 as 6
mdadm: added /dev/sdc3 to /dev/md3 as 7
mdadm: no uptodate device for slot 16 of /dev/md3
mdadm: added /dev/sdj3 to /dev/md3 as 9
mdadm: no uptodate device for slot 20 of /dev/md3
mdadm: added /dev/sda3 to /dev/md3 as -1
mdadm: added /dev/sdf3 to /dev/md3 as 0
mdadm: /dev/md3 assembled from 9 drives and 1 spare - not enough to start the array.
# mdadm --examine /dev/sd?3
/dev/sda3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : c0155214:a9c8e378:d368b6f6:735048a8
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 952aa5ef - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : spare
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 375d85e2:9077dd68:bc1327af:8fee4112
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 75b9e502 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 6
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 67cd2bfa:affa578c:e0c1286a:bd4d2627
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 80c8e5f0 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 7
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 4490843e:d2c5c2e7:d222fa0a:f98b277c
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 165712cf - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 4
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sde3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 1d41056f:88149b1a:48e939e5:8c775e23
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : fb26c467 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 5
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdf3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : fa7c541d:a25babd8:14ffe1c0:c6c1578c
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : ac27a760 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 0
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdg3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : a4b8b425:b0307fe5:9eb8e3ac:ae985311
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 3259488d - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 3
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdh3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 345b0212:6c3a0ae8:d8ed9273:ecc53573
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 49c35750 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 2
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdi3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 70afdaad:b0979fb1:1b99ef18:dd58cc3a
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : 1c2c4756 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 1
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdj3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x45
Array UUID : 9bdc0939:483889af:b67c199b:2aaecb4e
Name : ubuntu:3
Creation Time : Thu Jul 24 16:06:32 2014
Raid Level : raid5
Raid Devices : 10
Avail Dev Size : 7799105167 (3718.90 GiB 3993.14 GB)
Array Size : 35095924224 (33470.08 GiB 35938.23 GB)
Used Dev Size : 7799094272 (3718.90 GiB 3993.14 GB)
Data Offset : 251904 sectors
New Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : a5f2cea8:a89c88a0:0dd3900c:624f0491
Internal Bitmap : 8 sectors from superblock
Reshape pos'n : 0
Delta Devices : -1 (11->10)
Update Time : Fri Nov 6 16:53:06 2015
Checksum : 4fdabfb0 - correct
Events : 21586
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 9
Array State : AAAAAAAA.A. ('A' == active, '.' == missing, 'R' == replacing)
END OF MESSAGE
^ permalink raw reply
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Phil Turmel @ 2015-11-25 17:49 UTC (permalink / raw)
To: Semyon Enskiy, linux-raid@vger.kernel.org
In-Reply-To: <398591448472730@web17m.yandex.ru>
On 11/25/2015 12:32 PM, Semyon Enskiy wrote:
> Does you think, that problem is that "Raid Devices : 10", but
> "Array State : AAAAAAAA.A.", where the extra, 11th, device is sdj3, which
> was rejected from system in past, but record about it leave in superblock?
No. It just can't get past the fact that your array is double-degraded,
even though it isn't really, once the revert succeeds.
At this point, I don't see a way out without --create. Fortunately, we
have complete details on your array, so we can supply the correct paramters:
mdadm --stop /dev/md3
mdadm --create --assume-clean --chunk=512 --data-offset=262144 \
--level=5 --raid-devices=10 --metadata=1.2 /dev/md3 \
/dev/sd{f,i,h,g,d,e,b,c}3 missing /dev/sdj3
Note that you cannot use [] notation -- it doesn't maintain the order of
the letters. The keyword 'missing' takes the place of /dev/sda3. It's
possible it would be fine, but I'd rather not risk it.
You should be able to access the content at this point. Copy out any
super-critical files. Then add sda3:
mdadm --add /dev/md3 /dev/sda3
This should initiate the rebuild.
Update your mdadm.conf file to use the new UUID, and update your initramfs.
Phil
^ permalink raw reply
* Re: [PATCH 2/3] block: Add badblock management for gendisks
From: Verma, Vishal L @ 2015-11-25 17:55 UTC (permalink / raw)
To: jmoyer@redhat.com
Cc: linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-block@vger.kernel.org, neilb@suse.com, axboe@fb.com,
linux-nvdimm@ml01.01.org
In-Reply-To: <x49h9kanl7t.fsf@segfault.boston.devel.redhat.com>
On Wed, 2015-11-25 at 10:37 -0500, Jeff Moyer wrote:
> "Verma, Vishal L" <vishal.l.verma@intel.com> writes:
>
> > On Tue, 2015-11-24 at 14:14 -0500, Jeff Moyer wrote:
> > >
> > > I'm not sure whether it makes sense to continue without badblock
> > > management for the RAID code. I was hoping Neil would comment on
> > > that.
> > >
> > > -Jeff
> >
> > Not sure I follow? I believe I've kept all the badblocks
> > functionality
> > RAID already had..
>
> What I mean to say is that the RAID code had previously embedded the
> badblocks structure in one of its other data structures. As a result,
> you would never get an allocation failure for it.
>
Ah I see - I don't think that has effectively changed. 'rdev' still
contains a statically allocated badblocks structure (as opposed to
gendisk, which just stores a pointer). md used to dynamically allocate
the storage space inside badblocks (bb->page), and that is still the
case using badblocks_init.
-Vishal
^ permalink raw reply
* Re: [PATCH 2/3] block: Add badblock management for gendisks
From: Jeff Moyer @ 2015-11-25 18:07 UTC (permalink / raw)
To: Verma, Vishal L
Cc: linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-block@vger.kernel.org, neilb@suse.com, axboe@fb.com,
linux-nvdimm@ml01.01.org
In-Reply-To: <1448474142.5911.4.camel@intel.com>
"Verma, Vishal L" <vishal.l.verma@intel.com> writes:
> On Wed, 2015-11-25 at 10:37 -0500, Jeff Moyer wrote:
>> "Verma, Vishal L" <vishal.l.verma@intel.com> writes:
>>
>> > On Tue, 2015-11-24 at 14:14 -0500, Jeff Moyer wrote:
>> > >
>> > > I'm not sure whether it makes sense to continue without badblock
>> > > management for the RAID code. I was hoping Neil would comment on
>> > > that.
>> > >
>> > > -Jeff
>> >
>> > Not sure I follow? I believe I've kept all the badblocks
>> > functionality
>> > RAID already had..
>>
>> What I mean to say is that the RAID code had previously embedded the
>> badblocks structure in one of its other data structures. As a result,
>> you would never get an allocation failure for it.
>>
> Ah I see - I don't think that has effectively changed. 'rdev' still
> contains a statically allocated badblocks structure (as opposed to
> gendisk, which just stores a pointer). md used to dynamically allocate
> the storage space inside badblocks (bb->page), and that is still the
> case using badblocks_init.
Ah, ok. Sorry I didn't dig into that further.
Thanks,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v2 0/3] Badblock tracking for gendisks
From: Vishal Verma @ 2015-11-25 18:43 UTC (permalink / raw)
To: linux-nvdimm
Cc: Vishal Verma, linux-block, linux-raid, linux-scsi, Jens Axboe,
NeilBrown, Jeff Moyer
v2:
- In badblocks_free, make 'page' NULL (patch 1)
- Move the core badblocks code to a new .c file (patch 1) (Jens)
- Fix a sizeof usage in disk_alloc_badblocks (patch 2) (Dan)
- Since disk_alloc_badblocks can fail, check disk->bb for NULL in the
genhd wrappers (patch 2) (Jeff)
- Update the md conversion to also ise the badblocks init and free
functions (patch 3)
- Remove the BB_* macros from md.h as they are now in badblocks.h (patch 3)
Patch 1 copies badblock management code into a header of its own,
making it generally available. It follows common libraries of code
such as linked lists, where anyone may embed a core data structure
in another place, and use the provided accessor functions to
manipulate the data.
Patch 2 adds badblock tracking to gendisks (in preparation for use
by NVDIMM devices). Right now, it is turned on unconditionally - I'd
appreciate comments on if that is the right path.
Patch 3 converts md over to use the new badblocks 'library'. I have
done some pretty simple testing on this - created a raid 1 device,
made sure the sysfs entries show up, and can be used to add and view
badblocks. A closer look by the md folks would be nice here.
Vishal Verma (3):
badblocks: Add core badblock management code
block: Add badblock management for gendisks
md: convert to use the generic badblocks code
block/Makefile | 2 +-
block/badblocks.c | 523 ++++++++++++++++++++++++++++++++++++++++++++++
block/genhd.c | 81 +++++++
drivers/md/md.c | 507 ++------------------------------------------
drivers/md/md.h | 40 +---
include/linux/badblocks.h | 53 +++++
include/linux/genhd.h | 6 +
7 files changed, 687 insertions(+), 525 deletions(-)
create mode 100644 block/badblocks.c
create mode 100644 include/linux/badblocks.h
--
2.5.0
^ permalink raw reply
* [PATCH v2 1/3] badblocks: Add core badblock management code
From: Vishal Verma @ 2015-11-25 18:43 UTC (permalink / raw)
To: linux-nvdimm
Cc: Vishal Verma, linux-block, linux-raid, linux-scsi, Jens Axboe,
NeilBrown, Jeff Moyer
In-Reply-To: <1448477013-9174-1-git-send-email-vishal.l.verma@intel.com>
Take the core badblocks implementation from md, and make it generally
available. This follows the same style as kernel implementations of
linked lists, rb-trees etc, where you can have a structure that can be
embedded anywhere, and accessor functions to manipulate the data.
The only changes in this copy of the code are ones to generalize
function/variable names from md-specific ones. Also add init and free
functions.
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
block/Makefile | 2 +-
block/badblocks.c | 523 ++++++++++++++++++++++++++++++++++++++++++++++
include/linux/badblocks.h | 53 +++++
3 files changed, 577 insertions(+), 1 deletion(-)
create mode 100644 block/badblocks.c
create mode 100644 include/linux/badblocks.h
diff --git a/block/Makefile b/block/Makefile
index 00ecc97..db5f622 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -8,7 +8,7 @@ obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \
blk-iopoll.o blk-lib.o blk-mq.o blk-mq-tag.o \
blk-mq-sysfs.o blk-mq-cpu.o blk-mq-cpumap.o ioctl.o \
genhd.o scsi_ioctl.o partition-generic.o ioprio.o \
- partitions/
+ badblocks.o partitions/
obj-$(CONFIG_BOUNCE) += bounce.o
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
diff --git a/block/badblocks.c b/block/badblocks.c
new file mode 100644
index 0000000..6e07855
--- /dev/null
+++ b/block/badblocks.c
@@ -0,0 +1,523 @@
+/*
+ * Bad block management
+ *
+ * - Heavily based on MD badblocks code from Neil Brown
+ *
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ */
+
+#include <linux/badblocks.h>
+#include <linux/seqlock.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+#include <linux/slab.h>
+
+/*
+ * We can record which blocks on each device are 'bad' and so just
+ * fail those blocks, or that stripe, rather than the whole device.
+ * Entries in the bad-block table are 64bits wide. This comprises:
+ * Length of bad-range, in sectors: 0-511 for lengths 1-512
+ * Start of bad-range, sector offset, 54 bits (allows 8 exbibytes)
+ * A 'shift' can be set so that larger blocks are tracked and
+ * consequently larger devices can be covered.
+ * 'Acknowledged' flag - 1 bit. - the most significant bit.
+ *
+ * Locking of the bad-block table uses a seqlock so badblocks_check
+ * might need to retry if it is very unlucky.
+ * We will sometimes want to check for bad blocks in a bi_end_io function,
+ * so we use the write_seqlock_irq variant.
+ *
+ * When looking for a bad block we specify a range and want to
+ * know if any block in the range is bad. So we binary-search
+ * to the last range that starts at-or-before the given endpoint,
+ * (or "before the sector after the target range")
+ * then see if it ends after the given start.
+ * We return
+ * 0 if there are no known bad blocks in the range
+ * 1 if there are known bad block which are all acknowledged
+ * -1 if there are bad blocks which have not yet been acknowledged in metadata.
+ * plus the start/length of the first bad section we overlap.
+ */
+int badblocks_check(struct badblocks *bb, sector_t s, int sectors,
+ sector_t *first_bad, int *bad_sectors)
+{
+ int hi;
+ int lo;
+ u64 *p = bb->page;
+ int rv;
+ sector_t target = s + sectors;
+ unsigned seq;
+
+ if (bb->shift > 0) {
+ /* round the start down, and the end up */
+ s >>= bb->shift;
+ target += (1<<bb->shift) - 1;
+ target >>= bb->shift;
+ sectors = target - s;
+ }
+ /* 'target' is now the first block after the bad range */
+
+retry:
+ seq = read_seqbegin(&bb->lock);
+ lo = 0;
+ rv = 0;
+ hi = bb->count;
+
+ /* Binary search between lo and hi for 'target'
+ * i.e. for the last range that starts before 'target'
+ */
+ /* INVARIANT: ranges before 'lo' and at-or-after 'hi'
+ * are known not to be the last range before target.
+ * VARIANT: hi-lo is the number of possible
+ * ranges, and decreases until it reaches 1
+ */
+ while (hi - lo > 1) {
+ int mid = (lo + hi) / 2;
+ sector_t a = BB_OFFSET(p[mid]);
+
+ if (a < target)
+ /* This could still be the one, earlier ranges
+ * could not.
+ */
+ lo = mid;
+ else
+ /* This and later ranges are definitely out. */
+ hi = mid;
+ }
+ /* 'lo' might be the last that started before target, but 'hi' isn't */
+ if (hi > lo) {
+ /* need to check all range that end after 's' to see if
+ * any are unacknowledged.
+ */
+ while (lo >= 0 &&
+ BB_OFFSET(p[lo]) + BB_LEN(p[lo]) > s) {
+ if (BB_OFFSET(p[lo]) < target) {
+ /* starts before the end, and finishes after
+ * the start, so they must overlap
+ */
+ if (rv != -1 && BB_ACK(p[lo]))
+ rv = 1;
+ else
+ rv = -1;
+ *first_bad = BB_OFFSET(p[lo]);
+ *bad_sectors = BB_LEN(p[lo]);
+ }
+ lo--;
+ }
+ }
+
+ if (read_seqretry(&bb->lock, seq))
+ goto retry;
+
+ return rv;
+}
+EXPORT_SYMBOL_GPL(badblocks_check);
+
+/*
+ * Add a range of bad blocks to the table.
+ * This might extend the table, or might contract it
+ * if two adjacent ranges can be merged.
+ * We binary-search to find the 'insertion' point, then
+ * decide how best to handle it.
+ */
+int badblocks_set(struct badblocks *bb, sector_t s, int sectors,
+ int acknowledged)
+{
+ u64 *p;
+ int lo, hi;
+ int rv = 1;
+ unsigned long flags;
+
+ if (bb->shift < 0)
+ /* badblocks are disabled */
+ return 0;
+
+ if (bb->shift) {
+ /* round the start down, and the end up */
+ sector_t next = s + sectors;
+
+ s >>= bb->shift;
+ next += (1<<bb->shift) - 1;
+ next >>= bb->shift;
+ sectors = next - s;
+ }
+
+ write_seqlock_irqsave(&bb->lock, flags);
+
+ p = bb->page;
+ lo = 0;
+ hi = bb->count;
+ /* Find the last range that starts at-or-before 's' */
+ while (hi - lo > 1) {
+ int mid = (lo + hi) / 2;
+ sector_t a = BB_OFFSET(p[mid]);
+
+ if (a <= s)
+ lo = mid;
+ else
+ hi = mid;
+ }
+ if (hi > lo && BB_OFFSET(p[lo]) > s)
+ hi = lo;
+
+ if (hi > lo) {
+ /* we found a range that might merge with the start
+ * of our new range
+ */
+ sector_t a = BB_OFFSET(p[lo]);
+ sector_t e = a + BB_LEN(p[lo]);
+ int ack = BB_ACK(p[lo]);
+
+ if (e >= s) {
+ /* Yes, we can merge with a previous range */
+ if (s == a && s + sectors >= e)
+ /* new range covers old */
+ ack = acknowledged;
+ else
+ ack = ack && acknowledged;
+
+ if (e < s + sectors)
+ e = s + sectors;
+ if (e - a <= BB_MAX_LEN) {
+ p[lo] = BB_MAKE(a, e-a, ack);
+ s = e;
+ } else {
+ /* does not all fit in one range,
+ * make p[lo] maximal
+ */
+ if (BB_LEN(p[lo]) != BB_MAX_LEN)
+ p[lo] = BB_MAKE(a, BB_MAX_LEN, ack);
+ s = a + BB_MAX_LEN;
+ }
+ sectors = e - s;
+ }
+ }
+ if (sectors && hi < bb->count) {
+ /* 'hi' points to the first range that starts after 's'.
+ * Maybe we can merge with the start of that range
+ */
+ sector_t a = BB_OFFSET(p[hi]);
+ sector_t e = a + BB_LEN(p[hi]);
+ int ack = BB_ACK(p[hi]);
+
+ if (a <= s + sectors) {
+ /* merging is possible */
+ if (e <= s + sectors) {
+ /* full overlap */
+ e = s + sectors;
+ ack = acknowledged;
+ } else
+ ack = ack && acknowledged;
+
+ a = s;
+ if (e - a <= BB_MAX_LEN) {
+ p[hi] = BB_MAKE(a, e-a, ack);
+ s = e;
+ } else {
+ p[hi] = BB_MAKE(a, BB_MAX_LEN, ack);
+ s = a + BB_MAX_LEN;
+ }
+ sectors = e - s;
+ lo = hi;
+ hi++;
+ }
+ }
+ if (sectors == 0 && hi < bb->count) {
+ /* we might be able to combine lo and hi */
+ /* Note: 's' is at the end of 'lo' */
+ sector_t a = BB_OFFSET(p[hi]);
+ int lolen = BB_LEN(p[lo]);
+ int hilen = BB_LEN(p[hi]);
+ int newlen = lolen + hilen - (s - a);
+
+ if (s >= a && newlen < BB_MAX_LEN) {
+ /* yes, we can combine them */
+ int ack = BB_ACK(p[lo]) && BB_ACK(p[hi]);
+
+ p[lo] = BB_MAKE(BB_OFFSET(p[lo]), newlen, ack);
+ memmove(p + hi, p + hi + 1,
+ (bb->count - hi - 1) * 8);
+ bb->count--;
+ }
+ }
+ while (sectors) {
+ /* didn't merge (it all).
+ * Need to add a range just before 'hi'
+ */
+ if (bb->count >= MAX_BADBLOCKS) {
+ /* No room for more */
+ rv = 0;
+ break;
+ } else {
+ int this_sectors = sectors;
+
+ memmove(p + hi + 1, p + hi,
+ (bb->count - hi) * 8);
+ bb->count++;
+
+ if (this_sectors > BB_MAX_LEN)
+ this_sectors = BB_MAX_LEN;
+ p[hi] = BB_MAKE(s, this_sectors, acknowledged);
+ sectors -= this_sectors;
+ s += this_sectors;
+ }
+ }
+
+ bb->changed = 1;
+ if (!acknowledged)
+ bb->unacked_exist = 1;
+ write_sequnlock_irqrestore(&bb->lock, flags);
+
+ return rv;
+}
+EXPORT_SYMBOL_GPL(badblocks_set);
+
+/*
+ * Remove a range of bad blocks from the table.
+ * This may involve extending the table if we spilt a region,
+ * but it must not fail. So if the table becomes full, we just
+ * drop the remove request.
+ */
+int badblocks_clear(struct badblocks *bb, sector_t s, int sectors)
+{
+ u64 *p;
+ int lo, hi;
+ sector_t target = s + sectors;
+ int rv = 0;
+
+ if (bb->shift > 0) {
+ /* When clearing we round the start up and the end down.
+ * This should not matter as the shift should align with
+ * the block size and no rounding should ever be needed.
+ * However it is better the think a block is bad when it
+ * isn't than to think a block is not bad when it is.
+ */
+ s += (1<<bb->shift) - 1;
+ s >>= bb->shift;
+ target >>= bb->shift;
+ sectors = target - s;
+ }
+
+ write_seqlock_irq(&bb->lock);
+
+ p = bb->page;
+ lo = 0;
+ hi = bb->count;
+ /* Find the last range that starts before 'target' */
+ while (hi - lo > 1) {
+ int mid = (lo + hi) / 2;
+ sector_t a = BB_OFFSET(p[mid]);
+
+ if (a < target)
+ lo = mid;
+ else
+ hi = mid;
+ }
+ if (hi > lo) {
+ /* p[lo] is the last range that could overlap the
+ * current range. Earlier ranges could also overlap,
+ * but only this one can overlap the end of the range.
+ */
+ if (BB_OFFSET(p[lo]) + BB_LEN(p[lo]) > target) {
+ /* Partial overlap, leave the tail of this range */
+ int ack = BB_ACK(p[lo]);
+ sector_t a = BB_OFFSET(p[lo]);
+ sector_t end = a + BB_LEN(p[lo]);
+
+ if (a < s) {
+ /* we need to split this range */
+ if (bb->count >= MAX_BADBLOCKS) {
+ rv = -ENOSPC;
+ goto out;
+ }
+ memmove(p+lo+1, p+lo, (bb->count - lo) * 8);
+ bb->count++;
+ p[lo] = BB_MAKE(a, s-a, ack);
+ lo++;
+ }
+ p[lo] = BB_MAKE(target, end - target, ack);
+ /* there is no longer an overlap */
+ hi = lo;
+ lo--;
+ }
+ while (lo >= 0 &&
+ BB_OFFSET(p[lo]) + BB_LEN(p[lo]) > s) {
+ /* This range does overlap */
+ if (BB_OFFSET(p[lo]) < s) {
+ /* Keep the early parts of this range. */
+ int ack = BB_ACK(p[lo]);
+ sector_t start = BB_OFFSET(p[lo]);
+
+ p[lo] = BB_MAKE(start, s - start, ack);
+ /* now low doesn't overlap, so.. */
+ break;
+ }
+ lo--;
+ }
+ /* 'lo' is strictly before, 'hi' is strictly after,
+ * anything between needs to be discarded
+ */
+ if (hi - lo > 1) {
+ memmove(p+lo+1, p+hi, (bb->count - hi) * 8);
+ bb->count -= (hi - lo - 1);
+ }
+ }
+
+ bb->changed = 1;
+out:
+ write_sequnlock_irq(&bb->lock);
+ return rv;
+}
+EXPORT_SYMBOL_GPL(badblocks_clear);
+
+/*
+ * Acknowledge all bad blocks in a list.
+ * This only succeeds if ->changed is clear. It is used by
+ * in-kernel metadata updates
+ */
+void ack_all_badblocks(struct badblocks *bb)
+{
+ if (bb->page == NULL || bb->changed)
+ /* no point even trying */
+ return;
+ write_seqlock_irq(&bb->lock);
+
+ if (bb->changed == 0 && bb->unacked_exist) {
+ u64 *p = bb->page;
+ int i;
+
+ for (i = 0; i < bb->count ; i++) {
+ if (!BB_ACK(p[i])) {
+ sector_t start = BB_OFFSET(p[i]);
+ int len = BB_LEN(p[i]);
+
+ p[i] = BB_MAKE(start, len, 1);
+ }
+ }
+ bb->unacked_exist = 0;
+ }
+ write_sequnlock_irq(&bb->lock);
+}
+EXPORT_SYMBOL_GPL(ack_all_badblocks);
+
+/* sysfs access to bad-blocks list. */
+ssize_t badblocks_show(struct badblocks *bb, char *page, int unack)
+{
+ size_t len;
+ int i;
+ u64 *p = bb->page;
+ unsigned seq;
+
+ if (bb->shift < 0)
+ return 0;
+
+retry:
+ seq = read_seqbegin(&bb->lock);
+
+ len = 0;
+ i = 0;
+
+ while (len < PAGE_SIZE && i < bb->count) {
+ sector_t s = BB_OFFSET(p[i]);
+ unsigned int length = BB_LEN(p[i]);
+ int ack = BB_ACK(p[i]);
+
+ i++;
+
+ if (unack && ack)
+ continue;
+
+ len += snprintf(page+len, PAGE_SIZE-len, "%llu %u\n",
+ (unsigned long long)s << bb->shift,
+ length << bb->shift);
+ }
+ if (unack && len == 0)
+ bb->unacked_exist = 0;
+
+ if (read_seqretry(&bb->lock, seq))
+ goto retry;
+
+ return len;
+}
+EXPORT_SYMBOL_GPL(badblocks_show);
+
+#define DO_DEBUG 1
+
+ssize_t badblocks_store(struct badblocks *bb, const char *page, size_t len,
+ int unack)
+{
+ unsigned long long sector;
+ int length;
+ char newline;
+#ifdef DO_DEBUG
+ /* Allow clearing via sysfs *only* for testing/debugging.
+ * Normally only a successful write may clear a badblock
+ */
+ int clear = 0;
+
+ if (page[0] == '-') {
+ clear = 1;
+ page++;
+ }
+#endif /* DO_DEBUG */
+
+ switch (sscanf(page, "%llu %d%c", §or, &length, &newline)) {
+ case 3:
+ if (newline != '\n')
+ return -EINVAL;
+ case 2:
+ if (length <= 0)
+ return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+#ifdef DO_DEBUG
+ if (clear) {
+ badblocks_clear(bb, sector, length);
+ return len;
+ }
+#endif /* DO_DEBUG */
+ if (badblocks_set(bb, sector, length, !unack))
+ return len;
+ else
+ return -ENOSPC;
+}
+EXPORT_SYMBOL_GPL(badblocks_store);
+
+int badblocks_init(struct badblocks *bb, int enable)
+{
+ bb->count = 0;
+ if (enable)
+ bb->shift = 0;
+ else
+ bb->shift = -1;
+ bb->page = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ if (bb->page == NULL) {
+ bb->shift = -1;
+ return -ENOMEM;
+ }
+ seqlock_init(&bb->lock);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(badblocks_init);
+
+void badblocks_free(struct badblocks *bb)
+{
+ kfree(bb->page);
+ bb->page = NULL;
+}
+EXPORT_SYMBOL_GPL(badblocks_free);
diff --git a/include/linux/badblocks.h b/include/linux/badblocks.h
new file mode 100644
index 0000000..9293446
--- /dev/null
+++ b/include/linux/badblocks.h
@@ -0,0 +1,53 @@
+#ifndef _LINUX_BADBLOCKS_H
+#define _LINUX_BADBLOCKS_H
+
+#include <linux/seqlock.h>
+#include <linux/kernel.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+
+#define BB_LEN_MASK (0x00000000000001FFULL)
+#define BB_OFFSET_MASK (0x7FFFFFFFFFFFFE00ULL)
+#define BB_ACK_MASK (0x8000000000000000ULL)
+#define BB_MAX_LEN 512
+#define BB_OFFSET(x) (((x) & BB_OFFSET_MASK) >> 9)
+#define BB_LEN(x) (((x) & BB_LEN_MASK) + 1)
+#define BB_ACK(x) (!!((x) & BB_ACK_MASK))
+#define BB_MAKE(a, l, ack) (((a)<<9) | ((l)-1) | ((u64)(!!(ack)) << 63))
+
+/* Bad block numbers are stored sorted in a single page.
+ * 64bits is used for each block or extent.
+ * 54 bits are sector number, 9 bits are extent size,
+ * 1 bit is an 'acknowledged' flag.
+ */
+#define MAX_BADBLOCKS (PAGE_SIZE/8)
+
+struct badblocks {
+ int count; /* count of bad blocks */
+ int unacked_exist; /* there probably are unacknowledged
+ * bad blocks. This is only cleared
+ * when a read discovers none
+ */
+ int shift; /* shift from sectors to block size
+ * a -ve shift means badblocks are
+ * disabled.*/
+ u64 *page; /* badblock list */
+ int changed;
+ seqlock_t lock;
+ sector_t sector;
+ sector_t size; /* in sectors */
+};
+
+int badblocks_check(struct badblocks *bb, sector_t s, int sectors,
+ sector_t *first_bad, int *bad_sectors);
+int badblocks_set(struct badblocks *bb, sector_t s, int sectors,
+ int acknowledged);
+int badblocks_clear(struct badblocks *bb, sector_t s, int sectors);
+void ack_all_badblocks(struct badblocks *bb);
+ssize_t badblocks_show(struct badblocks *bb, char *page, int unack);
+ssize_t badblocks_store(struct badblocks *bb, const char *page, size_t len,
+ int unack);
+int badblocks_init(struct badblocks *bb, int enable);
+void badblocks_free(struct badblocks *bb);
+
+#endif
--
2.5.0
^ permalink raw reply related
* [PATCH v2 2/3] block: Add badblock management for gendisks
From: Vishal Verma @ 2015-11-25 18:43 UTC (permalink / raw)
To: linux-nvdimm
Cc: Vishal Verma, linux-block, linux-raid, linux-scsi, Jens Axboe,
NeilBrown, Jeff Moyer
In-Reply-To: <1448477013-9174-1-git-send-email-vishal.l.verma@intel.com>
NVDIMM devices, which can behave more like DRAM rather than block
devices, may develop bad cache lines, or 'poison'. A block device
exposed by the pmem driver can then consume poison via a read (or
write), and cause a machine check. On platforms without machine
check recovery features, this would mean a crash.
The block device maintaining a runtime list of all known sectors that
have poison can directly avoid this, and also provide a path forward
to enable proper handling/recovery for DAX faults on such a device.
Use the new badblock management interfaces to add a badblocks list to
gendisks.
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
block/genhd.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/genhd.h | 6 ++++
2 files changed, 87 insertions(+)
diff --git a/block/genhd.c b/block/genhd.c
index 0c706f3..84fd65c 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -20,6 +20,7 @@
#include <linux/idr.h>
#include <linux/log2.h>
#include <linux/pm_runtime.h>
+#include <linux/badblocks.h>
#include "blk.h"
@@ -505,6 +506,20 @@ static int exact_lock(dev_t devt, void *data)
return 0;
}
+static void disk_alloc_badblocks(struct gendisk *disk)
+{
+ disk->bb = kzalloc(sizeof(*(disk->bb)), GFP_KERNEL);
+ if (!disk->bb) {
+ pr_warn("%s: failed to allocate space for badblocks\n",
+ disk->disk_name);
+ return;
+ }
+
+ if (badblocks_init(disk->bb, 1))
+ pr_warn("%s: failed to initialize badblocks\n",
+ disk->disk_name);
+}
+
static void register_disk(struct gendisk *disk)
{
struct device *ddev = disk_to_dev(disk);
@@ -609,6 +624,7 @@ void add_disk(struct gendisk *disk)
disk->first_minor = MINOR(devt);
disk_alloc_events(disk);
+ disk_alloc_badblocks(disk);
/* Register BDI before referencing it from bdev */
bdi = &disk->queue->backing_dev_info;
@@ -657,6 +673,11 @@ void del_gendisk(struct gendisk *disk)
blk_unregister_queue(disk);
blk_unregister_region(disk_devt(disk), disk->minors);
+ if (disk->bb) {
+ badblocks_free(disk->bb);
+ kfree(disk->bb);
+ }
+
part_stat_set_all(&disk->part0, 0);
disk->part0.stamp = 0;
@@ -670,6 +691,63 @@ void del_gendisk(struct gendisk *disk)
}
EXPORT_SYMBOL(del_gendisk);
+/*
+ * The gendisk usage of badblocks does not track acknowledgements for
+ * badblocks. We always assume they are acknowledged.
+ */
+int disk_check_badblocks(struct gendisk *disk, sector_t s, int sectors,
+ sector_t *first_bad, int *bad_sectors)
+{
+ if (!disk->bb)
+ return 0;
+
+ return badblocks_check(disk->bb, s, sectors, first_bad, bad_sectors);
+}
+EXPORT_SYMBOL(disk_check_badblocks);
+
+int disk_set_badblocks(struct gendisk *disk, sector_t s, int sectors)
+{
+ if (!disk->bb)
+ return 0;
+
+ return badblocks_set(disk->bb, s, sectors, 1);
+}
+EXPORT_SYMBOL(disk_set_badblocks);
+
+int disk_clear_badblocks(struct gendisk *disk, sector_t s, int sectors)
+{
+ if (!disk->bb)
+ return 0;
+
+ return badblocks_clear(disk->bb, s, sectors);
+}
+EXPORT_SYMBOL(disk_clear_badblocks);
+
+/* sysfs access to bad-blocks list. */
+static ssize_t disk_badblocks_show(struct device *dev,
+ struct device_attribute *attr,
+ char *page)
+{
+ struct gendisk *disk = dev_to_disk(dev);
+
+ if (!disk->bb)
+ return 0;
+
+ return badblocks_show(disk->bb, page, 0);
+}
+
+static ssize_t disk_badblocks_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *page, size_t len)
+{
+ struct gendisk *disk = dev_to_disk(dev);
+
+ if (!disk->bb)
+ return 0;
+
+ return badblocks_store(disk->bb, page, len, 0);
+}
+
/**
* get_gendisk - get partitioning information for a given device
* @devt: device to get partitioning information for
@@ -988,6 +1066,8 @@ static DEVICE_ATTR(discard_alignment, S_IRUGO, disk_discard_alignment_show,
static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL);
static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL);
static DEVICE_ATTR(inflight, S_IRUGO, part_inflight_show, NULL);
+static DEVICE_ATTR(badblocks, S_IRUGO | S_IWUSR, disk_badblocks_show,
+ disk_badblocks_store);
#ifdef CONFIG_FAIL_MAKE_REQUEST
static struct device_attribute dev_attr_fail =
__ATTR(make-it-fail, S_IRUGO|S_IWUSR, part_fail_show, part_fail_store);
@@ -1009,6 +1089,7 @@ static struct attribute *disk_attrs[] = {
&dev_attr_capability.attr,
&dev_attr_stat.attr,
&dev_attr_inflight.attr,
+ &dev_attr_badblocks.attr,
#ifdef CONFIG_FAIL_MAKE_REQUEST
&dev_attr_fail.attr,
#endif
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 2adbfa6..5563bde 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -162,6 +162,7 @@ struct disk_part_tbl {
};
struct disk_events;
+struct badblocks;
struct gendisk {
/* major, first_minor and minors are input parameters only,
@@ -201,6 +202,7 @@ struct gendisk {
struct blk_integrity *integrity;
#endif
int node_id;
+ struct badblocks *bb;
};
static inline struct gendisk *part_to_disk(struct hd_struct *part)
@@ -421,6 +423,10 @@ extern void add_disk(struct gendisk *disk);
extern void del_gendisk(struct gendisk *gp);
extern struct gendisk *get_gendisk(dev_t dev, int *partno);
extern struct block_device *bdget_disk(struct gendisk *disk, int partno);
+extern int disk_check_badblocks(struct gendisk *disk, sector_t s, int sectors,
+ sector_t *first_bad, int *bad_sectors);
+extern int disk_set_badblocks(struct gendisk *disk, sector_t s, int sectors);
+extern int disk_clear_badblocks(struct gendisk *disk, sector_t s, int sectors);
extern void set_device_ro(struct block_device *bdev, int flag);
extern void set_disk_ro(struct gendisk *disk, int flag);
--
2.5.0
^ permalink raw reply related
* [PATCH v2 3/3] md: convert to use the generic badblocks code
From: Vishal Verma @ 2015-11-25 18:43 UTC (permalink / raw)
To: linux-nvdimm
Cc: Vishal Verma, linux-block, linux-raid, linux-scsi, Jens Axboe,
NeilBrown, Jeff Moyer
In-Reply-To: <1448477013-9174-1-git-send-email-vishal.l.verma@intel.com>
Retain badblocks as part of rdev, but use the accessor functions from
include/linux/badblocks for all manipulation.
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
drivers/md/md.c | 507 +++-----------------------------------------------------
drivers/md/md.h | 40 +----
2 files changed, 23 insertions(+), 524 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c702de1..63eab20 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -34,6 +34,7 @@
#include <linux/kthread.h>
#include <linux/blkdev.h>
+#include <linux/badblocks.h>
#include <linux/sysctl.h>
#include <linux/seq_file.h>
#include <linux/fs.h>
@@ -707,8 +708,7 @@ void md_rdev_clear(struct md_rdev *rdev)
put_page(rdev->bb_page);
rdev->bb_page = NULL;
}
- kfree(rdev->badblocks.page);
- rdev->badblocks.page = NULL;
+ badblocks_free(&rdev->badblocks);
}
EXPORT_SYMBOL_GPL(md_rdev_clear);
@@ -1358,8 +1358,6 @@ static __le32 calc_sb_1_csum(struct mdp_superblock_1 *sb)
return cpu_to_le32(csum);
}
-static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors,
- int acknowledged);
static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version)
{
struct mdp_superblock_1 *sb;
@@ -1484,7 +1482,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
count <<= sb->bblog_shift;
if (bb + 1 == 0)
break;
- if (md_set_badblocks(&rdev->badblocks,
+ if (badblocks_set(&rdev->badblocks,
sector, count, 1) == 0)
return -EINVAL;
}
@@ -2226,7 +2224,7 @@ repeat:
rdev_for_each(rdev, mddev) {
if (rdev->badblocks.changed) {
rdev->badblocks.changed = 0;
- md_ack_all_badblocks(&rdev->badblocks);
+ ack_all_badblocks(&rdev->badblocks);
md_error(mddev, rdev);
}
clear_bit(Blocked, &rdev->flags);
@@ -2352,7 +2350,7 @@ repeat:
clear_bit(Blocked, &rdev->flags);
if (any_badblocks_changed)
- md_ack_all_badblocks(&rdev->badblocks);
+ ack_all_badblocks(&rdev->badblocks);
clear_bit(BlockedBadBlocks, &rdev->flags);
wake_up(&rdev->blocked_wait);
}
@@ -2944,11 +2942,17 @@ static ssize_t recovery_start_store(struct md_rdev *rdev, const char *buf, size_
static struct rdev_sysfs_entry rdev_recovery_start =
__ATTR(recovery_start, S_IRUGO|S_IWUSR, recovery_start_show, recovery_start_store);
-static ssize_t
-badblocks_show(struct badblocks *bb, char *page, int unack);
-static ssize_t
-badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack);
-
+/* sysfs access to bad-blocks list.
+ * We present two files.
+ * 'bad-blocks' lists sector numbers and lengths of ranges that
+ * are recorded as bad. The list is truncated to fit within
+ * the one-page limit of sysfs.
+ * Writing "sector length" to this file adds an acknowledged
+ * bad block list.
+ * 'unacknowledged-bad-blocks' lists bad blocks that have not yet
+ * been acknowledged. Writing to this file adds bad blocks
+ * without acknowledging them. This is largely for testing.
+ */
static ssize_t bb_show(struct md_rdev *rdev, char *page)
{
return badblocks_show(&rdev->badblocks, page, 0);
@@ -3063,14 +3067,7 @@ int md_rdev_init(struct md_rdev *rdev)
* This reserves the space even on arrays where it cannot
* be used - I wonder if that matters
*/
- rdev->badblocks.count = 0;
- rdev->badblocks.shift = -1; /* disabled until explicitly enabled */
- rdev->badblocks.page = kmalloc(PAGE_SIZE, GFP_KERNEL);
- seqlock_init(&rdev->badblocks.lock);
- if (rdev->badblocks.page == NULL)
- return -ENOMEM;
-
- return 0;
+ return badblocks_init(&rdev->badblocks, 0);
}
EXPORT_SYMBOL_GPL(md_rdev_init);
/*
@@ -8348,253 +8345,7 @@ void md_finish_reshape(struct mddev *mddev)
}
EXPORT_SYMBOL(md_finish_reshape);
-/* Bad block management.
- * We can record which blocks on each device are 'bad' and so just
- * fail those blocks, or that stripe, rather than the whole device.
- * Entries in the bad-block table are 64bits wide. This comprises:
- * Length of bad-range, in sectors: 0-511 for lengths 1-512
- * Start of bad-range, sector offset, 54 bits (allows 8 exbibytes)
- * A 'shift' can be set so that larger blocks are tracked and
- * consequently larger devices can be covered.
- * 'Acknowledged' flag - 1 bit. - the most significant bit.
- *
- * Locking of the bad-block table uses a seqlock so md_is_badblock
- * might need to retry if it is very unlucky.
- * We will sometimes want to check for bad blocks in a bi_end_io function,
- * so we use the write_seqlock_irq variant.
- *
- * When looking for a bad block we specify a range and want to
- * know if any block in the range is bad. So we binary-search
- * to the last range that starts at-or-before the given endpoint,
- * (or "before the sector after the target range")
- * then see if it ends after the given start.
- * We return
- * 0 if there are no known bad blocks in the range
- * 1 if there are known bad block which are all acknowledged
- * -1 if there are bad blocks which have not yet been acknowledged in metadata.
- * plus the start/length of the first bad section we overlap.
- */
-int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
- sector_t *first_bad, int *bad_sectors)
-{
- int hi;
- int lo;
- u64 *p = bb->page;
- int rv;
- sector_t target = s + sectors;
- unsigned seq;
-
- if (bb->shift > 0) {
- /* round the start down, and the end up */
- s >>= bb->shift;
- target += (1<<bb->shift) - 1;
- target >>= bb->shift;
- sectors = target - s;
- }
- /* 'target' is now the first block after the bad range */
-
-retry:
- seq = read_seqbegin(&bb->lock);
- lo = 0;
- rv = 0;
- hi = bb->count;
-
- /* Binary search between lo and hi for 'target'
- * i.e. for the last range that starts before 'target'
- */
- /* INVARIANT: ranges before 'lo' and at-or-after 'hi'
- * are known not to be the last range before target.
- * VARIANT: hi-lo is the number of possible
- * ranges, and decreases until it reaches 1
- */
- while (hi - lo > 1) {
- int mid = (lo + hi) / 2;
- sector_t a = BB_OFFSET(p[mid]);
- if (a < target)
- /* This could still be the one, earlier ranges
- * could not. */
- lo = mid;
- else
- /* This and later ranges are definitely out. */
- hi = mid;
- }
- /* 'lo' might be the last that started before target, but 'hi' isn't */
- if (hi > lo) {
- /* need to check all range that end after 's' to see if
- * any are unacknowledged.
- */
- while (lo >= 0 &&
- BB_OFFSET(p[lo]) + BB_LEN(p[lo]) > s) {
- if (BB_OFFSET(p[lo]) < target) {
- /* starts before the end, and finishes after
- * the start, so they must overlap
- */
- if (rv != -1 && BB_ACK(p[lo]))
- rv = 1;
- else
- rv = -1;
- *first_bad = BB_OFFSET(p[lo]);
- *bad_sectors = BB_LEN(p[lo]);
- }
- lo--;
- }
- }
-
- if (read_seqretry(&bb->lock, seq))
- goto retry;
-
- return rv;
-}
-EXPORT_SYMBOL_GPL(md_is_badblock);
-
-/*
- * Add a range of bad blocks to the table.
- * This might extend the table, or might contract it
- * if two adjacent ranges can be merged.
- * We binary-search to find the 'insertion' point, then
- * decide how best to handle it.
- */
-static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors,
- int acknowledged)
-{
- u64 *p;
- int lo, hi;
- int rv = 1;
- unsigned long flags;
-
- if (bb->shift < 0)
- /* badblocks are disabled */
- return 0;
-
- if (bb->shift) {
- /* round the start down, and the end up */
- sector_t next = s + sectors;
- s >>= bb->shift;
- next += (1<<bb->shift) - 1;
- next >>= bb->shift;
- sectors = next - s;
- }
-
- write_seqlock_irqsave(&bb->lock, flags);
-
- p = bb->page;
- lo = 0;
- hi = bb->count;
- /* Find the last range that starts at-or-before 's' */
- while (hi - lo > 1) {
- int mid = (lo + hi) / 2;
- sector_t a = BB_OFFSET(p[mid]);
- if (a <= s)
- lo = mid;
- else
- hi = mid;
- }
- if (hi > lo && BB_OFFSET(p[lo]) > s)
- hi = lo;
-
- if (hi > lo) {
- /* we found a range that might merge with the start
- * of our new range
- */
- sector_t a = BB_OFFSET(p[lo]);
- sector_t e = a + BB_LEN(p[lo]);
- int ack = BB_ACK(p[lo]);
- if (e >= s) {
- /* Yes, we can merge with a previous range */
- if (s == a && s + sectors >= e)
- /* new range covers old */
- ack = acknowledged;
- else
- ack = ack && acknowledged;
-
- if (e < s + sectors)
- e = s + sectors;
- if (e - a <= BB_MAX_LEN) {
- p[lo] = BB_MAKE(a, e-a, ack);
- s = e;
- } else {
- /* does not all fit in one range,
- * make p[lo] maximal
- */
- if (BB_LEN(p[lo]) != BB_MAX_LEN)
- p[lo] = BB_MAKE(a, BB_MAX_LEN, ack);
- s = a + BB_MAX_LEN;
- }
- sectors = e - s;
- }
- }
- if (sectors && hi < bb->count) {
- /* 'hi' points to the first range that starts after 's'.
- * Maybe we can merge with the start of that range */
- sector_t a = BB_OFFSET(p[hi]);
- sector_t e = a + BB_LEN(p[hi]);
- int ack = BB_ACK(p[hi]);
- if (a <= s + sectors) {
- /* merging is possible */
- if (e <= s + sectors) {
- /* full overlap */
- e = s + sectors;
- ack = acknowledged;
- } else
- ack = ack && acknowledged;
-
- a = s;
- if (e - a <= BB_MAX_LEN) {
- p[hi] = BB_MAKE(a, e-a, ack);
- s = e;
- } else {
- p[hi] = BB_MAKE(a, BB_MAX_LEN, ack);
- s = a + BB_MAX_LEN;
- }
- sectors = e - s;
- lo = hi;
- hi++;
- }
- }
- if (sectors == 0 && hi < bb->count) {
- /* we might be able to combine lo and hi */
- /* Note: 's' is at the end of 'lo' */
- sector_t a = BB_OFFSET(p[hi]);
- int lolen = BB_LEN(p[lo]);
- int hilen = BB_LEN(p[hi]);
- int newlen = lolen + hilen - (s - a);
- if (s >= a && newlen < BB_MAX_LEN) {
- /* yes, we can combine them */
- int ack = BB_ACK(p[lo]) && BB_ACK(p[hi]);
- p[lo] = BB_MAKE(BB_OFFSET(p[lo]), newlen, ack);
- memmove(p + hi, p + hi + 1,
- (bb->count - hi - 1) * 8);
- bb->count--;
- }
- }
- while (sectors) {
- /* didn't merge (it all).
- * Need to add a range just before 'hi' */
- if (bb->count >= MD_MAX_BADBLOCKS) {
- /* No room for more */
- rv = 0;
- break;
- } else {
- int this_sectors = sectors;
- memmove(p + hi + 1, p + hi,
- (bb->count - hi) * 8);
- bb->count++;
-
- if (this_sectors > BB_MAX_LEN)
- this_sectors = BB_MAX_LEN;
- p[hi] = BB_MAKE(s, this_sectors, acknowledged);
- sectors -= this_sectors;
- s += this_sectors;
- }
- }
-
- bb->changed = 1;
- if (!acknowledged)
- bb->unacked_exist = 1;
- write_sequnlock_irqrestore(&bb->lock, flags);
-
- return rv;
-}
+/* Bad block management */
int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int is_new)
@@ -8604,8 +8355,7 @@ int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
s += rdev->new_data_offset;
else
s += rdev->data_offset;
- rv = md_set_badblocks(&rdev->badblocks,
- s, sectors, 0);
+ rv = badblocks_set(&rdev->badblocks, s, sectors, 0);
if (rv) {
/* Make sure they get written out promptly */
sysfs_notify_dirent_safe(rdev->sysfs_state);
@@ -8617,101 +8367,6 @@ int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
}
EXPORT_SYMBOL_GPL(rdev_set_badblocks);
-/*
- * Remove a range of bad blocks from the table.
- * This may involve extending the table if we spilt a region,
- * but it must not fail. So if the table becomes full, we just
- * drop the remove request.
- */
-static int md_clear_badblocks(struct badblocks *bb, sector_t s, int sectors)
-{
- u64 *p;
- int lo, hi;
- sector_t target = s + sectors;
- int rv = 0;
-
- if (bb->shift > 0) {
- /* When clearing we round the start up and the end down.
- * This should not matter as the shift should align with
- * the block size and no rounding should ever be needed.
- * However it is better the think a block is bad when it
- * isn't than to think a block is not bad when it is.
- */
- s += (1<<bb->shift) - 1;
- s >>= bb->shift;
- target >>= bb->shift;
- sectors = target - s;
- }
-
- write_seqlock_irq(&bb->lock);
-
- p = bb->page;
- lo = 0;
- hi = bb->count;
- /* Find the last range that starts before 'target' */
- while (hi - lo > 1) {
- int mid = (lo + hi) / 2;
- sector_t a = BB_OFFSET(p[mid]);
- if (a < target)
- lo = mid;
- else
- hi = mid;
- }
- if (hi > lo) {
- /* p[lo] is the last range that could overlap the
- * current range. Earlier ranges could also overlap,
- * but only this one can overlap the end of the range.
- */
- if (BB_OFFSET(p[lo]) + BB_LEN(p[lo]) > target) {
- /* Partial overlap, leave the tail of this range */
- int ack = BB_ACK(p[lo]);
- sector_t a = BB_OFFSET(p[lo]);
- sector_t end = a + BB_LEN(p[lo]);
-
- if (a < s) {
- /* we need to split this range */
- if (bb->count >= MD_MAX_BADBLOCKS) {
- rv = -ENOSPC;
- goto out;
- }
- memmove(p+lo+1, p+lo, (bb->count - lo) * 8);
- bb->count++;
- p[lo] = BB_MAKE(a, s-a, ack);
- lo++;
- }
- p[lo] = BB_MAKE(target, end - target, ack);
- /* there is no longer an overlap */
- hi = lo;
- lo--;
- }
- while (lo >= 0 &&
- BB_OFFSET(p[lo]) + BB_LEN(p[lo]) > s) {
- /* This range does overlap */
- if (BB_OFFSET(p[lo]) < s) {
- /* Keep the early parts of this range. */
- int ack = BB_ACK(p[lo]);
- sector_t start = BB_OFFSET(p[lo]);
- p[lo] = BB_MAKE(start, s - start, ack);
- /* now low doesn't overlap, so.. */
- break;
- }
- lo--;
- }
- /* 'lo' is strictly before, 'hi' is strictly after,
- * anything between needs to be discarded
- */
- if (hi - lo > 1) {
- memmove(p+lo+1, p+hi, (bb->count - hi) * 8);
- bb->count -= (hi - lo - 1);
- }
- }
-
- bb->changed = 1;
-out:
- write_sequnlock_irq(&bb->lock);
- return rv;
-}
-
int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int is_new)
{
@@ -8719,133 +8374,11 @@ int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
s += rdev->new_data_offset;
else
s += rdev->data_offset;
- return md_clear_badblocks(&rdev->badblocks,
+ return badblocks_clear(&rdev->badblocks,
s, sectors);
}
EXPORT_SYMBOL_GPL(rdev_clear_badblocks);
-/*
- * Acknowledge all bad blocks in a list.
- * This only succeeds if ->changed is clear. It is used by
- * in-kernel metadata updates
- */
-void md_ack_all_badblocks(struct badblocks *bb)
-{
- if (bb->page == NULL || bb->changed)
- /* no point even trying */
- return;
- write_seqlock_irq(&bb->lock);
-
- if (bb->changed == 0 && bb->unacked_exist) {
- u64 *p = bb->page;
- int i;
- for (i = 0; i < bb->count ; i++) {
- if (!BB_ACK(p[i])) {
- sector_t start = BB_OFFSET(p[i]);
- int len = BB_LEN(p[i]);
- p[i] = BB_MAKE(start, len, 1);
- }
- }
- bb->unacked_exist = 0;
- }
- write_sequnlock_irq(&bb->lock);
-}
-EXPORT_SYMBOL_GPL(md_ack_all_badblocks);
-
-/* sysfs access to bad-blocks list.
- * We present two files.
- * 'bad-blocks' lists sector numbers and lengths of ranges that
- * are recorded as bad. The list is truncated to fit within
- * the one-page limit of sysfs.
- * Writing "sector length" to this file adds an acknowledged
- * bad block list.
- * 'unacknowledged-bad-blocks' lists bad blocks that have not yet
- * been acknowledged. Writing to this file adds bad blocks
- * without acknowledging them. This is largely for testing.
- */
-
-static ssize_t
-badblocks_show(struct badblocks *bb, char *page, int unack)
-{
- size_t len;
- int i;
- u64 *p = bb->page;
- unsigned seq;
-
- if (bb->shift < 0)
- return 0;
-
-retry:
- seq = read_seqbegin(&bb->lock);
-
- len = 0;
- i = 0;
-
- while (len < PAGE_SIZE && i < bb->count) {
- sector_t s = BB_OFFSET(p[i]);
- unsigned int length = BB_LEN(p[i]);
- int ack = BB_ACK(p[i]);
- i++;
-
- if (unack && ack)
- continue;
-
- len += snprintf(page+len, PAGE_SIZE-len, "%llu %u\n",
- (unsigned long long)s << bb->shift,
- length << bb->shift);
- }
- if (unack && len == 0)
- bb->unacked_exist = 0;
-
- if (read_seqretry(&bb->lock, seq))
- goto retry;
-
- return len;
-}
-
-#define DO_DEBUG 1
-
-static ssize_t
-badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack)
-{
- unsigned long long sector;
- int length;
- char newline;
-#ifdef DO_DEBUG
- /* Allow clearing via sysfs *only* for testing/debugging.
- * Normally only a successful write may clear a badblock
- */
- int clear = 0;
- if (page[0] == '-') {
- clear = 1;
- page++;
- }
-#endif /* DO_DEBUG */
-
- switch (sscanf(page, "%llu %d%c", §or, &length, &newline)) {
- case 3:
- if (newline != '\n')
- return -EINVAL;
- case 2:
- if (length <= 0)
- return -EINVAL;
- break;
- default:
- return -EINVAL;
- }
-
-#ifdef DO_DEBUG
- if (clear) {
- md_clear_badblocks(bb, sector, length);
- return len;
- }
-#endif /* DO_DEBUG */
- if (md_set_badblocks(bb, sector, length, !unack))
- return len;
- else
- return -ENOSPC;
-}
-
static int md_notify_reboot(struct notifier_block *this,
unsigned long code, void *x)
{
diff --git a/drivers/md/md.h b/drivers/md/md.h
index ab33957..253ad74 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -17,6 +17,7 @@
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
+#include <linux/badblocks.h>
#include <linux/kobject.h>
#include <linux/list.h>
#include <linux/mm.h>
@@ -28,13 +29,6 @@
#define MaxSector (~(sector_t)0)
-/* Bad block numbers are stored sorted in a single page.
- * 64bits is used for each block or extent.
- * 54 bits are sector number, 9 bits are extent size,
- * 1 bit is an 'acknowledged' flag.
- */
-#define MD_MAX_BADBLOCKS (PAGE_SIZE/8)
-
/*
* MD's 'extended' device
*/
@@ -111,22 +105,7 @@ struct md_rdev {
struct kernfs_node *sysfs_state; /* handle for 'state'
* sysfs entry */
- struct badblocks {
- int count; /* count of bad blocks */
- int unacked_exist; /* there probably are unacknowledged
- * bad blocks. This is only cleared
- * when a read discovers none
- */
- int shift; /* shift from sectors to block size
- * a -ve shift means badblocks are
- * disabled.*/
- u64 *page; /* badblock list */
- int changed;
- seqlock_t lock;
-
- sector_t sector;
- sector_t size; /* in sectors */
- } badblocks;
+ struct badblocks badblocks;
};
enum flag_bits {
Faulty, /* device is known to have a fault */
@@ -174,22 +153,11 @@ enum flag_bits {
*/
};
-#define BB_LEN_MASK (0x00000000000001FFULL)
-#define BB_OFFSET_MASK (0x7FFFFFFFFFFFFE00ULL)
-#define BB_ACK_MASK (0x8000000000000000ULL)
-#define BB_MAX_LEN 512
-#define BB_OFFSET(x) (((x) & BB_OFFSET_MASK) >> 9)
-#define BB_LEN(x) (((x) & BB_LEN_MASK) + 1)
-#define BB_ACK(x) (!!((x) & BB_ACK_MASK))
-#define BB_MAKE(a, l, ack) (((a)<<9) | ((l)-1) | ((u64)(!!(ack)) << 63))
-
-extern int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
- sector_t *first_bad, int *bad_sectors);
static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors,
sector_t *first_bad, int *bad_sectors)
{
if (unlikely(rdev->badblocks.count)) {
- int rv = md_is_badblock(&rdev->badblocks, rdev->data_offset + s,
+ int rv = badblocks_check(&rdev->badblocks, rdev->data_offset + s,
sectors,
first_bad, bad_sectors);
if (rv)
@@ -202,8 +170,6 @@ extern int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int is_new);
extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int is_new);
-extern void md_ack_all_badblocks(struct badblocks *bb);
-
struct md_cluster_info;
struct mddev {
--
2.5.0
^ permalink raw reply related
* Re: Recovering RAID5 with 2, actually 1, faulty disks.
From: Semyon Enskiy @ 2015-11-26 13:21 UTC (permalink / raw)
To: Phil Turmel, linux-raid@vger.kernel.org
In-Reply-To: <5655F4B1.4030403@turmel.org>
Should say firstly, that before committing any changes, 10 MB of /dev/sd?3
head and tail was dumped, so array can be returned to initial state.
> mdadm --create --assume-clean --chunk=512 --data-offset=262144 \
> --level=5 --raid-devices=10 --metadata=1.2 /dev/md3 \
> /dev/sd{f,i,h,g,d,e,b,c}3 missing /dev/sdj3
Done this with overwriting old superblock, no errors occurred.
Then I booted to Debian Live, mdadm.conf got old array description with new
one, so old was commented:
# ARRAY /dev/md/3 metadata=1.2 UUID=9bdc0939:483889af:b67c199b:2aaecb4e name=ubuntu:3
spares=1
ARRAY /dev/md/3 metadata=1.2 UUID=89dc7cd3:a7641d65:fe399415:9cdfd5a5 name=bnt:3
Previously "blkid" returned
/dev/md3: UUID="4bz7kl-2QWk-4YZX-IDmH-IFXL-eM3l-F2dB2n" TYPE="LVM2_member"
now nothing.
Regardless to this I am attempted to start LVM, LVM was waiting dev with
UUID from blkid output, so starting was possible only on recovery mode,
"--activationmode partial", as result "data" logical volume's block dev was
created as in past, but mount not found FS superblock, LVM reported errors
on logical extend at that time. As I remember, the Testdisk utility reported
buffer I/O errors while running on logical volume's block dev, but reported
nothing while running on array's block dev.
Apparently, revert-reshape was unsuccessful, so I'm going to collect more
information before going to forward.
^ permalink raw reply
* Re: [PATCH 2/3] md-cluster: introduce clear_clusterinfo_from_sb
From: NeilBrown @ 2015-11-27 5:42 UTC (permalink / raw)
Cc: rgoldwyn, linux-raid, Guoqing Jiang
In-Reply-To: <1448008525-17095-2-git-send-email-gqjiang@suse.com>
[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]
On Fri, Nov 20 2015, Guoqing Jiang <gqjiang@suse.com> wrote:
> To change the bitmap from clustered to none, we also
> need to clean related info about cluster from sb, such
> as version, nodes and cluster_name.
I've applied the other two (though I removed the __func__ and __LINE__
From error messages - they are just noise: the source of the message can
easily be found with out them - I should remove all the others).
However I haven't applied this because there doesn't seem to be any
point.
Once your told that main md superblock that there is no bitmap, it
doesn't really matter what data is in the superblock of that
non-existent bitmap - it will never be looked at. Will it?
Thanks,
NeilBrown
>
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> ---
> drivers/md/bitmap.c | 25 +++++++++++++++++++++++++
> drivers/md/bitmap.h | 1 +
> drivers/md/md.c | 1 +
> 3 files changed, 27 insertions(+)
>
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index 4f22e91..c11390f 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -417,6 +417,31 @@ out:
> /*
> * bitmap file superblock operations
> */
> +void clear_clusterinfo_from_sb(struct bitmap *bitmap)
> +{
> + bitmap_super_t *sb;
> +
> + if (!bitmap || !bitmap->mddev) /* no bitmap for this array */
> + return;
> + if (bitmap->mddev->bitmap_info.external)
> + return;
> + if (!bitmap->storage.sb_page) /* no superblock */
> + return;
> + sb = kmap_atomic(bitmap->storage.sb_page);
> + sb->nodes = 0;
> + sb->version = cpu_to_le32(BITMAP_MAJOR_HI);
> + memset(sb->cluster_name, NULL, 64);
> +
> + kunmap_atomic(sb);
> + /* Don't write until any other writes have completed */
> + if (bitmap->storage.file)
> + wait_event(bitmap->write_wait,
> + atomic_read(&bitmap->pending_writes)==0);
> + else
> + md_super_wait(bitmap->mddev);
> +
> + write_page(bitmap, bitmap->storage.sb_page, 1);
> +}
>
> /* update the event counter and sync the superblock to disk */
> void bitmap_update_sb(struct bitmap *bitmap)
> diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h
> index 7d5c3a6..1d0975b 100644
> --- a/drivers/md/bitmap.h
> +++ b/drivers/md/bitmap.h
> @@ -241,6 +241,7 @@ void bitmap_flush(struct mddev *mddev);
> void bitmap_destroy(struct mddev *mddev);
>
> void bitmap_print_sb(struct bitmap *bitmap);
> +void clear_clusterinfo_from_sb(struct bitmap *bitmap);
> void bitmap_update_sb(struct bitmap *bitmap);
> void bitmap_status(struct seq_file *seq, struct bitmap *bitmap);
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 47ee8ae..f06dc43 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -6598,6 +6598,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
> }
>
> mddev->bitmap_info.nodes = 0;
> + clear_clusterinfo_from_sb(mddev->bitmap);
> md_cluster_ops->leave(mddev);
> }
> mddev->pers->quiesce(mddev, 1);
> --
> 2.1.4
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply
* Re: [PATCH 2/3] md-cluster: introduce clear_clusterinfo_from_sb
From: Guoqing Jiang @ 2015-11-27 6:03 UTC (permalink / raw)
To: NeilBrown; +Cc: rgoldwyn, linux-raid
In-Reply-To: <87y4dk577c.fsf@notabene.neil.brown.name>
Hi Neil,
On 11/27/2015 01:42 PM, NeilBrown wrote:
> On Fri, Nov 20 2015, Guoqing Jiang <gqjiang@suse.com> wrote:
>
>> To change the bitmap from clustered to none, we also
>> need to clean related info about cluster from sb, such
>> as version, nodes and cluster_name.
> I've applied the other two (though I removed the __func__ and __LINE__
> From error messages - they are just noise: the source of the message can
> easily be found with out them - I should remove all the others).
>
> However I haven't applied this because there doesn't seem to be any
> point.
> Once your told that main md superblock that there is no bitmap, it
> doesn't really matter what data is in the superblock of that
> non-existent bitmap - it will never be looked at. Will it?
mdadm could still get nodes and cluster_name after change
bitmap to none, so some cmds like "mdadm -X /dev/sda" could
still see clustered info, it seems a little confused for user.
Thanks,
Guoqing
^ permalink raw reply
* [md:for-next 7/8] drivers/md/md.c:6594:6: error: expected ';' before 'rv'
From: kbuild test robot @ 2015-11-27 6:19 UTC (permalink / raw)
To: Guoqing Jiang; +Cc: kbuild-all, linux-raid, NeilBrown
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
tree: git://neil.brown.name/md for-next
head: e4b9fcde6f296ce022bde147a4de29bd8be541dc
commit: 0a50cdf5058bd85f236e57aa2d00373751254dd9 [7/8] md-cluster: append some actions when change bitmap from clustered to none
config: x86_64-lkp (attached as .config)
reproduce:
git checkout 0a50cdf5058bd85f236e57aa2d00373751254dd9
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/md/md.c: In function 'update_array_info':
>> drivers/md/md.c:6594:6: error: expected ';' before 'rv'
rv = -EPERM;
^
vim +6594 drivers/md/md.c
6588 }
6589 if (mddev->bitmap_info.nodes) {
6590 /* hold PW on all the bitmap lock */
6591 if (md_cluster_ops->lock_all_bitmaps(mddev) <= 0) {
6592 printk("md: can't change bitmap to none since the"
6593 " array is in use by more than one node\n")
> 6594 rv = -EPERM;
6595 md_cluster_ops->unlock_all_bitmaps(mddev);
6596 goto err;
6597 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 22071 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox