From: Arkadiusz Miskiewicz <arekm@pld-linux.org>
To: linux-raid@vger.kernel.org
Subject: Fwd: starting an array on Linux, advise needed
Date: Sat, 17 Jan 2004 00:46:45 +0100 [thread overview]
Message-ID: <200401170046.45895.arekm@pld-linux.org> (raw)
I've asked Neil about that previously but he didn't respond, so I'm asking here....
---------- Przekazana wiadomość ----------
Subject: starting an array on Linux, advise needed
Date: pon 15. grudnia 2003 13:35
From: Arkadiusz Miskiewicz <arekm@pld-linux.org>
To: neilb@cse.unsw.edu.au
Hi,
I need smallest possible version of tool for starting md array on Linux.
Right now I'm doing:
raid_start /dev/md0 /dev/hda1 /dev/hdb1 /dev/hdc1
and code does
fd_md = open(argv[1], O_RDWR, 0);
for (i = 2; i < argc; i++) {
if (stat(argv[i], &st)) {
bb_perror_msg("error stating raid builing device
`%s'", argv[i]);
continue;
}
if (ioctl(fd_md, START_ARRAY, (unsigned long) st.st_rdev) == -1) {
bb_perror_msg("error starting raid device `%s:%s'",
argv[1], argv[i]);
continue;
}
return 0;
}
return 1;
so it starts using first working device and tries to assemble array from
other devices found in superblock.
Unfortunately there are some hard disk controllers which on 2.4
provide /dev/hdX devices while on 2.6 these are visible as /dev/sdX so even
raid_start /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 won't work because it will
try to use /dev/sda1 and hdb1+hdc1 (from superblock).
How simplest possible version should look like - is this below ok?
fd_md = open(argv[1], O_RDWR, 0);
ioctl(fd_md, SET_ARRAY_INFO, NULL);
for (i = 2; i < argc; i++) {
stat(argv[i], &disk);
ioctl(fd_md, ADD_NEW_DISK, &disk);
}
ioctl(fd_md, RUN_ARRAY, NULL);
and what if some of these ioctls fails - would be safe to do
ioctl(fd_md, STOP_ARRAY, NULL)?
Thanks for help.
--
Arkadiusz Miśkiewicz CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux
-------------------------------------------------------
The other problem is that after switching from 2.4.21 to 2.6.1 I got:
FS: Mounted root (romfs filesystem) readonly.
+ insmod /lib/modumd: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
les/2.6.1-1.csetraid5: measuring checksumming speed
20040116_0629smp 8regs : 916.000 MB/sec
/kernel/drivers/ 8regs_prefetch: 732.000 MB/sec
md/md.ko
Using 32regs : 408.000 MB/sec
/lib/modules/2.6 32regs_prefetch: 400.000 MB/sec
.1-1.cset2004011 pIII_sse : 996.000 MB/sec
6_0629smp/kernel pII_mmx : 1252.000 MB/sec
/drivers/md/md.k p5_mmx : 1308.000 MB/sec
o
+ insmod /libraid5: using function: pIII_sse (996.000 MB/sec)
/modules/2.6.1-1md: raid5 personality registered as nr 4
.cset20040116_06SCSI subsystem initialized
29smp/kernel/drivers/md/xor.ko
Using /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/md/xor.ko
+ insmod /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/md/raid5.ko
Using /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/md/raid5.ko
+ insmod /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/scsi/scsi_mod.ko
Using /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/scsi/scsi_mod.ko
+ insmod /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/scsi/sd_mod.ko
Using /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/drivers/scsi/sd_mod.ko
+ insmod /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/fs/jbd/jbd.ko
Using /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/fs/jbd/jbd.ko
+ insmod /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/fs/mbcache.kmd: could not lock unknown-block(8,34).
o
Using /lib/momd: could not import unknown-block(8,34)!
dules/2.6.1-1.csmd: autostart unknown-block(0,2082) failed!
et20040116_0629smd: could not lock unknown-block(8,18).
mp/kernel/fs/mbcmd: could not import unknown-block(8,18)!
ache.ko
+ insmomd: autostart unknown-block(0,2066) failed!
d /lib/modules/2md: could not lock unknown-block(8,2).
.6.1-1.cset20040md: could not import unknown-block(8,2)!
116_0629smp/kernmd: autostart unknown-block(0,2050) failed!
el/fs/ext3/ext3.ko
Using /lib/modules/2.6.1-1.cset20040116_0629smp/kernel/fs/ext3/ext3.ko
+ raid_start /dev/md0 /dev/sdc2 /dev/sdb2 /dev/sda2
raid_start: error starting raid device `/dev/md0:/dev/sdc2': Invalid argument
raid_start: error starting raid device `/dev/md0:/dev/sdb2': Invalid argument
raid_start: error starting raid device `/dev/md0:/dev/sda2': Invalid argument
romfs: unable to read superblock
EXT3-fs: unable to read superblock
Kernel panic: VFS: Unable to mount root fs on md0
(kernel messages are unfortunately mixed with messages from userspace apps)
--
Arkadiusz Miśkiewicz CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux
-
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
next reply other threads:[~2004-01-16 23:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-16 23:46 Arkadiusz Miskiewicz [this message]
2004-01-16 23:55 ` Fwd: starting an array on Linux, advise needed Luca Berra
2004-01-17 0:04 ` Guy
2004-01-17 0:34 ` Michael Tokarev
2004-01-17 0:48 ` Michael
2004-01-17 2:04 ` Guy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200401170046.45895.arekm@pld-linux.org \
--to=arekm@pld-linux.org \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).