Jump to content

RAW device

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
admin1980

admin1980

    Newbie

  • Members
  • Pip
  • 1 posts
Hi,

We are supposed to write a C program for SUSE linux where,

In the setup of 2 hosts with shared disks array, we have following requirement.

The program should take host number ( 1 or 2 ) , device name as input parameters.

In the first step :

The program should write the current timestamp to the first or second block (2k) of the raw device.
Please note that writes to a raw device need to be aligned to sector borders an need to be in 512 byte chunks in aligned memory.
(The dd command can not be used for testing unfortunately since it "does not currently align its buffers correctly and so cannot be used on raw devices.") (man 8 raw).

In the second step :
create a loop to execute the following every second:
- write a current timestamp
- read and output the current timestamp written by the other node.

Please excuse as I am a newbie.

Thanx,
admin

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
What part of it do you need help with? What have you coded so far?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog