Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

  1. #1
    Join Date
    Nov 2007
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    I have looked around and haven't found a single site providing all the following information:

    1) Whether a drive is automatically recognized as a SSD during installation of Ubuntu (12.04, 12.10, 13.04 Precise Pangolin, Quantal Quetzal, Raring), consequently not automatically creating a swap partition (is swap needed?)

    3) Whether or not to proceed with the "overwrite data on partition" option on a SSD during an installation

    4) Whether partitions are automatically correctly aligned for a SSD during installation for these releases

    5) Whether TRIM is automatically enabled

    6) How to activate automatic TRIM, if it doesn't occur during installation

    7) What to do if the drive is using encrypted partitions / LVM

    8) How to verify that TRIM is occurring automatically on both BtrFS and ext4 file systems

    9) Whether there is a nice package in the repositories which does "everything" for your Solid State Drive

    I would be very grateful if somebody could help with this information.

    Thank you!

    EDIT:

    I found a useful, no truly excellent site here, but it would still be nice to get some answers to the points above.
    Last edited by yeehi; January 20th, 2013 at 07:28 PM. Reason: added question
    Linux-libre ask for it
    Coreboot Free software to replace proprietary BIOS
    Trisquel a fully free GNU/Linux-libre distribution
    Open Source does not mean Free My Spec Earthlings

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    I can start helping you (but I don't have answers to all questions).

    Quote Originally Posted by yeehi View Post
    4) Whether partitions are automatically correctly aligned for a SSD during installation for these releases
    I think so
    4) Whether TRIM is automatically enabled
    No
    5) How to activate automatic TRIM, if it doesn't occur during installation
    Add the option discard to the line for the SSD drive in /etc/fstab
    example:
    Code:
    UUID=3d28b4a7-46af-43bd-92fc-030c21ef98c7 /               ext4    defaults,discard,noatime,errors=remount-ro 0       1
    Edit: yes, haqking, I changed it here an in my fstab: ext4
    Last edited by sudodus; January 21st, 2013 at 02:41 PM.

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise


  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    For the last couple of years partitions have been aligned correctly. First partition starts at 2048 and every partition should have a start sector that can be divided by 8.
    First, understand that most partitioning tools have moved to a policy of aligning partitions on 1 MiB (2048-sector) boundaries as a way of improving performance with some types of arrays and some types of new hard disks (those with 4096-byte physical sectors). See article by srs5694:
    http://www.ibm.com/developerworks/li...-sector-disks/
    Post on 8-sector boundaries alignment by srs5694
    http://ubuntuforums.org/showthread.php?tit's 8-sector (4096-byte) alignment - post 8
    http://ubuntuforums.org/showthread.php?t=1768635
    Alignment issues on 4K drives
    http://ubuntuforums.org/showthread.php?t=1635018


    If you have data on SSD have you backed it up, otherwise why would you want to overwrite it?

    HOWTO: Check If TRIM On Ext4 Is Enabled And Working On Ubuntu And Other Distributions
    http://sites.google.com/site/lightru...bledandworking


    trim does need ahci in BIOS
    kernel version >=2.6.33. It does not work with ext3; (10.04 was 2.6.32)


    I did not enable trim right away so I ran this:
    fred@fred-Precise:~$ sudo fstrim -v /
    /: 23267893248 bytes were trimmed
    https://wiki.archlinux.org/index.php..._Cell_Clearing
    sudo hdparm -I /dev/sdX
    Alternate to discard, call fstrim via cron
    http://opensuse.14.n6.nabble.com/SSD...td3313048.html
    test if trim working using hdparm
    http://techgage.com/article/enabling..._under_linux/2


    Do SSD need customization?
    http://ubuntuforums.org/showthread.php?t=1981478
    https://wiki.archlinux.org/index.php/Solid_State_Drives
    http://ubuntuforums.org/showthread.php?t=2003022
    https://sites.google.com/site/easylinuxtipsproject/ssd
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,782

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    Quote Originally Posted by sudodus View Post
    I can start helping you (but I don't have answers to all questions).


    I think so

    No

    Add the option discard to the line for the SSD drive in /etc/fstab
    example:
    Code:
    UUID=3d28b4a7-46af-43bd-92fc-030c21ef98c7 /               ext3    defaults,discard,noatime,errors=remount-ro 0       1
    I am pretty sure that ext3 does not support TRIM (discard)

    Code:
    man mount
    confirms this.

    but i might be wrong, it has been a while since i used ext3
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  6. #6
    Join Date
    Mar 2009
    Location
    Iceland
    Beans
    205
    Distro
    Ubuntu Development Release

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    AMD Athlon(tm) II X4 640 RAM 8 GiB MSI
    760G MSI Radeon HD R6670 Samsung 128GB SSD 830 Series - Seagate 1TB

  7. #7
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,782

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    Quote Originally Posted by Hreinsi View Post
    Ahh yes I thought so.

    Thanks for the link

    Peace
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  8. #8
    Join Date
    Nov 2007
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    1)
    I read that the discard option is not the best one for a SSD. (I linked to the page that explains why at the top of this thread.) Setting trim by rc.local is preferred for setting TRIM. (It happens at boot, which is ok if you regularly reboot.)

    2)
    Does TRIM on a BtrFS partition (on a SSD) require special settings?

    3)
    Very nice to see you on ubtuntu forums again, haqking. You are most knowledgeable. I thought you had abandoned this place.
    Last edited by yeehi; January 21st, 2013 at 03:07 AM.
    Linux-libre ask for it
    Coreboot Free software to replace proprietary BIOS
    Trisquel a fully free GNU/Linux-libre distribution
    Open Source does not mean Free My Spec Earthlings

  9. #9
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    Quote Originally Posted by haqking View Post
    I am pretty sure that ext3 does not support TRIM (discard)

    Code:
    man mount
    confirms this.

    but i might be wrong, it has been a while since i used ext3
    Thanks at lot for finding that!

    It is an ext4 partition, but the ext3 entry is inherited via an upgraded system (Ubuntu 8.04 -- 10.04 -- 12.04). You bet I was quick to correct it in fstab

  10. #10
    Join Date
    Jan 2013
    Beans
    20

    Re: How to activate and then verify automatic TRIM on a SSD for Ubuntu 12.04 Precise

    Hi,

    Several of you know a lot about trim for SSD drives. I just started this thread and need help.

    http://ubuntuforums.org/showthread.p...9#post12466039

    Thanks in advance

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •