Possible to disable TRIM in Ubuntu?

RU482

Lifer
Apr 9, 2000
12,689
3
81
Long story short, I am working with a computer that has a PATA to SATA bridge IC that is not compatible with TRIM.

For Windows 7, I had to develop an image on a regular hard drive, disable TRIM from within Windows, and then I was able to deploy the image to an SSD.

Now I have a need to install Linux on one of these computers.
I also need to use an SSD.

Is there a way that I could develop the Linux image on a hard drive, and disable TRIM?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
What happens when a TRIM command is issued that causes problems? Shouldn't the bridge just ignore the command? Have you tried installing Linux to see what happens?

According to http://www.mjmwired.net/kernel/Documentation/filesystems/ext4.txt you could just pass the nodiscard mount option to ext4 to disable it. But if the controller is actually designed to crap itself when issued a TRIM command you would likely have to do the install on a regular disk and then edit fstab to use nodiscard for all ext4 filesystems on the SSD.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
Long story short, I am working with a computer that has a PATA to SATA bridge IC that is not compatible with TRIM.

For Windows 7, I had to develop an image on a regular hard drive, disable TRIM from within Windows, and then I was able to deploy the image to an SSD.

Now I have a need to install Linux on one of these computers.
I also need to use an SSD.

Is there a way that I could develop the Linux image on a hard drive, and disable TRIM?

Since AHCI is not supported on PATA, TRIM will never be enabled.
 

RU482

Lifer
Apr 9, 2000
12,689
3
81
I beg to differ.

Case in point would be the experience with windows 7.
It will not complete installation on an SSD. It gets to a certain point in the install, and just stops. If you reboot, it goes into the windows repair session. Same computer, install to a HDD no problem. Copy the image from the HDD to an SSD, same issue booting...goes awry and then goes into a repair session. Now, if I disable trim in the OS on the HDD, then pull an image and deploy it to the SSD, it works fine.

Interesting tidbit - I can install to a 1st gen Intel SSD with no problem. It is only SSDs that support TRIM that I cannot install to.


I am essentially trying to replicate this process with Ubuntu. I am getting similar behavior (boot or install fails) with SSD, but the HDD install works great.

The interesting thing is on a later version of the same computer, there is a different PATA-SATA bridge IC that does not experience this problem. The early bridge IC is ATA / ATAPI-6 specification rev 1.0 compliant. The later bridge IC is ATA/ATAPI-7 compliant.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
You can beg to differ but the PATA controller simply does not support ACHI as it is a feature set that was added when SATA was released.

The Advanced Host Controller Interface (AHCI) is a technical standard defined by Intel that specifies the operation of Serial ATA (SATA) host bus adapters in a non-implementation-specific manner.

TRIM is an ACHI feature.

It will support ATAPI however. Load the windows set up, pull up a command prompt using shift F10 and type:

fsutil behavior query disabledeletenotify

Results explained below:
DisableDeleteNotify = 1 (Windows TRIM commands are disabled)
DisableDeleteNotify = 0 (Windows TRIM commands are enabled)

More likely your converter chip is having / causing issues with the SSD's controller in question. Do you actually mean "disabled the AHCI driver?"
 
Last edited:

RU482

Lifer
Apr 9, 2000
12,689
3
81
You can beg to differ but the PATA controller simply does not support ACHI as it is a feature set that was added when SATA was released.



TRIM is an ACHI feature.

It will support ATAPI however. Load the windows set up, pull up a command prompt using shift F10 and type:

fsutil behavior query disabledeletenotify

Results explained below:
DisableDeleteNotify = 1 (Windows TRIM commands are disabled)
DisableDeleteNotify = 0 (Windows TRIM commands are enabled)

More likely your converter chip is having / causing issues with the SSD's controller in question. Do you actually mean "disabled the AHCI driver?"

By default, win7 has disabledeletenotify=0 on the system. I can verify this by installing Win7 to a HDD or non-TRIM SSD, and running the behavior query.

In order to disable it, I am running a batch file with the command "fsutil behavior set disabledeletenotify=1"

If there was an incompatibility between the bridge IC and the SSD controller, then why would the system work after I set disabledeletenotify to 1?

Beyond that, I disagree that TRIM is dependent on a system running in AHCI mode. TRIM is an attribute of the ATA Data Set Management Command, starting with ATA7. As I stated before, the older bridge IC my system uses is ATA6 compliant, and is not compatible with TRIM. The newer bridge IC used in newer systems is ATA7 compliant, and thus can support TRIM.

IF a PATA controller is ATA7 compliant (example, ATA/133), than it supports TRIM.


All I really want to know if, is there an equivalent way in Ubuntu (or any other distro) to run the "fsutil behavior set disabledeletenotify=1" command that I ran in Win7 to get the system to work?
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
By default, win7 has disabledeletenotify=0 on the system. I can verify this by installing Win7 to a HDD or non-TRIM SSD, and running the behavior query.

In order to disable it, I am running a batch file with the command "fsutil behavior set disabledeletenotify=1"

If there was an incompatibility between the bridge IC and the SSD controller, then why would the system work after I set disabledeletenotify to 1?

Beyond that, I disagree that TRIM is dependent on a system running in AHCI mode. TRIM is an attribute of the ATA Data Set Management Command, starting with ATA7. As I stated before, the older bridge IC my system uses is ATA6 compliant, and is not compatible with TRIM. The newer bridge IC used in newer systems is ATA7 compliant, and thus can support TRIM.

IF a PATA controller is ATA7 compliant (example, ATA/133), than it supports TRIM.


All I really want to know if, is there an equivalent way in Ubuntu (or any other distro) to run the "fsutil behavior set disabledeletenotify=1" command that I ran in Win7 to get the system to work?

Remove "discard" option from /etc/fstab
Unless you are on an experimental build, this is not there by default in 11.10 and older (ie current)

In response to the above ATA7, ATA7 is 'required' for the card to be 'sata' IE the older one you mentioned still had to be 'ATA7' on the SATA side. ATA7 defined the SATA 1.0 standard.

My point for all this is: there is more likely and issue with the pata<->sata device. The SSD may be sending data to fast for it etc. Most of those converters were a shot in the dark if they worked properly with magnetic disks. Also the 80 pin IDE cables also tended to flake out when nearing "100&#37;" esp if they have ever been bent.
 
Last edited: