Revision a986a581
b/lib/backend.py | ||
---|---|---|
3658 | 3658 |
real_disk = _OpenRealBD(disk) |
3659 | 3659 |
|
3660 | 3660 |
if mode == constants.IEM_IMPORT: |
3661 |
# we set here a smaller block size as, due to transport buffering, more |
|
3662 |
# than 64-128k will mostly ignored; we use nocreat to fail if the device |
|
3663 |
# is not already there or we pass a wrong path; we use notrunc to no |
|
3664 |
# attempt truncate on an LV device; we use oflag=dsync to not buffer too |
|
3665 |
# much memory; this means that at best, we flush every 64k, which will |
|
3666 |
# not be very fast |
|
3667 |
suffix = utils.BuildShellCmd(("| dd of=%s conv=nocreat,notrunc" |
|
3668 |
" bs=%s oflag=dsync"), |
|
3669 |
real_disk.dev_path, |
|
3670 |
str(64 * 1024)) |
|
3661 |
# we use nocreat to fail if the device is not already there or we pass a |
|
3662 |
# wrong path; we use notrunc to no attempt truncate on an LV device |
|
3663 |
suffix = utils.BuildShellCmd("| dd of=%s conv=nocreat,notrunc bs=%s", |
|
3664 |
real_disk.dev_path, |
|
3665 |
str(1024 * 1024)) # 1 MB |
|
3671 | 3666 |
|
3672 | 3667 |
elif mode == constants.IEM_EXPORT: |
3673 | 3668 |
# the block size on the read dd is 1MiB to match our units |
Also available in: Unified diff