Flatcar icon indicating copy to clipboard operation
Flatcar copied to clipboard

fstrim.service as shipped creates dependency on /etc/fstab which doesn't exist

Open ericb-summit opened this issue 3 years ago • 3 comments

Description

Stock fstrim.service, calls /sbin/fstrim -Av, which fails because /etc/fstab as we all know doesn't exist.

Environment and steps to reproduce

Install flatcar in an environment whose controller and drives support the fstrim command.

  1. sudo systemctl start fstrim.service
  2. weep softly

Additional information

If copy the unit from /usr/lib to /etc and modify it to call /sbin/fstrim -av not /sbin/fstrim -Av, it works fine. -A means trim all supported mounted filesystems from /etc/fstab, while -a means trim all supported mounted filesystems, without looking at /etc/fstab.

ericb-summit avatar Aug 16 '21 02:08 ericb-summit

Thanks for reporting this. This appears to come from util-linux, we'll need to fixup the service file.

jepio avatar Aug 18 '21 08:08 jepio

+1

We created the following drop-in to do just that: https://github.com/utilitywarehouse/tf_kube_ignition/blob/master/resources/fstrim.conf

george-angel avatar Nov 01 '21 12:11 george-angel

It appears our todo is to add the proposed fstrim conf to util-linux and install it in pkg_postinst, overwriting the default shipped with upstream.

Looks like a good first issue.

t-lo avatar Jan 28 '22 10:01 t-lo

@t-lo It appears that this was fixed in this commit https://github.com/flatcar/scripts/commit/faf115acdec955cc31d528ada266d9053c13bc71 and in flatcar release stable-3510.2.2.

krishjainx avatar Jun 02 '23 10:06 krishjainx

Yes, thanks for noticing!

pothos avatar Jun 05 '23 13:06 pothos