1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TRIM support on UFS2 FreeBSD 9

Discussion in 'General' started by alie, Nov 29, 2011.

  1. alie

    alie Member

    Messages:
    575
    Likes Received:
    0
    Do we have TRIM support on UFS2 FreeBSD 9?
     
  2. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,358
    Likes Received:
    0
  3. alie

    alie Member

    Messages:
    575
    Likes Received:
    0
    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?
     
  4. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,358
    Likes Received:
    0
    If you value your data, no.

    From newfs(8):
    And,
     
  5. alie

    alie Member

    Messages:
    575
    Likes Received:
    0
    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
     
  6. alie

    alie Member

    Messages:
    575
    Likes Received:
    0
    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)                                 
     
  7. phoenix

    phoenix Moderator Staff Member Moderator

    Messages:
    3,404
    Likes Received:
    0
    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.
     
  8. Petz

    Petz New Member

    Messages:
    44
    Likes Received:
    0
    Bummer, it would be nice to able to change these and have them take effect on reboot.