LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   lynis: "Possible incorrect mount options used for swap parition" (https://www.linuxquestions.org/questions/centos-111/lynis-possible-incorrect-mount-options-used-for-swap-parition-4175517068/)

OtagoHarbour 09-01-2014 11:45 AM

lynis: "Possible incorrect mount options used for swap parition"
 
I am using CentOS 6.5 and have run lynis version 1.6.0. Lynis gives the following warning

Code:

Possible incorrect mount options used for swap parition (UUID=bdfe2d90-d3c5-44b7-926a-ee5bd1fb1858) [FILE-6336]
I looked in /var/log/lynis.log and did a search for [FILE-6336]. I saw the following.

Code:

Suggestion: Check your /etc/fstab file. Swap parition usually have 'sw' in the options field (4th). [FILE-6336]
/etc/fstab has the following

Code:

UUID=bdfe2d90-d3c5-44b7-926a-ee5bd1fb1858 swap swap defaults 0 0
Code:

sudo fdisk -l
gives (among other things)

Code:

Partition 1 does not end on cylinder boundary.
I have been using CentOS for a few months without any problems. I am not sure whether this message due to my having made a new partition for /tmp.

At any rate, is this a warning that can be ignored?

Smokey_justme 09-01-2014 12:29 PM

Quote:

Originally Posted by OtagoHarbour (Post 5230763)

At any rate, is this a warning that can be ignored?

Yes.. But only until something that can't be undone will break... :P

Anyway, it's weird this happened, but it couldn't really happen out of nowhere so any hint to what you have done involving partitions would be great..

In the meantime, could you show us the full output of the following two commands?
Code:

blkid
fdisk -l

The first is to make an id of what uuid is for what partition and the second... well you know what the secont is for..

OtagoHarbour 09-01-2014 01:29 PM

Thank you for your reply.

Quote:

Originally Posted by Smokey_justme (Post 5230781)
Yes.. But only until something that can't be undone will break... :P

Anyway, it's weird this happened, but it couldn't really happen out of nowhere so any hint to what you have done involving partitions would be great..

The disk is set up for dual booting. Initially, it had two partitions: one for Windows and one for Ubuntu 11.4. I overwrote the Win XP partition with Centos. The Ubuntu partition may have been corrupted by my using

Code:

sudo pvcreate /dev/sda5
before I fully understood the dangers of using pvcreate. I don't use Ubuntu anymore and have been thinking of overwriting that partition.

Quote:

Originally Posted by Smokey_justme (Post 5230781)
In the meantime, could you show us the full output of the following two commands?
Code:

blkid
fdisk -l


Code:

sudo blkid
/dev/sda1: UUID="56bdf45b-a24e-4738-b050-1f76cb42a4a8" TYPE="ext4"
/dev/sda3: UUID="37e4a58a-7dbc-4c84-b8db-e210a1e852b9" TYPE="ext4"
/dev/sda5: UUID="bb3d8b8a-cdca-4398-8835-f26d928ed5de" TYPE="ext4"
/dev/sda6: UUID="bdfe2d90-d3c5-44b7-926a-ee5bd1fb1858" TYPE="swap"
/dev/sda2: UUID="ccc57a57-71bd-4dc7-9e03-2101d0c7250a" TYPE="ext4"

Code:

sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8b8e8b8e

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          64      512000  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        5571    44228608  83  Linux
/dev/sda3            5571        5953    3072000  83  Linux
/dev/sda4            5953        9730    30336001    5  Extended
/dev/sda5            5953        9600    29296640  83  Linux
/dev/sda6            9601        9730    1038336  82  Linux swap / Solaris

Also
Code:

sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        42G  4.7G  35G  12% /
tmpfs          500M  232K  499M  1% /dev/shm
/dev/sda3      2.9G  69M  2.7G  3% /tmp


unSpawn 09-01-2014 03:59 PM

Quote:

Originally Posted by OtagoHarbour (Post 5230763)
is this a warning that can be ignored?

Yes, completely. Note it says it's looking for mount options, not UUIDs, partition alignment, or whatever else. You run your swap partition with default mount options. If you want to aid development then give the author feedback so it can be fixed.

OtagoHarbour 09-01-2014 10:08 PM

Quote:

Originally Posted by unSpawn (Post 5230860)
Yes, completely. Note it says it's looking for mount options, not UUIDs, partition alignment, or whatever else. You run your swap partition with default mount options. If you want to aid development then give the author feedback so it can be fixed.

Thank you for your reply. I may have other things to mention to the lynis people after I have finished working with it.

mboelen 09-02-2014 07:12 AM

The solution has already been provided. The issue has been resolved in the code as well and committed to GitHub: https://github.com/CISOfy/Lynis

And a +1 for unSpawn: see the GitHub readme text to contact us directly if you discover a (possible) bug.


All times are GMT -5. The time now is 09:04 AM.