Bug 1803017 - The discard mount option is not set properly
Summary: The discard mount option is not set properly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: redhat-virtualization-host
Version: 4.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.4.0
: 4.4.0
Assignee: Yuval Turgeman
QA Contact: Qin Yuan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-14 10:36 UTC by Qin Yuan
Modified: 2020-08-04 16:22 UTC (History)
10 users (show)

Fixed In Version: imgbased-1.2.8-1.el8ev
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-04 16:22:08 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:3316 0 None None None 2020-08-04 16:22:28 UTC
oVirt gerrit 106996 0 master MERGED bootsetup: add discard to rootflags 2020-03-30 02:49:41 UTC

Description Qin Yuan 2020-02-14 10:36:50 UTC
Description of problem:
On redhat-virtualization-host-4.4.0-20200212.0.el8_2, root partition is defined with discard option in /etc/fstab, and node check shows discard is used, see:

[root@ati-fc-01 ~]# cat /etc/fstab
/dev/rhvh_ati-fc-01/rhvh-4.4.0.12-0.20200212.0+1 / xfs defaults,discard 0 0
UUID=9a760b73-49e8-4495-b3e5-4a8b7748632b /boot                   ext4    defaults        1 2
/dev/mapper/rhvh_ati--fc--01-home /home xfs defaults,discard 0 0
/dev/mapper/rhvh_ati--fc--01-tmp /tmp xfs defaults,discard 0 0
/dev/mapper/rhvh_ati--fc--01-var /var xfs defaults,discard 0 0
/dev/mapper/rhvh_ati--fc--01-var_log /var/log xfs defaults,discard 0 0
/dev/mapper/rhvh_ati--fc--01-var_log_audit /var/log/audit xfs defaults,discard 0 0
/dev/mapper/rhvh_ati--fc--01-swap swap                    swap    defaults        0 0

[root@ati-fc-01 ~]# nodectl check
Status: OK
Bootloader ... OK
  Layer boot entries ... OK
  Valid boot entries ... OK
Mount points ... OK
  Separate /var ... OK
  Discard is used ... OK
Basic storage ... OK
  Initialized VG ... OK
  Initialized Thin Pool ... OK
  Initialized LVs ... OK
Thin storage ... OK
  Checking available space in thinpool ... OK
  Checking thinpool auto-extend ... OK
vdsmd ... OK

All the above information tells user that root partition should be mounted with discard option. But it's not:

[root@ati-fc-01 ~]# mount
/dev/mapper/rhvh_ati--fc--01-rhvh--4.4.0.12--0.20200212.0+1 on / type xfs (rw,relatime,seclabel,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh_ati--fc--01-tmp on /tmp type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh_ati--fc--01-var on /var type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh_ati--fc--01-home on /home type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh_ati--fc--01-var_crash on /var/crash type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/36005076300810b3e00000000000002a6p1 on /boot type ext4 (rw,relatime,seclabel)
/dev/mapper/rhvh_ati--fc--01-var_log on /var/log type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh_ati--fc--01-var_log_audit on /var/log/audit type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)


Besides, the fstrim.timer is disabled by default:
[root@ati-fc-01 ~]# systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
   Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: disabled)
   Active: inactive (dead)
  Trigger: n/a
     Docs: man:fstrim

We need to decide whether to user fstrim.timer or discard option. 
If use fstrim.timer, it should be enabled by default.
If use discard option, all partitions defined with discard in /etc/fstab should actually be mounted with discard.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Qin Yuan 2020-02-14 10:51:03 UTC
Version-Release number of selected component (if applicable):
redhat-virtualization-host-4.4.0-20200212.0.el8_2

Steps to Reproduce:
1. Install redhat-virtualization-host-4.4.0-20200212.0.el8_2, use auto partitioning
2. Boot into system, and run 
   1) cat /etc/fstab
   2) nodectl check
   3) mount
   4) systemctl status fstrim.timer

Actual results:
1. '/' is defined with discard option in /etc/fstab
2. `nodectl check` shows dicard is used
3. '/' is missing discard option in the results of mount
4. fstrim.timer is disabled.

Expected results:
All partitions defined with discard option should actually be mounted with discard, or fstrim.timer should be enabled by default.

Comment 4 Qin Yuan 2020-03-02 03:10:17 UTC
Tested RHVH-UNSIGNED-ISO-4.4-RHEL-8-20200226.1-RHVH-x86_64-dvd1.iso, root is still mising discard mount option. Seems the patch is not built into the latest iso.

Comment 6 Qin Yuan 2020-03-23 06:41:23 UTC
Tested RHVH-UNSIGNED-ISO-4.4-RHEL-8-20200318.0-RHVH-x86_64-dvd1.iso, root has discard option now, and nodectl check returns ok, see:

[root@dell-per730-35 ~]# mount
/dev/mapper/rhvh--unsigned--iso-rhvh--4.4.0.14--0.20200318.0+1 on / type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh--unsigned--iso-home on /home type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh--unsigned--iso-tmp on /tmp type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh--unsigned--iso-var on /var type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh--unsigned--iso-var_log on /var/log type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/mapper/rhvh--unsigned--iso-var_crash on /var/crash type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel)
/dev/mapper/rhvh--unsigned--iso-var_log_audit on /var/log/audit type xfs (rw,relatime,seclabel,attr2,discard,inode64,logbsize=64k,sunit=128,swidth=128,noquota)


[root@dell-per730-35 ~]# nodectl check
Status: OK
Bootloader ... OK
  Layer boot entries ... OK
  Valid boot entries ... OK
Mount points ... OK
  Separate /var ... OK
  Discard is used ... OK
Basic storage ... OK
  Initialized VG ... OK
  Initialized Thin Pool ... OK
  Initialized LVs ... OK
Thin storage ... OK
  Checking available space in thinpool ... OK
  Checking thinpool auto-extend ... OK
vdsmd ... OK


The bug is fixed, move to VERIFIED.

Comment 8 errata-xmlrpc 2020-08-04 16:22:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (RHV Host (redhat-virtualization-host) 4.4), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:3316


Note You need to log in before you can comment on or make changes to this bug.