112bf [Solved] TRIM support on UFS2 FreeBSD 9 - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old November 29th, 2011, 09:35
alie's Avatar
alie alie is offline
Member
 
Join Date: Dec 2008
Location: Somewhere in the world
Posts: 549
Thanks: 173
Thanked 41 Times in 34 Posts
Default TRIM support on UFS2 FreeBSD 9

Do we have TRIM support on UFS2 FreeBSD 9?
__________________
www.alielee.com
FreeBSD FreeBSD 9.1-PRERELEASE #0 r243320 /usr/obj/usr/src/sys/EZYCLIE amd64

Last edited by DutchDaemon; November 30th, 2011 at 01:28.
Reply With Quote
  #2  
Old November 29th, 2011, 10:18
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,706
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

8.1 Release notes:
Quote:
The ada(4) driver now supports BIO_DELETE. For SSDs this uses TRIM feature of DATA SET MANAGEMENT command, as defined by ACS-2 specification working draft. For Compact Flash use CFA ERASE command, same as ad(4) does. This change realizes restoring write speed of SSDs which supports TRIM command by doing newfs -E /dev/ada1, for example.
http://www.freebsd.org/cgi/cvsweb.cg...c#rev1.153.2.4
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old November 29th, 2011, 13:26
alie's Avatar
alie alie is offline
Member
 
Join Date: Dec 2008
Location: Somewhere in the world
Posts: 549
Thanks: 173
Thanked 41 Times in 34 Posts
Default

I am not so familiar with this kind of thing and i have some questions
  1. How to check my ada0 already have TRIM feature on?
  2. Do i need to run this newfs command daily?
  3. How to turn on TRIM for existing filesystem?
__________________
www.alielee.com
FreeBSD FreeBSD 9.1-PRERELEASE #0 r243320 /usr/obj/usr/src/sys/EZYCLIE amd64

Last edited by phoenix; November 30th, 2011 at 23:10. Reason: no space before punctuation; use list tag
Reply With Quote
  #4  
Old November 29th, 2011, 13:32
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,706
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

Quote:
Originally Posted by alie View Post
2. Do i need to run this newfs command daily ?
If you value your data, no.

From newfs(8):
Quote:
The newfs utility is used to initialize and clear file systems before first use.
And,
Quote:
-E Erase the content of the disk before making the filesystem. The reserved area in front of the superblock (for bootcode) will not be erased.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #5  
Old November 29th, 2011, 14:01
alie's Avatar
alie alie is offline
Member
 
Join Date: Dec 2008
Location: Somewhere in the world
Posts: 549
Thanks: 173
Thanked 41 Times in 34 Posts
Default

Code:
[/usr/home/ezyclie]# tunefs -p /dev/ada0p2
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)
So it's not possible to enable trim support with:
Code:
# tunefs -t enable /dev/ada0p2
__________________
www.alielee.com
FreeBSD FreeBSD 9.1-PRERELEASE #0 r243320 /usr/obj/usr/src/sys/EZYCLIE amd64

Last edited by alie; November 29th, 2011 at 14:09.
Reply With Quote
  #6  
Old November 29th, 2011, 14:24
alie's Avatar
alie alie is offline
Member
 
Join Date: Dec 2008
Location: Somewhere in the world
Posts: 549
Thanks: 173
Thanked 41 Times in 34 Posts
Default

Okie solved:

Code:
1. Single user mode
2. # mount
3. # tunefs -t enable /dev/ada0p2
Code:
[/usr/home/ezyclie]# tunefs -p /dev/ada0p2
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         enabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)
__________________
www.alielee.com
FreeBSD FreeBSD 9.1-PRERELEASE #0 r243320 /usr/obj/usr/src/sys/EZYCLIE amd64
Reply With Quote
The Following User Says Thank You to alie For This Useful Post:
Maxamoto (November 9th, 2012)
  #7  
Old November 30th, 2011, 23:12
phoenix's Avatar
phoenix phoenix is offline
Moderator
 
Join Date: Nov 2008
Location: Kamloops, BC, Canada
Posts: 3,141
Thanks: 43
Thanked 703 Times in 579 Posts
Default

When in doubt, read the man page: tunefs(8)

It mentions in there you can't manipulate mounted filesystem unless they are mounted read-only. And several options can't be enabled until you run an fsck.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.

Last edited by DutchDaemon; December 1st, 2011 at 02:54.
Reply With Quote
  #8  
Old December 1st, 2011, 13:07
Petz Petz is offline
Junior Member
 
Join Date: Nov 2008
Location: Sydney, Australia
Posts: 40
Thanks: 6
Thanked 9 Times in 2 Posts
Default

Bummer, it would be nice to able to change these and have them take effect on reboot.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
downgrade ZFS to UFS2 fluca1978 Storage 1 November 7th, 2011 15:38
TRIM support on ZFS ZIL/L2ARC-devices FLAGEL General 6 October 9th, 2010 19:10
Solid State/TRIM/Erase free space waksmundzki System Hardware 2 September 13th, 2010 01:27
About 8.1 TRIM support tobe System Hardware 2 July 24th, 2010 17:53
[Solved] Mount an UFS2 HD SuperMiguel Installing & Upgrading 3 June 12th, 2009 15:57


All times are GMT +1. The time now is 14:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0