Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]"/sbin/fstrim -v /" outputs always values of 38 GB
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
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3570
Location: Hamburg

PostPosted: Thu Feb 26, 2015 7:51 pm    Post subject: [solved]"/sbin/fstrim -v /" outputs always values Reply with quote

shouldn't that value goes down nearer to zero after few runs ? - I let it run now at every 5 hours -it runs for about 15 min at my 240GB SSD - but the output is always 38 GB or so.

Last edited by toralf on Fri Feb 27, 2015 1:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 41087
Location: 56N 3W

PostPosted: Thu Feb 26, 2015 7:56 pm    Post subject: Reply with quote

toralf,

Code:
# /sbin/fstrim -av
/usr/local: 970.6 MiB (1017745408 bytes) trimmed
/opt: 672.1 MiB (704757760 bytes) trimmed
/var: 3.1 GiB (3313926144 bytes) trimmed
/usr: 19.5 GiB (20948844544 bytes) trimmed
/: 695.7 MiB (729473024 bytes) trimmed
NeddySeagoon_Static ~ # /sbin/fstrim -av
/usr/local: 0 B (0 bytes) trimmed
/opt: 0 B (0 bytes) trimmed
/var: 0 B (0 bytes) trimmed
/usr: 0 B (0 bytes) trimmed
/: 0 B (0 bytes) trimmed


Seems to work for me but I used the -a option too
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3570
Location: Hamburg

PostPosted: Thu Feb 26, 2015 8:33 pm    Post subject: Reply with quote

And I get (again) :
Code:
t44 ~ # /sbin/fstrim -av
/: 37.3 GiB (40041742336 bytes) trimmed

~ $ equery b /sbin/fstrim
 * Searching for /sbin/fstrim ...
sys-apps/util-linux-2.24.1-r3 (/sbin/fstrim)

~ $ mount
rootfs on / type rootfs (rw)
/dev/sda3 on / type btrfs (rw,noatime)
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5133

PostPosted: Thu Feb 26, 2015 8:42 pm    Post subject: Reply with quote

man 8 fstrim wrote:
Code:
       -v, --verbose
              Verbose execution.  With this option fstrim will output the number
              of  bytes  passed  from the filesystem down the block stack to the
              device for potential discard.  This number is  a  maximum  discard
              amount from the storage device's perspective, because FITRIM ioctl
              called repeated will keep sending the  same  sectors  for  discard
              repeatedly.

              fstrim will report the same potential discard bytes each time, but
              only sectors which had been written to between the discards  would
              actually  be discarded by the storage device.  Further, the kernel
              block layer reserves the right to adjust the discard ranges to fit
              raid  stripe  geometry,  non-trim  capable devices in a LVM setup,
              etc.  These reductions would not be reflected in  fstrim_range.len
              (the --length option).

Not sure what output you're expecting, given this description.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3570
Location: Hamburg

PostPosted: Thu Feb 26, 2015 8:54 pm    Post subject: Reply with quote

Ant P. wrote:

Not sure what output you're expecting, given this description.
If I run it 2 times in a row I'd expect a similar output like yours, meaning "0 B (0 bytes) trimmed "
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 308

PostPosted: Fri Feb 27, 2015 2:22 am    Post subject: Reply with quote

fstrim w/ btrfs is buggy.
1. it don't remember trim state, always trim whole partition again
2. it don't trim unallocated chunk. space outside used in command "btrfs fi df <dir>"
3. it use vrange to iterate chunks. If vrange large than prange, it would trim nothing
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3570
Location: Hamburg

PostPosted: Fri Feb 27, 2015 1:09 pm    Post subject: Reply with quote

s4e8 wrote:
fstrim w/ btrfs is buggy.
1. it don't remember trim state, always trim whole partition again
2. it don't trim unallocated chunk. space outside used in command "btrfs fi df <dir>"
3. it use vrange to iterate chunks. If vrange large than prange, it would trim nothing
ick, ok, so I used this /etc/fstab entires for now :
Code:
/dev/sda3               /               btrfs           noatime,ssd,discard,compress=lzo
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