From owner-freebsd-questions@FreeBSD.ORG Tue Jan 22 05:35:40 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53CBDFAB for ; Tue, 22 Jan 2013 05:35:40 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mx.nsu.ru (mx.nsu.ru [84.237.50.39]) by mx1.freebsd.org (Postfix) with ESMTP id E04F53A7 for ; Tue, 22 Jan 2013 05:35:39 +0000 (UTC) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.69) (envelope-from ) id 1TxWAH-0000kr-4r for questions@freebsd.org; Tue, 22 Jan 2013 12:12:53 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.14.2/8.14.2) with ESMTP id r0M5E84o057149 for ; Tue, 22 Jan 2013 12:14:08 +0700 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.14.2/8.14.2/Submit) id r0M5Dln4057101 for questions@freebsd.org; Tue, 22 Jan 2013 12:13:47 +0700 (NOVT) (envelope-from danfe) Date: Tue, 22 Jan 2013 12:13:47 +0700 From: Alexey Dokuchaev To: questions@freebsd.org Subject: TRIM support on SSD via ata(4) Message-ID: <20130122051346.GA53833@regency.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 05:35:40 -0000 Hi there, I've just bought this Crucial M4 SSD few days ago as a (hopefully) nice upgrade option for my old laptop (I'm currently using it via SATA->IDE cdrom bay). Not the best setup, but alas I see no other options for me due to lack of any real SATA ports and an old controller (my system is recent 8.3-STABLE): $ pciconf -lv | grep -i ata atapci0@pci0:0:31:1: class=0x01018a card=0x83191033 chip=0x266f8086 rev=0x04 hdr=0x00 device = 'PATA100 Controller - 266F (82801FB/FBM/FW/FR/FRW)' subclass = ATA Anyway, drive is recognized and seems to work quite fine, but one thing in dmesg puzzles me when I mount filesystem from SSD: TRIM flag on fs but disk does not support TRIM Under Linux, hdparm(8) reports that TRIM is supported, so I'm wondering why FreeBSD does not see it. My ata(4) support in /boot/loader.conf looks like this (little to none hardware support is compiled into the kernel): ataintel_load="YES" atadisk_load="YES" atapci_load="YES" $ kldstat | grep ata 20 1 0xc0a65000 4734 atadisk.ko 21 5 0xc0a6a000 e398 ata.ko 22 3 0xc0a79000 80d4 atapci.ko 38 1 0xc0afc000 76ec ataintel.ko 39 2 0xc0b04000 6f50 ataahci.ko Unfortunately, I cannot use ahci(4) and limited to atacontrol(8), which does not have "identify" command like camcontrol(8). Shall I recompile the kernel with ATA_CAM option? Is there way to force TRIM support, perhaps by sending ATA commands directly to the drive? Thanks, ./danfe P.S. Buying a new laptop is the easiest solution, but I do not want to do that for various reasons, mostly because it's quite hard to find one that would be nicely supported by FreeBSD these days.