• jackhou's avatar
    [Mac] Use raw disks (/dev/rdisk#) in image_writer_mac. · e06a8c6b
    jackhou authored
    For some USB drives, writes on Mac are much slower than using the old image
    creator. This is most likely because the implementation in Chrome uses
    /dev/disk# whereas the old implementation used /dev/rdisk# whenever
    possible.
    
    The main requirement is that writes are in multiples of the block size, but
    since ImageWriter::WriteChunk always writes in multiples of
    kMemoryAlignment (4096), it should be fine to always use the raw disk.
    
    My brief tests using a Lexar JumpDrive 16GB and a 1.6GB image:
    before: ~6.5 minutes to write, same to verify
    after: ~5 minutes to write, ~1.5 minutes to verify
    
    BUG=415891
    
    Review URL: https://codereview.chromium.org/599853002
    
    Cr-Commit-Position: refs/heads/master@{#296875}
    e06a8c6b
image_writer_mac.cc 5.64 KB