The more I think about it, the more I am coming down on the restart
plan, with no new items involved:
Remove the M2SSD, wipe the primary drive (SATA SSD) and install a
clean setup of ver. 22.04. Install required applications. When all is operating as it should, then re-install the M2SSD.
The only files that I will lose are the TB Local Folders since the
last backup, and they can be recreated, thanks to gmail keeping all
messages.
I appreciate what you say, and ma grateful for the thoughts, but TO ME
my way has more advantages than disadvantages, and is simpler to
implement.
I have not heard of fstrim, now that I know about it, I will look at
it and implement it.
On 08/09/2025 17:28, Davey wrote:
I have not heard of fstrim, now that I know about it, I will look at
it and implement it.
Trimming SSDs used to be talked about a lot, when SSDs were new and exciting, and many times the cost per MB of HDDs. Now, not so much.
The issue is that each block of storage on an SSD can only reliably
be written a finite number of times - generally of the order of
several thousand. This is where the "Terabytes Written" lifetimes
quoted for SSDs comes from. The controller of an SSD tries to
minimize this "wear" by writing new data to the least-used available
block ... but to do this it has to know which blocks are "available".
The more blocks that are available the more effective the
wear-levelling strategy employed by the SSD controller can be. If a
disk is only part-full, or if the disk uses "over-provisioning"
(keeping some blocks in reserve and advertising itself as a smaller
disk than it could be) there is often no problem. As a disk fills up
it is more likely to be a problem.
The position is slightly complicated by the fact that SSD blocks are
larger than disk sectors (for hardware reasons) so many sectors share
the same block, and that SSD blocks can only be written in their
entirety -- several sectors must be written at once. The problem of
finding "available" blocks becomes harder as the disk comes to
contain more and more blocks that are only partly used, so the
controller uses a "garbage collection" technique to collect up data
from part-used blocks and move them to a new block, making the blocks
that data came from available for future writes.
When a file is edited (say) the OS may write the new version in the
same place on disk (the same actual disk sectors) or may write the
whole changed file out somewhere else (different software works in
different ways). In the former case the SSD controller has to remap
the sectors onto different blocks and allocate new clean blocks for
the new data, but it then knows that the old blocks that used to be
mapped to those sectors are available for reuse. In the latter case
the controller knows that the OS has told it to use some new sectors,
but doesn't know that the OS now considers the old sectors to be
unused, so it continues to regard them as "unavailable".
On early SSDs this was a problem. Then the TRIM command was added to
the ATA interface, enabling an OS (more accurately a filesystem, in
the Linux world) to tell the SSD controller that it is no longer
using a particular sector. This enables the controller's wear
levelling to run more efficiently, and so prolongs the life of the
SSD.
Ideally, you'd like the filesystem to tell the SSD that a sector is
unused as soon as it becomes so - e.g. when a file is rewritten to a different location and the old one deleted ... or on any file
deletion or truncation. Unfortunately it seems that some
old/cheap/shitty SSDs can't cope with TRIM commands occurring in the
middle of a lot of file i/o and these SSDs may suffer errors or slow
down if the filesystem issues its own TRIM commands (I've never seen
it happen, but the Internet can't be wrong[Citation needed]) so it's
not done by default.
You can enable automatic filesystem TRIM commands by adding the
parameter "discard" to the mount command for your SSD ... e.g. in /etc/fstab. This works for Ext3, Ext4 and some others ...
Note that a TRIM command is just a simple command that says "Treat
Sectors x-y as unused". It's housekeeping information for the
controller and doesn't actually write to the SSD (though the
controller will probably return blank data if anyone tries to read an
unused sector, whatever is actually in the Flash memory).
The fstrim commandline tool is an alternative to enabling TRIM in the filesystem driver. When you run fstrim the program analyses the
filesystem and works out which sectors of the disk are actually in
use. It then uses the TRIM command to tell the SSD about ALL the
others (most of which it knows about anyway). The filesystem driver
may be clever enough (Ext4 apparently is) not to allow unnecessary
TRIM commands to be sent when fstrim is run multiple times between
boots, but will start afresh after a reboot.
At the end of the day, though, it's not a big deal. All reputable
SSDs are designed with the assumption that TRIM commands may not be
used at all; they have sufficiently good wear-levelling and
sufficient over-provisioning that they will work well enough without
TRIM. That's not to say that TRIM won't help, just that life can go
on without it.
The position is slightly complicated by the fact that SSD blocks are
larger than disk sectors (for hardware reasons) so many sectors share
the same block, and that SSD blocks can only be written in their
entirety -- several sectors must be written at once.
The problem of finding "available" blocks becomes harder as the disk--
comes to contain more and more blocks that are only partly used, so
the controller uses a "garbage collection" technique to collect up
data from part-used blocks and move them to a new block, making the
blocks that data came from available for future writes.
A little more complicated than that. ...
On 17/09/2025 08:43, Richard Kettlewell wrote:
A little more complicated than that. ...
Yes, I know, but I was trying to keep things simple. Maybe too
simple, so thanks for your addition.
So, as one who knew nothing of trimming before this conversation
started, I am now as confused as ever as to what is the best strategy
to employ.
Should I set up a regular fstrim event, and if so, how frequently? Once
per week, once per month, or after a heavy data writing session?
On 17/09/2025 11:05, Davey wrote:
So, as one who knew nothing of trimming before this conversation
started, I am now as confused as ever as to what is the best
strategy to employ.
That's partly because it's really difficult to give an unambiguously
correct answer. One size doesn't fit all.
Should I set up a regular fstrim event, and if so, how frequently?
Once per week, once per month, or after a heavy data writing
session?
Hard to say as we don't know the make/model of your SSD, how old it
is, nor how full it is.
Modern SSDs are designed to work without TRIM ... nevertheless using
TRIM may be beneficial, and can help reduce SSD wear.
The benefit you'll get from TRIM is more if your SSD is close to
full. This is because as the SSD fills up there are fewer empty pages
to which the controller can write new data and so more work for
garbage collection to do. Better-quality SSDs (newer designs, more
reputable brands) have cleverer software that works better without
TRIM, but that can also make better use of information from TRIM.
I would say that the "best" thing to do is to let the filesystem
handle TRIM on-the-fly and forget about scheduled calls to fstrim.
That's what I'm doing and nothing has bitten me yet ... but I may
just be lucky. The SSD I use the most is a PNY device a year or so
old so I expect it to be reasonably current and performant.
Older and cheaper SSDs are reported to experience problems when doing
TRIM on the fly, and if you have one of those then you would be
better advised to use fstrim instead. Don't ask me which SSDs fall
into this category because I can't give you a list.
The time that fstrim will be most beneficial is not after writing
data to the SSD, it's after erasing data from the SSD ... so if you
delete a lot of files, or if you edit a lot of files (so that a new
version is created and the old one is deleted), there will be a lot
of sectors to TRIM. Just writing new data to the disk doesn't create
unused sectors, so TRIM won't help.
The general advice I see from people advocating the schedules use of
fstrim is to do it once a week, unless you have reason to believe
that you need to do it more often. I know that doesn't help much.
fstrim doesn't take very long, and doesn't add to SSD wear, so
there's no harm in running more often, it just won't add benefit.
One thing I would add: If you decide to turn on on-the-fly TRIMming
(by adding "discard" to /etc/fstab) it's worth running fstrim once
first, to bring the SSD up to date with what's actually in use in the
flash memory, and what isn't. It should stay current by itself after
that.
Does any of this help?
On Wed, 10 Sep 2025 00:14:56 +0100
Davey <davey@example.invalid> wrote:
The more I think about it, the more I am coming down on the restart
plan, with no new items involved:
Remove the M2SSD, wipe the primary drive (SATA SSD) and install a
clean setup of ver. 22.04. Install required applications. When all
is operating as it should, then re-install the M2SSD.
The only files that I will lose are the TB Local Folders since the
last backup, and they can be recreated, thanks to gmail keeping all messages.
I appreciate what you say, and ma grateful for the thoughts, but TOMy plan is now being carried out. The M2SSD is out, a new Ubuntu
ME my way has more advantages than disadvantages, and is simpler to implement.
22.04 OS has been installed on the wiped primary drive.
Tomorrow will involve, amongst other applications installation,
copying FF and TB profiles from backups. Some other applications are
already installed. It's nice being able to read and write from/to the
primary drive again.
At some future time, I will re-install the M2SSD. But not yet.
Sorry, Vince, but that's the way it is.
<109pmku$145pu$1@dont-email.me>
<1757451772@f1.n250.z2.fidonet.ftn>
<109qcdh$19eei$1@dont-email.me> <109usdr$2ocfs$1@dont-email.me>
On Thu, 11 Sep 2025 17:12:43 +0100
Davey <davey@example.invalid> wrote:
On Wed, 10 Sep 2025 00:14:56 +0100
Davey <davey@example.invalid> wrote:
restart
The more I think about it, the more I am coming down on the
plan, with no new items involved:all
Remove the M2SSD, wipe the primary drive (SATA SSD) and install a
clean setup of ver. 22.04. Install required applications. When all
is operating as it should, then re-install the M2SSD.
The only files that I will lose are the TB Local Folders since the
last backup, and they can be recreated, thanks to gmail keeping
messages.TO
I appreciate what you say, and ma grateful for the thoughts, but
ME my way has more advantages than disadvantages, and is simplerto
implement.My plan is now being carried out. The M2SSD is out, a new Ubuntu
22.04 OS has been installed on the wiped primary drive.
Tomorrow will involve, amongst other applications installation,
copying FF and TB profiles from backups. Some other applications are
already installed. It's nice being able to read and write from/to
the primary drive again. At some future time, I will re-install the
M2SSD. But not yet.
Sorry, Vince, but that's the way it is.
After a lot more Real Life getting in the way, I managed to return to
the laptop today. I replaced the 2nd drive, and so far, it looks good.
I have even managed to rename it as M2SSD. There is still a lot more
to do to bring the machine back up to its previous level, but the path
looks clear.
But. It sits in my study, from where I have a good view of the patio
and any visiting cats, plus the wildlife in the garden. The desktop is deeper in the house, and not where I want to spend my computing time.
But I have got used to the monitor, which is much much bigger than the laptop's. So do I finish off the laptop's resurrection, and continue
on while squinting at a smallish screen, or re-arrange my study so
that the desktop takes the place of the laptop? Hmmm. Much thinking to
be done.
Hello Davey!
21 Sep 25 16:10, Davey wrote to all:
<109pmku$145pu$1@dont-email.me>
<1757451772@f1.n250.z2.fidonet.ftn>
<109qcdh$19eei$1@dont-email.me> <109usdr$2ocfs$1@dont-email.me>
On Thu, 11 Sep 2025 17:12:43 +0100
Davey <davey@example.invalid> wrote:
On Wed, 10 Sep 2025 00:14:56 +0100
Davey <davey@example.invalid> wrote:
restart
The more I think about it, the more I am coming down on the
plan, with no new items involved:all
Remove the M2SSD, wipe the primary drive (SATA SSD) and install
a clean setup of ver. 22.04. Install required applications.
When all is operating as it should, then re-install the M2SSD.
The only files that I will lose are the TB Local Folders since
the last backup, and they can be recreated, thanks to gmail
keeping
messages.TO
I appreciate what you say, and ma grateful for the thoughts,
but
ME my way has more advantages than disadvantages, and isto
simpler
implement.My plan is now being carried out. The M2SSD is out, a new Ubuntu
22.04 OS has been installed on the wiped primary drive.
Tomorrow will involve, amongst other applications installation,
copying FF and TB profiles from backups. Some other applications
are already installed. It's nice being able to read and write
from/to the primary drive again. At some future time, I will
re-install the M2SSD. But not yet.
Sorry, Vince, but that's the way it is.
After a lot more Real Life getting in the way, I managed to return
to the laptop today. I replaced the 2nd drive, and so far, it
looks good. I have even managed to rename it as M2SSD. There is
still a lot more to do to bring the machine back up to its
previous level, but the path looks clear.
But. It sits in my study, from where I have a good view of the
patio and any visiting cats, plus the wildlife in the garden. The
desktop is deeper in the house, and not where I want to spend my
computing time. But I have got used to the monitor, which is much
much bigger than the laptop's. So do I finish off the laptop's resurrection, and continue on while squinting at a smallish
screen, or re-arrange my study so that the desktop takes the place
of the laptop? Hmmm. Much thinking to be done.
OR - plus the laptop into the monitor via the rear (usually)
connector, plug in a wireless Kbrd and mouse and look to your hearts contentment.
Vincent
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 54:01:35 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,448 |