fstrim-all should not be run on mdadm devices

Bug #1276941 reported by Timo Aaltonen
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

I see that fstrim-all checks for devmapper, but I'm using mdadm and get this:

Subject: Anacron job 'cron.weekly' on eldon
From: Anacron <root@eldon>
Date: 06.02.2014 09:43
To: root@eldon

/etc/cron.weekly/fstrim:
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
device /dev/md127 is not an Intel or Samsung drive

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: util-linux 2.20.1-5.1ubuntu14
ProcVersionSignature: Ubuntu 3.13.0-5.20-generic 3.13.0
Uname: Linux 3.13.0-5-generic x86_64
ApportVersion: 2.13.2-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Feb 6 09:44:42 2014
InstallationDate: Installed on 2012-11-07 (455 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
SourcePackage: util-linux
UpgradeStatus: Upgraded to trusty on 2014-01-07 (29 days ago)

Revision history for this message
Timo Aaltonen (tjaalton) wrote :
Changed in util-linux (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in util-linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Jan Groenewald (jan-aims) wrote :

Confirmed

 [root] Cron <root@hummingbird> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
Cron Daemon <email address hidden> 9 February 2014 06:47
To: <email address hidden>
/etc/cron.weekly/fstrim:
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
device /dev/disk/by-uuid/1f50ec17-17a4-4b89-b0b4-f39e1f30dc9b is not an Intel or Samsung drive
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
device /dev/md2 is not an Intel or Samsung drive
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
device /dev/md1 is not an Intel or Samsung drive
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
device /dev/md3 is not an Intel or Samsung drive

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

Affects an essential hardware component (disk controller, built-in networking, video card, keyboard, mouse).

Changed in util-linux (Ubuntu):
importance: Undecided → High
Revision history for this message
Nathaniel W. Turner (nturner) wrote :

Bug 1281202 was marked as a duplicate of this one, but please note that the scope of that issue is larger than implied by the title of this one.

Martin Pitt (pitti)
Changed in util-linux (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.20.1-5.1ubuntu15

---------------
util-linux (2.20.1-5.1ubuntu15) trusty; urgency=medium

  * debian/fstrim-all: Whitelist OCZ, SanDisk, and Patriot too. (see LP
    #1259829)
  * debian/fstrim-all: Exit cleanly if hdparm got uninstalled. (LP: #1278048)
  * debian/fstrim-all: Don't print errors on mdadm devices. (LP: #1276941)
 -- Martin Pitt <email address hidden> Mon, 10 Mar 2014 13:18:58 +0100

Changed in util-linux (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
robi (robreg) wrote :

Guys, sorry not to agree completely with you: fstrim-all _should_ be run on mdadm devices if they are RAID1. Linux kernel support TRIMming of RAID1 md devices since Mar 11 2012. See http://lkml.iu.edu//hypermail/linux/kernel/1203.1/01772.html
This is present in Ubuntu since kernel 3.8 (raring) and I'm using it actively on my raid1 md device made up of an Intel and a Kingston SSD. I'm trimming the / mount, which is actually on /dev/md0.
One can even mound the md device in fstab with discard option, that works too:
EXT4-fs (md0): re-mounted. Opts: discard,errors=remount-ro
Using 12.04 with kernel 3.11, and plan to upgrade to 14.04 but this is a regression now...

Revision history for this message
chrone (chrone81) wrote :

totally agree with robi, hope you guys don't kill support for mdraid raid1. :)

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

there was no fstrim run by default before, so how could it be a regression?

besides, looks like only the error got silenced for mdadm devices

http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed/revision/103

Revision history for this message
Tomasz Kontusz (tomasz-kontusz) wrote :

Still a problem on Bionic on Hyper-V:
fstrim: /boot: FITRIM ioctl failed: Invalid argument

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.