Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Write data onto partition without file system

  1. #1
    Join Date
    Nov 2009
    Location
    /..
    Posts
    52

    Default Write data onto partition without file system

    I am writing a (series of) program(s) in C that will have one computer send data through a router to another computer, have that computer write it to the hard drive (that doesn't have a filesystem), read it and send it back again. My purpose behind this is to test the efficiency of Linux and Windows for a research paper. What I am trying to figure out now is how to write data to unformatted partitions. I am going to transmit everything in the form of packets which in C will translate into char*'s.
    Thanks in advance
    Linux motto: Here's the computer, just do stuff
    Dell Latitude D630: Core 2 Duo 2.00 GHz, 2GB RAM, 80 GB HDD, openSUSE 11.4, Windows Vista
    Weird people have all the fun

  2. #2
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,259

    Default Re: Write data onto partition without file system

    You could use "dd" to transfer the data from a ramdisk to the hard drive partition. Read the "dd" man page.

  3. #3

    Default Re: Write data onto partition without file system

    camper365 wrote:
    > I am writing a (series of) program(s) in C that will have one computer
    > send data through a router to another computer, have that computer write
    > it to the hard drive (that doesn't have a filesystem), read it and send
    > it back again. My purpose behind this is to test the efficiency of
    > Linux and Windows for a research paper. What I am trying to figure out
    > now is how to write data to unformatted partitions. I am going to
    > transmit everything in the form of packets which in C will translate
    > into char*'s.


    As everything is a file, so is the partitions's device file. Write to
    that. ( Good luck on that "research". )

  4. #4
    Join Date
    May 2010
    Location
    Parkersburg, WV, USA
    Posts
    97

    Question Re: Write data onto partition without file system

    Quote Originally Posted by ionmich View Post
    You could use "dd" to transfer the data from a ramdisk to the hard drive partition. Read the "dd" man page.
    Wouldn't a simple redirection work in that case as well?
    Code:
    /dev/foo > /dev/hdX
    Or would that create a problem?

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Write data onto partition without file system

    Quote Originally Posted by ns89 View Post
    Wouldn't a simple redirection work in that case as well?
    Code:
    /dev/foo > /dev/hdX
    Or would that create a problem?
    There's no command on that line, you have to do something like

    Code:
    cat /dev/ramdisk > /dev/sdaX
    You can't avoid running a command of some sort, dd or cat or whatever.

  6. #6
    Join Date
    Nov 2009
    Location
    /..
    Posts
    52

    Default Re: Write data onto partition without file system

    I like the idea of writing to the device's file directly. However, is there an equivalent to that in Windows?
    Linux motto: Here's the computer, just do stuff
    Dell Latitude D630: Core 2 Duo 2.00 GHz, 2GB RAM, 80 GB HDD, openSUSE 11.4, Windows Vista
    Weird people have all the fun

  7. #7
    Join Date
    Jul 2009
    Location
    Rockyford Alberta Canada
    Posts
    1,266

    Default Re: Write data onto partition without file system

    Quote Originally Posted by camper365 View Post
    I like the idea of writing to the device's file directly. However, is there an equivalent to that in Windows?
    Windows uses the bios call to the hdd which specifies the read and write in terms of track and sectors.
    When your up to your a** in Alligators it's pretty hard to remember you intended to drain the swamp (author unknown)

  8. #8
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Write data onto partition without file system

    camper365 wrote:
    > I like the idea of writing to the device's file directly. However, is
    > there an equivalent to that in Windows?


    i _guess_ you are trying to remove all possible variables (like the
    speed advantages of one file system over another) but wonder:

    can Windows write to a disk with no file system (as your root question
    suggests)??

    and,

    however you answer _that_ question, will not your research paper
    simply measure (not the efficiency of Linux vs Windows) but instead
    the efficiency of Linux's dd (or writing direct to the device) vs
    whatever can be used in Windows to avoid the paper from mostly
    measuring the efficiency of NTFS vs Ext4??

    hmmmm...wait! what is it your intention? to "test the efficiency" of
    Linux vs Windows to

    1. push bit through a router/network
    2. read/write to a no file system hard disk
    3. process/run your C programs

    how are you writing the programs/code? wait! my question is: how do
    you make sure your code does not give one system an advantage over the
    other which is great enough to completely mask the 'efficiency' of
    pushing bit or reading/writing, etc??

    careful how you frame your 'research'..

    --
    DenverD (Linux Counter 282315)
    CAVEAT: http://is.gd/bpoMD
    posted via NNTP w/TBird 2.0.0.23 | KDE 3.5.7 | openSUSE 10.3
    2.6.22.19-0.4-default SMP i686
    AMD Athlon 1 GB RAM | GeForce FX 5500 | ASRock K8Upgrade-760GX |
    CMedia 9761 AC'97 Audio

  9. #9
    Join Date
    Jul 2009
    Location
    Rockyford Alberta Canada
    Posts
    1,266

    Default Re: Write data onto partition without file system

    Traditional Windows apps use the apl which in turn calls bios routines to actually do the read or write. Circumventing this would be something like writing a routine to directly read/write from a network direct to disk but run under Windows.
    Moving to Linux, the dd command does the same, or you could have a routine to also directly read/write to disk.

    As far as what it would tell you is virtually useless and here's why. Part of the harddisk controller contained on the hdd itself is the geometry calc for the drive. This will be a fixed ratio regardless of what system initiates the cycles. What you will really be measuring the difference between the code you use to R/W under Windows vs Linux. Given the same architecture ie: Intel i686_x64 and running the code specific to each OS there should be absolutely 0 variance.
    So the question becomes how tight can you write the disk code, how tight can you write the network code, and how much preprocessing is needed between the two?
    When your up to your a** in Alligators it's pretty hard to remember you intended to drain the swamp (author unknown)

  10. #10
    Join Date
    Nov 2009
    Location
    /..
    Posts
    52

    Default Re: Write data onto partition without file system

    From what everyone is saying, I assume that I would be better off using the default filesystem for each system instead of using a blank filesystem. Am I correct in assuming this is what everyone is saying?
    Linux motto: Here's the computer, just do stuff
    Dell Latitude D630: Core 2 Duo 2.00 GHz, 2GB RAM, 80 GB HDD, openSUSE 11.4, Windows Vista
    Weird people have all the fun

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •