LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   guidelines to program a module (https://www.linuxquestions.org/questions/programming-9/guidelines-to-program-a-module-320827/)

eantoranz 05-06-2005 03:23 PM

guidelines to program a module
 
Hi guys!

I'm stuck in a problem with a raid.

I want to start a software raid from IMAGES of disks, not the actual disks. I setup the raidtab with the files that are the images of the HDs, but when I start the raid device, it complains because it can't lock the devices:
From dmesg:
Code:

md: could not lock [dev 00:00], zero-size? Marking faulty.
md: could not import [dev 00:00]!
md: autostart [dev 00:00] failed!
md: could not lock [dev 00:00], zero-size? Marking faulty.
md: could not import [dev 00:00]!
md: autostart [dev 00:00] failed!
md: could not lock [dev 00:00], zero-size? Marking faulty.
md: could not import [dev 00:00]!
md: autostart [dev 00:00] failed!
md: could not lock [dev 00:00], zero-size? Marking faulty.
md: could not import [dev 00:00]!
md: autostart [dev 00:00] failed!

One group of three error messages per each file I set as a raid device.

So.... my crack-inspired brain (just kidding ;)) thinks it's because they are not actual block devices... but normal mortal files.

So... I wonder how difficult it would be to program a module so they looked like block devices under /dev/

I don't intend to program anything "stable", so to speak. I just want to READ the data contained in the raid that was made by those four images so I can restore the data in them. That's it.

I'm willing to program it myself... but I don't want to start learning from scratch how to deal with a module... but get a guide instead (if there's one available) that could ease the process.

eantoranz 05-07-2005 12:25 PM

I don't need to write a module that does that anymore. losetup can make loop devices from files. ;) Couldn't you just have said that?

Anyway... in case you want to program a module someday, take a look at the linux kernel module programming guide at www.tldp.org

It's very hands-on and easily "digestible"... from what I read just yesterday!

eantoranz 05-07-2005 12:38 PM



All times are GMT -5. The time now is 03:54 AM.