Giter Club home page Giter Club logo

mdtrim's People

Contributors

cyberax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdtrim's Issues

High memory use when trimming a large RAID1 partition

Memory use gets really high when trimming RAID with two SSD drives and a lot of free space. Python also crashed with some internal double free errors when trying to trim using a file as large as 40 GB. I have successfully tested the program up to 30 GB temporary file sizes and it needed about 4 GB of RAM.

I was able to work around this by removing temporary file deletion from the code and using several ~10 GB files sequentially until I run out of disk space. Then I just removed all the trimmed temporary files at the end. This seemed to restore my write speeds to original performance level.

Additional benefit of using several smaller files is that the disk is almost full for shorter amount of time as checking of the last piece takes less time now.

fails on 32bit

it seems that, on 32bit systems, libc.fallocate takes 32bit arguments

[not a bug, help] - Data written into the file and data on the physical HD do not match

Hi Cyberax,

I'm having an issue with the script, I doubt it requires any changes to it, but this is really the only way I could find to contact you.

I just purchased two of the crucial M4 ssds, and set each partition up in a in a raid 1 with MDADM. As far as I can tell, I did everything right, everything is working, except trim. When I use the hdparm fibmap & read-sector test, I do not see zeros, as I did with my old vertex2.

Looking around online, it appears that this is caused by no support for discard in the raid1 module. There's the thread on LWN about a patch, which you have probably read, but it's not committed yet, and it's probably going to be some time before it is.

I bet if I failed the raid and just operated on each drive one at a time, discard would work. I was going to go about figuring out how to do that, but then I found your script, which looks like a perfectly fine work around until the kernel supports it. I did this with wiper.sh for a few years.. I tried the script, but I get stuck at:

print "Checking misalignment signatures"
for sl in slaves.values():
    slave_offset = sl["offset"]*sector_size
    for rng in trim_ranges:
        for test in rng["test_data"].values():
# snip...
            sector_data = data + ' '*padding + data

            what_we_read = string_at(read_buf+read_buf_offset, sector_size)
            if what_we_read != sector_data:
                print "Data written into the file and data on the physical HD do not match!"
                sys.exit(2)

what_we_read is: empty string
sector_data is something like:

Zb45aa627634f4682950f49b4e9e9f8a0


 b45aa627634f4682950f49b4e9e9f8a0A

Any ideas why that would happen and what I can try next to fix it? Is it a hole in the script, or is something horribly wrong with my setup, or even a hardware problem?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.