Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
SSD, Encryption, Trim, and Wear Leveling
SSD, Encryption, Trim, and Wear Leveling
I have a used X301 on which I want to create an encypted (Linux) system. Normally one writes random data to the entire drive first, so that there's no way to tell what's data and what's empty space on the drive.
However, it's my understanding that the Trim functionality of SSDs writes zeros to the empty space, when files are deleted. So I'm wondering if it would be better to just zero out the drive to begin with. This undermines some of the security of an encrypted drive, but I'm not concered with plausible deniablity, etc.
My main concern is if zeroing out the drive will allow it to perform better, because the SSD works better if it can see where there's empty space, both for the Trim function and for wear leveling. If the drive is completely filled with random data, I'm assuming the SSD controller would view it as full and this would degrade performance and wear leveling. Elsewhere I've seen people say that you should leave some unpartitioned space on the drive that can be used by the SSD for wear leveling. Does anyone know if either of these ideas (zeroing out, unpartitioned space) are good ideas?
(I should note, also, that I have one of the older 128 Gb Samsung SSDs, MMCQE28G8MUP, so I'm not actually sure it supports Trim, but I think it does do wear leveling.)
However, it's my understanding that the Trim functionality of SSDs writes zeros to the empty space, when files are deleted. So I'm wondering if it would be better to just zero out the drive to begin with. This undermines some of the security of an encrypted drive, but I'm not concered with plausible deniablity, etc.
My main concern is if zeroing out the drive will allow it to perform better, because the SSD works better if it can see where there's empty space, both for the Trim function and for wear leveling. If the drive is completely filled with random data, I'm assuming the SSD controller would view it as full and this would degrade performance and wear leveling. Elsewhere I've seen people say that you should leave some unpartitioned space on the drive that can be used by the SSD for wear leveling. Does anyone know if either of these ideas (zeroing out, unpartitioned space) are good ideas?
(I should note, also, that I have one of the older 128 Gb Samsung SSDs, MMCQE28G8MUP, so I'm not actually sure it supports Trim, but I think it does do wear leveling.)
Re: SSD, Encryption, Trim, and Wear Leveling
TRIM doesn't quite work that way. It doesn't just zero pages.cb474 wrote: However, it's my understanding that the Trim functionality of SSDs writes zeros to the empty space, when files are deleted. So I'm wondering if it would be better to just zero out the drive to begin with. This undermines some of the security of an encrypted drive, but I'm not concered with plausible deniablity, etc.
Slack space, if recognized by the drive as such, will often be used as spare area to improve performance. But the mechanics of how and why said space will be used depends on the drive. I don't know enough about the SSDs in the X301 to say whether or not simply leaving a bit of free space when partitioning is good enough.
Personally I wouldn't worry about it. I'd fill the drive with random data to start, set up your LUKS partitions, and think no more of it. Sure, you could have a bit of a long-term performance drop off since LUKS doesn't pass through TRIM (or, depending on the drive, you could not notice any difference.) I did that when I had an X300 and it worked fine. YMMV obviously.
Need help with Linux or FreeBSD? PM or catch me on IRC: I'm ThinkRob on FreeNode and EFnet.
Laptop: X270, running Fedora
Desktop: Intellistation 285 (currently dead)
Workstation: owned by my employer
Toy: Miata!
Laptop: X270, running Fedora
Desktop: Intellistation 285 (currently dead)
Workstation: owned by my employer
Toy: Miata!
-
- ThinkPadder
- Posts: 1724
- Joined: Sat Apr 22, 2006 4:26 pm
- Location: TX, USA & Bombay, India
Re: SSD, Encryption, Trim, and Wear Leveling
Interesting work. Reminds me of some stuff I worked on in Grad school.cb474 wrote:I have a used X301 on which I want to create an encypted (Linux) system. Normally one writes random data to the entire drive first, so that there's no way to tell what's data and what's empty space on the drive.
However, it's my understanding that the Trim functionality of SSDs writes zeros to the empty space, when files are deleted. So I'm wondering if it would be better to just zero out the drive to begin with. This undermines some of the security of an encrypted drive, but I'm not concered with plausible deniablity, etc.
My main concern is if zeroing out the drive will allow it to perform better, because the SSD works better if it can see where there's empty space, both for the Trim function and for wear leveling. If the drive is completely filled with random data, I'm assuming the SSD controller would view it as full and this would degrade performance and wear leveling. Elsewhere I've seen people say that you should leave some unpartitioned space on the drive that can be used by the SSD for wear leveling. Does anyone know if either of these ideas (zeroing out, unpartitioned space) are good ideas?
(I should note, also, that I have one of the older 128 Gb Samsung SSDs, MMCQE28G8MUP, so I'm not actually sure it supports Trim, but I think it does do wear leveling.)
T61 8892-02U: 14.1"SXGA+/2.2C2D/4G/XP|Adv Mini Dock|30" Gateway XHD3000 WQXGA via Dual-link DVI
X61T 7767-96U: 12.1"SXGA+/1.6C2D/3G/Vista|Ultrabase
W510 4319-2PU: 15.6"FHD/i7-720QM/4G/Win7Pro64 (for dad)
T43 1875-DLU: 14.1"XGA/1.7PM-740/1G/XP (Old)
X61T 7767-96U: 12.1"SXGA+/1.6C2D/3G/Vista|Ultrabase
W510 4319-2PU: 15.6"FHD/i7-720QM/4G/Win7Pro64 (for dad)
T43 1875-DLU: 14.1"XGA/1.7PM-740/1G/XP (Old)
Re: SSD, Encryption, Trim, and Wear Leveling
Your drive doesn't support TRIM, you can check with crystaldiskinfo.
First generation ssds like the X301 Samsung were never designed with TRIM.
I had to spend like 400 bucks to upgrade to a 256 Kingston v180 to get trim for my X301.
You need to use secure delete via BIOS or run Tony Trim on your drive manually.
Both a pain.
These drives will slow down to a crawl if you flush them out via random data writes.
They can slow down to less then 20mb/s write speeds. A security flush like what you are talking about will in effect dirty the entire drive, and leave your SSD slower than an old PATA HDD.
Leaving space on a drive for wear leveling is only good for modern SSDs that have hardware garbage collection such as the new Samsungs or the Indelink Everest Series.
The unused space gives the SSD controller the ability to run background garbage collection in idle states. Again, your drive doesn't support this feature.
So pretty much, no matter what you do your drive will suffer from wear because it has no TRIM and no hardware garbage collection.
It is what it is. I know from first hand experience, I had the same drive. The worst it ever got, I was doing 15mb/s writes and 50mb/s read. It was essentially worse than a 5400rpm.
First generation ssds like the X301 Samsung were never designed with TRIM.
I had to spend like 400 bucks to upgrade to a 256 Kingston v180 to get trim for my X301.
You need to use secure delete via BIOS or run Tony Trim on your drive manually.
Both a pain.
These drives will slow down to a crawl if you flush them out via random data writes.
They can slow down to less then 20mb/s write speeds. A security flush like what you are talking about will in effect dirty the entire drive, and leave your SSD slower than an old PATA HDD.
Leaving space on a drive for wear leveling is only good for modern SSDs that have hardware garbage collection such as the new Samsungs or the Indelink Everest Series.
The unused space gives the SSD controller the ability to run background garbage collection in idle states. Again, your drive doesn't support this feature.
So pretty much, no matter what you do your drive will suffer from wear because it has no TRIM and no hardware garbage collection.
It is what it is. I know from first hand experience, I had the same drive. The worst it ever got, I was doing 15mb/s writes and 50mb/s read. It was essentially worse than a 5400rpm.
Thinkpad W520 | Intel i7 2.5 XM | 1920x1080 FHD 95% Gamut | 32 GB DDR3 | 128GB MyDigitalSSD mSATA SSD | 2GB NVIDIA QUADRO 2000M | UEFI WIN 7
Re: SSD, Encryption, Trim, and Wear Leveling
15MB/s random writes would still be an order of magnitude faster than a conventional disk. Same for the seek time(s).Kaze22 wrote: It is what it is. I know from first hand experience, I had the same drive. The worst it ever got, I was doing 15mb/s writes and 50mb/s read. It was essentially worse than a 5400rpm.
Not saying that you don't need to consider the performance implications of an old SSD, but even in the worst case the SSD will still outperform spinning rust.
Need help with Linux or FreeBSD? PM or catch me on IRC: I'm ThinkRob on FreeNode and EFnet.
Laptop: X270, running Fedora
Desktop: Intellistation 285 (currently dead)
Workstation: owned by my employer
Toy: Miata!
Laptop: X270, running Fedora
Desktop: Intellistation 285 (currently dead)
Workstation: owned by my employer
Toy: Miata!
Re: SSD, Encryption, Trim, and Wear Leveling
A 7200rpm drive can do 80mb read and write assuming it's a latest model with decent cache. You'd be surprised how fast some of these new HDD are. I was writing some heavy data to my W520s 500GB HDD (7200rpm) from my msata SSD. I was seeing sustained speeds of 90-100mb/s. Not too shabby for spinning rust.
Of course the milisecond seek is what makes the difference.
All in all, these older SSDs are a real hassle to maintain.
Ever try installing large updates at 15mb write/s. Not fun.
Of course the milisecond seek is what makes the difference.
All in all, these older SSDs are a real hassle to maintain.
Ever try installing large updates at 15mb write/s. Not fun.
Thinkpad W520 | Intel i7 2.5 XM | 1920x1080 FHD 95% Gamut | 32 GB DDR3 | 128GB MyDigitalSSD mSATA SSD | 2GB NVIDIA QUADRO 2000M | UEFI WIN 7
Re: SSD, Encryption, Trim, and Wear Leveling
Those are sequential speeds. Random 4K performance for *any* spinning disk is nowhere near 10 MB/s, let alone 80.Kaze22 wrote:A 7200rpm drive can do 80mb read and write assuming it's a latest model with decent cache. You'd be surprised how fast some of these new HDD are. I was writing some heavy data to my W520s 500GB HDD (7200rpm) from my msata SSD. I was seeing sustained speeds of 90-100mb/s. Not too shabby for spinning rust.
Need help with Linux or FreeBSD? PM or catch me on IRC: I'm ThinkRob on FreeNode and EFnet.
Laptop: X270, running Fedora
Desktop: Intellistation 285 (currently dead)
Workstation: owned by my employer
Toy: Miata!
Laptop: X270, running Fedora
Desktop: Intellistation 285 (currently dead)
Workstation: owned by my employer
Toy: Miata!
-
- Similar Topics
- Replies
- Views
- Last post
-
-
T14 Gen3 (Intel) and SSD Samsung 990 Pro 4TB
by Jan_888 » Tue Feb 13, 2024 5:54 pm » in Thinkpad T14/T15/T16 - 1 Replies
- 556 Views
-
Last post by ZaZ
Thu Feb 15, 2024 7:56 pm
-
-
-
X1CG7 Touch not recgnising cloned SSD
by mjkalba » Fri Oct 06, 2023 5:27 am » in ThinkPad X1 / X1-Carbon / X1-Extreme and later Series - 1 Replies
- 2328 Views
-
Last post by TPFanatic
Fri Oct 06, 2023 8:59 am
-
-
-
X230 - what SSD will best fit in the WWAN slot?
by br1anstorm » Tue Nov 14, 2023 3:59 pm » in ThinkPad X230-X280 / X390 Series - 15 Replies
- 5191 Views
-
Last post by br1anstorm
Wed Nov 15, 2023 6:17 pm
-
-
- 0 Replies
- 4055 Views
-
Last post by bjain29
Mon Nov 20, 2023 9:28 am
Who is online
Users browsing this forum: No registered users and 55 guests