Questions about hardware, drivers and peripherals
Forum rules
Before you post read
how to get help . Topics in this forum are automatically closed 6 months after creation.
HaveaMint
Level 6
Posts: 1085 Joined: Fri Feb 02, 2018 9:56 pm
Post
by HaveaMint » Tue Sep 18, 2018 12:50 pm
Since Ubuntu 14 Trim is done automatic through Cron, My question is that I have read to Trim manually on a multi partitioned ssd's
and
had to be done for each partition; Does the cron job do all of the partitions on ssd's?
Last edited by
LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
"Tune for maximum Smoke and then read the Instructions".
AZgl1800
Level 20
Posts: 11173 Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:
Post
by AZgl1800 » Tue Sep 18, 2018 12:59 pm
apparently it does, I am using a multi-partitioned SSD and here is a log of what it is doing.
0 18 * * * date >> /home/john/fstrim.log
5 18 * * * sudo fstrim -a -v >> /home/john/fstrim.log
==================================
Sun Sep 16 18:02:01 CDT 2018
/home/john/Backup: 134.9 GiB (144794890240 bytes) trimmed
/home: 71.5 GiB (76811853824 bytes) trimmed
/: 17.2 GiB (18487816192 bytes) trimmed
==================================
Mon Sep 17 18:02:01 CDT 2018
/home/john/Backup: 134.8 GiB (144771362816 bytes) trimmed
/home: 71.4 GiB (76671188992 bytes) trimmed
/: 17.1 GiB (18322153472 bytes) trimmed
==========================================
Last edited by
AZgl1800 on Tue Sep 18, 2018 1:29 pm, edited 1 time in total.
Pippin
Level 4
Posts: 441 Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire
Post
by Pippin » Tue Sep 18, 2018 1:00 pm
How does the cronjob look like?
On 18.3 I do a cron:
weekly, it will do all.
Manually with verbose:
Code: Select all
fstrim -av
/media/pippin/Data: 117,2 GiB (125828542464 bytes) trimmed
/home: 40 GiB (42987147264 bytes) trimmed
/: 9,5 GiB (10230333440 bytes) trimmed
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
HaveaMint
Level 6
Posts: 1085 Joined: Fri Feb 02, 2018 9:56 pm
Post
by HaveaMint » Tue Sep 18, 2018 1:02 pm
Pippin wrote: ⤴ Tue Sep 18, 2018 1:00 pm
How does the cronjob look like?
On 18.3 I do a cron:
weekly, it will do all.
Manually with verbose:
Code: Select all
fstrim -av
/media/pippin/Data: 117,2 GiB (125828542464 bytes) trimmed
/home: 40 GiB (42987147264 bytes) trimmed
/: 9,5 GiB (10230333440 bytes) trimmed
Code: Select all
#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true
"Tune for maximum Smoke and then read the Instructions".
HaveaMint
Level 6
Posts: 1085 Joined: Fri Feb 02, 2018 9:56 pm
Post
by HaveaMint » Tue Sep 18, 2018 1:15 pm
I assume it does then, thanks for the replies.
"Tune for maximum Smoke and then read the Instructions".
AZgl1800
Level 20
Posts: 11173 Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:
Post
by AZgl1800 » Tue Sep 18, 2018 1:37 pm
I am using 18.3 Cinnamon,
and I built the crontab file this way
in Terminal $ sudo crontab -e
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
# you need the path statement so the logs go where they should
PATH="/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin:/usr/local/sbin"
0 12 * * * cat /home/john/add-line >> /home/john/mintupdatetoolcron.log
1 12 * * * date >> /home/john/mintupdatetoolcron.log
2 12 * * * mintupdate-tool -r -l 123 -y -s -nk upgrade >> /home/john/mintupdatetoolcron.log
# comment, the above is my Linux Upgrades job, below is the fstrim job
0 18 * * * cat /home/john/add-line >> /home/john/fstrim.log
2 18 * * * date >> /home/john/fstrim.log
5 18 * * * sudo fstrim -a -v >> /home/john/fstrim.log
smurphos
Level 18
Posts: 8498 Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:
Post
by smurphos » Wed Sep 19, 2018 2:04 am
There is a default systemd based weekly job for this in both Mint 18.3 and Mint 19. No need for extra cronjobs.
See output of
systemctl cat fstrim.timer
systemctl cat fstrim.service
To confirm it's working on your SSD run
journalctl | grep fstrim
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit
my Github pages .
HaveaMint
Level 6
Posts: 1085 Joined: Fri Feb 02, 2018 9:56 pm
Post
by HaveaMint » Wed Sep 19, 2018 2:38 am
DOH! I was fixing to run the commands to check it out and realized i'm on the laptop now, I will check it out when I get home though. Thanks Smurf
"Tune for maximum Smoke and then read the Instructions".
AZgl1800
Level 20
Posts: 11173 Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:
Post
by AZgl1800 » Wed Sep 19, 2018 9:59 am
smurphos wrote: ⤴ Wed Sep 19, 2018 2:04 am
There is a default systemd based weekly job for this in both Mint 18.3 and Mint 19. No need for extra cronjobs.
See output of
systemctl cat fstrim.timer
systemctl cat fstrim.service
To confirm it's working on your SSD run
journalctl | grep fstrim
The post I made above was with your help a few months back, and it is working perfectly for me.
The commands you listed above, don't output anything on this laptop.
Code: Select all
john@john-TP500LA ~ $ systemctl cat fstrim.timer
No files found for fstrim.timer.
john@john-TP500LA ~ $ systemctl cat fstrim.service
No files found for fstrim.service.
john@john-TP500LA ~ $
HaveaMint
Level 6
Posts: 1085 Joined: Fri Feb 02, 2018 9:56 pm
Post
by HaveaMint » Wed Sep 19, 2018 11:48 am
Code: Select all
$ systemctl cat fstrim.timer
No files found for fstrim.timer.
$ systemctl cat fstrim.service
No files found for fstrim.service.
No luck running these on mine either
My default on 18.3 XFCE is a cron job weekly.
Code: Select all
#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true
"Tune for maximum Smoke and then read the Instructions".
smurphos
Level 18
Posts: 8498 Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:
Post
by smurphos » Wed Sep 19, 2018 12:54 pm
AZgl1500 wrote: ⤴ Wed Sep 19, 2018 9:59 am
The commands you listed above, don't output anything on this laptop.
HaveaMint wrote: ⤴ Wed Sep 19, 2018 11:48 am
No luck running these on mine either
My mistake - looks like the fstrim services are only on 19. Anyway - here's the output from a Mint 19 machine - I only fitted the SSD a couple of weeks ago and reinstalled.
Code: Select all
$ systemctl cat fstrim.service
# /lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks
[Service]
Type=oneshot
ExecStart=/sbin/fstrim -av
Code: Select all
$ systemctl cat fstrim.timer
# /lib/systemd/system/fstrim.timer
[Unit]
Description=Discard unused blocks once a week
Documentation=man:fstrim
[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true
[Install]
WantedBy=timers.target
Code: Select all
$ journalctl | grep fstrim
Sep 03 05:16:15 steve-HP-Pavilion-g6-Notebook-PC fstrim[992]: /home: 83.8 GiB (89968123904 bytes) trimmed
Sep 03 05:16:15 steve-HP-Pavilion-g6-Notebook-PC fstrim[992]: /: 24.1 GiB (25918345216 bytes) trimmed
Sep 11 05:36:16 steve-HP-Pavilion-g6-Notebook-PC fstrim[988]: /home: 83.8 GiB (89917333504 bytes) trimmed
Sep 11 05:36:16 steve-HP-Pavilion-g6-Notebook-PC fstrim[988]: /: 24 GiB (25781080064 bytes) trimmed
Sep 17 05:09:18 steve-HP-Pavilion-g6-Notebook-PC fstrim[984]: /home: 83.2 GiB (89315753984 bytes) trimmed
Sep 17 05:09:18 steve-HP-Pavilion-g6-Notebook-PC fstrim[984]: /: 23.5 GiB (25242152960 bytes) trimmed
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit
my Github pages .
HaveaMint
Level 6
Posts: 1085 Joined: Fri Feb 02, 2018 9:56 pm
Post
by HaveaMint » Wed Sep 19, 2018 1:27 pm
My mistake - looks like the fstrim services are only on 19. Anyway - here's the output from a Mint 19 machine - I only fitted the SSD a couple of weeks ago and reinstalled.
Code: Select all
$ journalctl | grep fstrim
Sep 03 05:16:15 steve-HP-Pavilion-g6-Notebook-PC fstrim[992]: /home: 83.8 GiB (89968123904 bytes) trimmed
Sep 03 05:16:15 steve-HP-Pavilion-g6-Notebook-PC fstrim[992]: /: 24.1 GiB (25918345216 bytes) trimmed
Sep 11 05:36:16 steve-HP-Pavilion-g6-Notebook-PC fstrim[988]: /home: 83.8 GiB (89917333504 bytes) trimmed
Sep 11 05:36:16 steve-HP-Pavilion-g6-Notebook-PC fstrim[988]: /: 24 GiB (25781080064 bytes) trimmed
Sep 17 05:09:18 steve-HP-Pavilion-g6-Notebook-PC fstrim[984]: /home: 83.2 GiB (89315753984 bytes) trimmed
Sep 17 05:09:18 steve-HP-Pavilion-g6-Notebook-PC fstrim[984]: /: 23.5 GiB (25242152960 bytes) trimmed
No problem, I appreciate the input. My weren't you the busy little penguin shuffling things around .
"Tune for maximum Smoke and then read the Instructions".