weekly fstrim cron job reports errors

Bug #1281202 reported by Nathaniel W. Turner
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Every week I get an email from cron with error output from the /etc/cron.weekly/fstrim job:

/etc/cron.weekly/fstrim:
 HDIO_DRIVE_CMD(identify) failed: Invalid argument
device /dev/md0 is not an Intel or Samsung drive
SG_IO: bad/missing sense data, sb[]: 70 00 02 00 00 00 00 0a 00 00 00 00 3a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: 70 00 02 00 00 00 00 0a 00 00 00 00 3a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
device /dev/sdf1 is not an Intel or Samsung drive

It's true that those block devices are not Intel nor Samsung SSDs (though /dev/sdc is an Intel SSD), but I don't think fstrim-all should be printing a warning in this case.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: util-linux 2.20.1-5.1ubuntu14
ProcVersionSignature: Ubuntu 3.13.0-8.28-generic 3.13.2
Uname: Linux 3.13.0-8-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.13.2-0ubuntu4
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Feb 17 12:23:49 2014
EcryptfsInUse: Yes
SourcePackage: util-linux
UpgradeStatus: Upgraded to trusty on 2014-01-23 (25 days ago)

Revision history for this message
Nathaniel W. Turner (nturner) wrote :
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
latimerio (fomember) wrote :

This bug is not a duplicate of 1276941 as the error messages are totally different (although the root cause may be the same)
I installed 14.04LTS on a virtual machine and now I am getting the error from /etc/cron.weekly/fstrim

SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

There is no SSD in my VM thus fstrim should not be running at all on my virtual disk.

Revision history for this message
latimerio (fomember) wrote :

Just found that the problem is possibly not originating from fstrim.
As hdparm -I /dev/sda reports the error
 SG_IO: bad/missing sense data, sb[]: 70 00 05 00 ... I suppose fstrim is just passing the error.

I doubt that it is a real error as my ubunt is a VM with vmfs disk.
Thus fstrim should be silent about the missing sense data at least when the disk has no TRIM capability at all.

Revision history for this message
latimerio (fomember) wrote :

Digging deeper into it I found a line in /sbin/fstrim-all saying:

HDPARM="`hdparm -I $REALDEV`" 2>/dev/null || continue

I guess it should read instead:
HDPARM="`hdparm -I $REALDEV 2>/dev/null`" || continue

The 2>/dev/null only makes sense to me if it ignores the error of hdparm not the possible error of setting the HDPARM variable.

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

Other bug subscribers

Remote bug watches

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