Copies the file system on the partition <from-minor> to partition
    <to-minor>, deleting the original contents of the destination
    partition.

    CLI Example:

    .. code-block:: bash

        salt '*' partition.cp /dev/sda 2 3

def cp(device, from_minor, to_minor):  # pylint: disable=C0103
    '''
    Copies the file system on the partition <from-minor> to partition
    <to-minor>, deleting the original contents of the destination
    partition.

    CLI Example:

    .. code-block:: bash

        salt '*' partition.cp /dev/sda 2 3
    '''
    _validate_device(device)

    try:
        int(from_minor)
        int(to_minor)
    except Exception:
        raise CommandExecutionError(
            'Invalid minor number passed to partition.cp'
        )

    cmd = 'parted -m -s {0} cp {1} {2}'.format(device, from_minor, to_minor)
    out = __salt__['cmd.run'](cmd).splitlines()
    return out