Find the answer to your Linux question:
Results 1 to 6 of 6
When we write a programme,we declare variables and compiler allocates memory to them.I want to get access to the physical block number of hard-disk where actually the data is stored ...
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    5

    Red face Need help for getting hard-disk traces

    When we write a programme,we declare variables and compiler allocates memory to them.I want to get access to the physical block number of hard-disk where actually the data is stored by the programme "

    Some one help me out


    Hope my question is clear

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    In-memory variables are not stored on the disc unless it is swapped out due to memory constraints.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Oct 2010
    Posts
    5

    Thks fr reply

    if its allocated on hard -disk due to memory constraints....how will i be able to get exact places on hard-disk where it places them...I need to get the trace of them.....so that i can get a pattern where/how data is stored on hard-disk ...
    hoping for reply

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    When data is swapped to HDD due to memory constraints, it all goes to the swap partition(s) and/or file(s). There can be any number of those, so where it goes on disc is indeterminate - depends upon which sectors are available to place the data. Where regular data that is deliberately written to disc goes when a program writes it again depends upon where space is available, and specific storage algorithms used by the file system in question - each behaves very differently. So, I have to ask you, why do you want/need to do this? Is it a school project?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Oct 2010
    Posts
    5

    ya

    yes..its part of my project...my mentor asked to find out a way to get actual physical block numbers in hard-disk where data gets stored on hard-disk....so to get the pattern in which it places the data on the disk and hence to get an idea about multi-zonal recording on disks ...

    can u help me wid where and which part of linux code does this ....

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Sorry, but the terms of use for the forums precludes helping with school work. As I said, each file system type ( ext2/ext3, ufs, jfs, xfs, zfs, fat, ntfs, etc. ) will exhibit very different patterns of storage, a lot of which depends upon the level of fragmentation found in the file system. You need to study the file system drivers for each type you are interested in to determine how to find where on the disc (absolute physical sector # on the partition) the data is stored. That's as far as I can help you.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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