fstab option 'noatime' incompatible with optionrun-parts: /etc/cron.weekly/apt-btrfs-snapshot exited with return code 1

Asked by Benjamin Schmid

In order to reduce my excessive SSD wearlevel growth as one measure I added noatime to the mount option of my btrfs root partition.

Now I receive the error message in the title. The thing is: I just don't understand it. What is "optionrun-parts"? And why does apt-btrfs-snapshot has a problem with noatime?

Anybody able to shed a bit light on this?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt-btrfs-snapshot Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Please provide the relevant line from your fstab, and provide the full output with all messages that you receive (including any preceding messages to the 'noatime' message).

It seems to me that apt-btrfs-snapshot periodically wants to make a snapshot via a crontab entry ,but only if the previous snapshot is older than a certain age, and with 'noatime' that age cannot be identified, which leads to this message.

Revision history for this message
Benjamin Schmid (benbuntu) said :
#2

Thank you Manfred for your fast reply.

These are the relevant lines from my fstab:

    /dev/mapper/sda5_crypt / btrfs noatime,defaults,subvol=@ 0 1
    UUID=2022979b-c78f-45f5-9206-568d7cdf5edd /boot ext4 defaults 0 2
    /dev/mapper/sda5_crypt /home btrfs noatime,defaults,subvol=@home 0 2
    /dev/mapper/swap none swap sw 0 0
    tmpfs /tmp tmpfs defaults,nosuid,nodev,mode=1777,size=1024M 0 0

An you're right: It is a weekly cron job; calling it manually reveals the same error message:

    # /etc/cron.weekly/apt-btrfs-snapshot
    Error: fstab option 'noatime' incompatible with option⏎

The cron job effectively calls:
    apt-btrfs-snapshot delete-older-than "90d"

In my perception "noatime" should only disable the tracking of reading accesses to the file system. So do you have an idea why "with 'noatime' that age cannot be identified" ?

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

Looking at the code of apt-btrfs-snapshot it seems that atime (os.path.getatime) is used to identify the age of the snapshots.
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/apt-btrfs-snapshot/vivid/view/head:/apt_btrfs_snapshot.py#L194

I agree with you that it would be more reasonable to use mtime (os.path.getmtime) instead (if this is technically possible). This could allow using the noatime flags and apt-btrfs-snapshot together.

Maybe you can get better answers by contacting the developers of apt-btrfs-snapshot.

(Remark: I use neither btrfs, nor SSD, nor noatime options myself.)

Revision history for this message
Benjamin Schmid (benbuntu) said :
#4

Thank you, Manfred. I found exactly the same line.

After that confirmed that this is behavior is by design I think you made a good point to better directly ask the developer. Thank you for your time & assistance!

Revision history for this message
Benjamin Schmid (benbuntu) said :
#5

Thanks Manfred Hampl, that solved my question.