[Users] Is this mkswap message from OpenVZ?

Jeffrey Walton noloader at gmail.com
Wed Jan 8 21:37:58 MSK 2020


Hi Everyone,

I'm trying to track down the cause of the error message below. It is
encountered when we try to enable a swapfile for a low-end VM. The VPS
provider uses OpenVZ.

    # ./vm-swapfile.sh
    Swapfile already allocated
    swapon: /swapfile: swapon failed: Operation not permitted
    Failed to enable swapfile

The relevant command is:

    if ! swapon /swapfile; then
        echo "Failed to enable swapfile"
    fi

Is this mkswap message from OpenVZ?

Thanks in advance.


More information about the Users mailing list