Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SSD Trim - fstab ext4 swap partitions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Sun Apr 22, 2012 1:59 pm    Post subject: SSD Trim - fstab ext4 swap partitions Reply with quote

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
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Sun Apr 22, 2012 3:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Sun Apr 22, 2012 3:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
EatMeerkats
Apprentice
Apprentice


Joined: 15 Mar 2006
Posts: 234

PostPosted: Mon Apr 23, 2012 1:01 am    Post subject: Reply with quote

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
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Mon Apr 23, 2012 5:28 am    Post subject: Reply with quote

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
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Mon Apr 23, 2012 7:02 am    Post subject: Reply with quote

I'm almost sure swap subsystem uses SSD autodetection.
Back to top
View user's profile Send private message
xtx
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2011
Posts: 129

PostPosted: Mon Apr 23, 2012 9:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Tue Apr 24, 2012 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
EatMeerkats
Apprentice
Apprentice


Joined: 15 Mar 2006
Posts: 234

PostPosted: Tue Apr 24, 2012 12:32 pm    Post subject: Reply with quote

You only need it for hibernation… sleep/suspend to ram does exactly that: suspends to RAM.
Back to top
View user's profile Send private message
gentian
Tux's lil' helper
Tux's lil' helper


Joined: 26 Mar 2012
Posts: 113

PostPosted: Tue Apr 24, 2012 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum