LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-06-2005, 03:23 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
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.
 
Old 05-07-2005, 12:25 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
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!
 
Old 05-07-2005, 12:38 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83

Last edited by eantoranz; 05-07-2005 at 12:41 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give me the guidelines for doing project m.parthiban Linux - General 1 09-19-2005 02:40 PM
Posting guidelines... Answering guidelines? itsjustme LQ Suggestions & Feedback 14 07-22-2005 01:08 PM
SLOC guidelines liguorir Programming 0 06-01-2004 08:01 PM
Debian security guidelines? zero79 Debian 2 04-29-2004 11:38 PM
Partitioning Guidelines question. rmount Linux - Hardware 3 10-08-2003 02:27 PM


All times are GMT -5. The time now is 09:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration