Revision 18e4dee6 lib/bdev.py

b/lib/bdev.py
1131 1131
    This will not work if the given minor is in use.
1132 1132

  
1133 1133
    """
1134
    # Zero the metadata first, in order to make sure drbdmeta doesn't
1135
    # try to auto-detect existing filesystems or similar (see
1136
    # http://code.google.com/p/ganeti/issues/detail?id=182); we only
1137
    # care about the first 128MB of data in the device, even though it
1138
    # can be bigger
1139
    result = utils.RunCmd([constants.DD_CMD,
1140
                           "if=/dev/zero", "of=%s" % dev_path,
1141
                           "bs=1048576", "count=128", "oflag=direct"])
1142
    if result.failed:
1143
      _ThrowError("Can't wipe the meta device: %s", result.output)
1144

  
1134 1145
    result = utils.RunCmd(["drbdmeta", "--force", cls._DevPath(minor),
1135 1146
                           "v08", dev_path, "0", "create-md"])
1136 1147
    if result.failed:

Also available in: Unified diff