* Martin Michlmayr <tbm@cyrius.com> [Die Feb 10, 2009 at 05:15:52 +0100]:
> A Debian user ran into a problem with initramfs-tools using a fairly
> strange setup that's described at http://forum.qnap.com/viewtopic.php?f=147&t=11422
> The entry for root in /proc/mdstat looks like this:
> | md1 : active (auto-read-only) raid1 dm-2[1]
> and this is parsed with:
> | block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \
> | /proc/mdstat)
> There are two problems with this:
> 1) initramfs-tools doesn't know about the additional argument
> "(auto-read-only)" and so takes "raid1" rather than "dm-2" as the
> relevant device to parse.
> 2) initramfs-tools only takes the first 3 characters of the device,
> and while this will work for something like sda1, it won't work for
> dm-2.
I've just commited code that addresses this issue:
http://git.debian.org/?p=kernel/initramfs-tools.git;a=commit;h=b1c242ffc5762fea6c15fe880e352008a5c34c43
Tested against the following input file which covers several
pitfalls that are known to have been broken:
################################################################################
md9 : active (auto-read-only) raid1 dm-1[0] dm-3[1]
md8 : active (auto-read-only) linear dm-2[1]
md7 : active multipath sda[0] sdb3[1]
149308032 blocks [2/2] [UU]
md6 : active raid10 sdb4[7](S) sdc4[1] sdh4[6] sdg4[5] sdf4[4] sde4[3] sdd4[2]
53781280 blocks 32K chunks 2 near-copies [7/6] [_UUUUUU]
md5 : active raid0 dm-34[4] dm-33[3] dm-32[2] dm-31[1] dm-30[0]
52428480 blocks 64k chunks
md4 : active raid5 dm-20[0] dm-24[4] dm-23[3] dm-22[2] dm-21[1]
2118118912 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]
md3 : active raid6 dm-19[4] dm-18[3] dm-17[2] dm-16[1] dm-15[0]
981463680 blocks level 6, 64k chunk, algorithm 2 [5/5] [UUUUU]
[===============>.....] check = 79.9% (261451776/327154560) finish=882.7min speed=1240K/sec
md2 : active raid1 sda[0] sdb[1]
4883648 blocks [2/2] [UU]
md1 : active raid1 sda3[0] sdb3[1]
149308032 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sde1[4](S) sdd1[3] sdc1[2] sdb1[1]
979840 blocks [4/4] [UUUU]
################################################################################
Will upload soon after some further testing.
regards,
-mika-
Attachment:
signature.asc
Description: Digital signature