Free Space Management - Linux

This is a discussion on Free Space Management - Linux ; Hi All, When disk get fragmented, we need to defragment it to get bigger free space. I am trying to get a better algorithm to find free space and represent it in memory. so when request for free space comes ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Free Space Management

  1. Free Space Management

    Hi All,

    When disk get fragmented, we need to defragment it to get bigger free
    space.
    I am trying to get a better algorithm to find free space and represent
    it in memory. so when request for free space comes i will allocate it
    from in-memory representation.

    Approaches i got is:

    1. scanning bitmap to find free space and allocate it.--> time
    consuming for bigger disk.
    2. Whenever file gets deleted,free space info is kept in linked list.
    so when request allocate it from this list. --> when list grows
    traversing & inserting will take time ( since list should be sorted..
    to allocate free space sequentially).
    3. building tree (Red-Black tree or AVL)-- this is searching
    algorithm.. i need to sort the elements too.

    is there any better approach then this.

    Thanks & Regards
    Guru

  2. Re: Free Space Management

    guru wrote:
    > Hi All,
    >
    > When disk get fragmented, we need to defragment it to get bigger free
    > space.


    You do know, that this is a Linux newsgroup?
    That most filesystems that Linux supports do not require defragmentation?

    > I am trying to get a better algorithm to find free space and represent
    > it in memory. so when request for free space comes i will allocate it
    > from in-memory representation.


    Space is there, it may not be contiguous.
    Why do you need contiguous disk space?


    --
    These are my personal views and not those of Fujitsu Siemens Computers!
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize (T. Pratchett)
    Company Details: http://www.fujitsu-siemens.com/imprint.html


  3. Free Space Management

    g> When disk get fragmented, we need to defragment it to get
    g> bigger free space.

    Shuffling the free blocks around doesn't magically make more of them.

    g> is there any better approach then this.

    Disk block placement strategies involve far more than you are
    concerning yourself with. Go and read about them, starting with the
    discussions of the Berkeley FFS. When you do, you'll realize that
    defragmentation is not a golden road.

  4. Re: Free Space Management

    On Nov 16, 4:44 pm, Josef Moellers siemens.com> wrote:
    > guru wrote:
    > > Hi All,

    >
    > > When disk get fragmented, we need to defragment it to get bigger free
    > > space.

    >
    > You do know, that this is a Linux newsgroup?
    > That most filesystems that Linux supports do not require defragmentation?
    >
    > > I am trying to get a better algorithm to find free space and represent
    > > it in memory. so when request for free space comes i will allocate it
    > > from in-memory representation.

    >
    > Space is there, it may not be contiguous.
    > Why do you need contiguous disk space?
    >
    > --
    > These are my personal views and not those of Fujitsu Siemens Computers!
    > Josef Möllers (Pinguinpfleger bei FSC)
    > If failure had no penalty success would not be a prize (T. Pratchett)
    > Company Details:http://www.fujitsu-siemens.com/imprint.html



    The file system i am using is UDF, which is having sequential
    allocation strategy. What i observed is whenever i delete some files,
    free space reclaming is not happening.
    So what i thought is if we can reclaim space in such a way that again
    i can allocate that space sequentially.
    Contiguous space is needed so that read can happen fast then random
    read.

+ Reply to Thread