View previous topic :: View next topic |
Author |
Message |
gentian Tux's lil' helper
Joined: 26 Mar 2012 Posts: 113
|
Posted: Sun Apr 22, 2012 1:59 pm Post subject: SSD Trim - fstab ext4 swap partitions |
|
|
Hi all,
So I just need to enable Trim. Do I just have to add the discard option next to ext4 and swap partitions in the fstab? |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8935
|
Posted: Sun Apr 22, 2012 3:00 pm Post subject: |
|
|
man mkfs.ext4:
Code: | -E extended-options
discard
Attempt to discard blocks at mkfs time (discarding blocks initially is useful on solid
state devices and sparse / thin-provisioned storage). When the device advertises that
discard also zeroes data (any subsequent read after the discard and before write returns
zero), then mark all not-yet-zeroed inode tables as zeroed. This significantly speeds up
filesystem initialization. This is set as default. |
You actually don't have to do anything |
|
Back to top |
|
|
gentian Tux's lil' helper
Joined: 26 Mar 2012 Posts: 113
|
Posted: Sun Apr 22, 2012 3:02 pm Post subject: |
|
|
genstorm wrote: | man mkfs.ext4:
Code: | -E extended-options
discard
Attempt to discard blocks at mkfs time (discarding blocks initially is useful on solid
state devices and sparse / thin-provisioned storage). When the device advertises that
discard also zeroes data (any subsequent read after the discard and before write returns
zero), then mark all not-yet-zeroed inode tables as zeroed. This significantly speeds up
filesystem initialization. This is set as default. |
You actually don't have to do anything |
gentoo ftw! |
|
Back to top |
|
|
EatMeerkats Apprentice
Joined: 15 Mar 2006 Posts: 234
|
Posted: Mon Apr 23, 2012 1:01 am Post subject: |
|
|
Code: | Attempt to discard blocks at mkfs time |
Actually, that's only at filesystem creation time… you do still have to include the "discard" option in fstab in order for TRIM to be run on newly deleted data. |
|
Back to top |
|
|
gentian Tux's lil' helper
Joined: 26 Mar 2012 Posts: 113
|
Posted: Mon Apr 23, 2012 5:28 am Post subject: |
|
|
EatMeerkats wrote: | Code: | Attempt to discard blocks at mkfs time |
Actually, that's only at filesystem creation time… you do still have to include the "discard" option in fstab in order for TRIM to be run on newly deleted data. |
So all I need to do is add the discard option next to swap and ext4 partitions in fstab right?
Code: | /dev/sda4 / ext4 noatime,discard 0 1
/dev/sda3 none swap sw,discard 0 0 |
|
|
Back to top |
|
|
mbar Veteran
Joined: 19 Jan 2005 Posts: 1990 Location: Poland
|
Posted: Mon Apr 23, 2012 7:02 am Post subject: |
|
|
I'm almost sure swap subsystem uses SSD autodetection. |
|
Back to top |
|
|
xtx Tux's lil' helper
Joined: 27 Dec 2011 Posts: 129
|
Posted: Mon Apr 23, 2012 9:24 pm Post subject: |
|
|
gentian wrote: | EatMeerkats wrote: | Code: | Attempt to discard blocks at mkfs time |
Actually, that's only at filesystem creation time… you do still have to include the "discard" option in fstab in order for TRIM to be run on newly deleted data. |
So all I need to do is add the discard option next to swap and ext4 partitions in fstab right?
Code: | /dev/sda4 / ext4 noatime,discard 0 1
/dev/sda3 none swap sw,discard 0 0 |
|
on a side note, why are you using swap with your ssd? i have recently purchased a laptop with a ssd and have disabled swap to preserve the life of the drive. |
|
Back to top |
|
|
gentian Tux's lil' helper
Joined: 26 Mar 2012 Posts: 113
|
Posted: Tue Apr 24, 2012 7:24 am Post subject: |
|
|
xtx wrote: | gentian wrote: | EatMeerkats wrote: | Code: | Attempt to discard blocks at mkfs time |
Actually, that's only at filesystem creation time… you do still have to include the "discard" option in fstab in order for TRIM to be run on newly deleted data. |
So all I need to do is add the discard option next to swap and ext4 partitions in fstab right?
Code: | /dev/sda4 / ext4 noatime,discard 0 1
/dev/sda3 none swap sw,discard 0 0 |
|
on a side note, why are you using swap with your ssd? i have recently purchased a laptop with a ssd and have disabled swap to preserve the life of the drive. |
Sleep/Suspend to Ram? |
|
Back to top |
|
|
EatMeerkats Apprentice
Joined: 15 Mar 2006 Posts: 234
|
Posted: Tue Apr 24, 2012 12:32 pm Post subject: |
|
|
You only need it for hibernation… sleep/suspend to ram does exactly that: suspends to RAM. |
|
Back to top |
|
|
gentian Tux's lil' helper
Joined: 26 Mar 2012 Posts: 113
|
Posted: Tue Apr 24, 2012 12:37 pm Post subject: |
|
|
EatMeerkats wrote: | You only need it for hibernation… sleep/suspend to ram does exactly that: suspends to RAM. |
I'm on 3GB. I need paging. |
|
Back to top |
|
|
|