Welcome to the Linux Foundation Forum!

Lab 13.1: swapon on ubuntu 14.04 didn't say anything about "recommended" perms


When I ran through lab 13.1, it said that if the perms of the swapfile didn't match 600, "swapon" would print a recommendation to use 600. When I did this on Ubuntu 14.04, the perms on the swapfile were 644, but "swapon" didn't say anything. Any comment about that?


  • coop
    coop Posts: 915
    Different Linux distributions have different tastes. 600 means only root can read/write to it which makes sense. apparently ubuntu doesn't care, although it should.

    There are other examples; some distros are finicky about permissions of /etc/sudoers and files in /etc/sudoers.d . Just the way things are. 600 is a good practice whether
    Ubuntu cares or not.

    In practice, most systems use a swap device or partition, as it is less prone to
    corruption if you have filesystem problems for example, and is also likely to
    be contiguous in extent. Furthermore, on SCSI systems it is faster to spread
    I/O on separate "spindles" (disks) as they can proceed in parallel, so putting
    swap on a different disk is useful. I tend to put a swap partition on an old
    fashioned rotational hard drive, while using faster SSD for most of active I/O.


Upcoming Training