Skip to content
  • There are no suggestions because the search field is empty.

Adding additional NetWitness swap file fails with swapon: Invalid argument

Issue

When adding more swap file space to the RSA NetWitness appliance by following the RSA Knowledgebase article, How to create an additional NetWitness swap file? The swapon returns the following errors.
 
[root@NWSrv ~]# swapon /var/netwitness/do-not-delete/swapfile
swapon: /var/netwitness/do-not-delete/swapfile: insecure permissions 0666, 0600 suggested.
swapon: /var/netwitness/do-not-delete/swapfile: swapon failed: Invalid argument

Cause

Swapon errors

  1. Swapon failed: Invalid argument.
    This error can result from using the fallocate command to create the swap file.

    The problem with fallocate(1) is that it uses filesystem ioctls to make the disk space allocation fast and effective, the disadvantage is that it does not physically allocate the space immediately but the swapon(2) syscall requires a real already allocated disk space.
     
  2. Swap file insecure permissions.
    For security, it is recommended that the swap file permissions should be read and written only for the Linux root account.

Resolution

  1. Swapon failed: Invalid argument.
    Re-create a 4GB file that will be used as a swap using the dd command.

    dd if=/dev/zero of={path}/swapfile bs=1M count=4K

    Substitute {path}/swapfile with a suitable path and filename.

    For example:
    [root@NWSrv ~]# dd if=/dev/zero of=/var/netwitness/do-not-delete/swapfile bs=1M count=4K
    4096+0 records in
    4096+0 records out
    4294967296 bytes (4.3 GB) copied, 2.38927 s, 1.8 GB/s

    Follow the remaining steps to format the new swap file and add it with swapon in the following RSA Knowledgebase article, How to create an additional NetWitness swap file?
     
  2. Swap file insecure permissions.
    Give the created swap file only read and write permission for the root user.

    For example:
    chown root:root /var/netwitness/do-not-delete/swapfile
    chmod 600 /var/netwitness/do-not-delete/swapfile

Product Details

RSA Product Set: RSA NetWitness Platform
RSA Version/Condition: 11.5.x, 11.6.x
Platform: CentOS
O/S Version: 7

Summary

The swapon command fails when trying to add an additional file


Approval Reviewer Queue

RSA NetWitness Suite Approval Queue