The most non destructive way to prepare a SSD for openSUSE:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan. 1. What is the most effective non destructive way to erase or prepare a SSD drive for an openSUSE (LEAP or TDE) installation? I am wondering now about USB flash drive devices. 2. Does the use of "dd" on USB flash drives kill the limited lives on these devices in a similar manner also? 3. Does the use of "dd" on a mechanical drive have less of a negative lifespan effect than that of it's effects on SSD or USB devices? -Best Regards :|
On Monday 17 May 2021, -pj wrote:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan.
1. What is the most effective non destructive way to erase or prepare a SSD drive for an openSUSE (LEAP or TDE) installation?
I am wondering now about USB flash drive devices.
2. Does the use of "dd" on USB flash drives kill the limited lives on these devices in a similar manner also?
3. Does the use of "dd" on a mechanical drive have less of a negative lifespan effect than that of it's effects on SSD or USB devices?
-Best Regards :|
If you are not concerned about securely erasing what was previously on the drive, then I think the answers the the following question seem pretty good: https://superuser.com/questions/308251/how-to-trim-discard-a-whole-ssd-parti... The answers mention/explain blkdiscard, mkfs.ext4, hdparm and how those tools use the TRIM command to tell the SSD that blocks are now really free for reuse. If you used one of these tools after dd, then I suppose that would work, BUT... Using something like dd/scrub to repeatably overwrite a drive would likely shorten the life off the drive. It may even trigger a failure state if the drive already has reallocated bad blocks and then the dd/scrub causes it to run out of over-provisioning space. I don't think you can securely erase an SSD. Wear-leveling and over-provisioning space would mean you would likely not overwrite all the previously written blocks. Filling the drive 100% before a reformat might go a long way towards it, but you could not be certain that absolutely everything has been overwritten. Encrypting everyting on the drive from day-one is as close as you can get. I think USB drives are similar, but I don't think they do wear leveling, and I'm not sure what they do about over provisioning, someone else might know more. Michael
On 5/17/21 3:57 AM, -pj wrote:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan.
References? How often would you run dd(1) to overwrite the block device? 3x? 10x? That still sounds very small compared to the expected life-time usage. And as Michael also wrote: there is internal space reserved for over-provisioning which the kernel doesn't see. Therefore, you probably can't securely erase all data unless you treat the SSD with some physical methods ... which also reduces the lifespan quite drastically. ;-) Have a nice day, Berny
On 5/17/21 11:55 PM, Bernhard Voelker wrote:
On 5/17/21 3:57 AM, -pj wrote:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan. References?
How often would you run dd(1) to overwrite the block device? 3x? 10x? That still sounds very small compared to the expected life-time usage.
And as Michael also wrote: there is internal space reserved for over-provisioning which the kernel doesn't see. Therefore, you probably can't securely erase all data unless you treat the SSD with some physical methods ... which also reduces the lifespan quite drastically. ;-)
I do believe that most SSD manufacturers have a "Secure Erase" ATA command that doesn't affect drive lifespan too much. I'm not sure how you actually do it, a manufacturer-provided program might be needed. Regards, Lew
On 18/05/2021 09.16, Lew Wolfgang wrote:
I do believe that most SSD manufacturers have a "Secure Erase" ATA command that doesn't affect drive lifespan too much. I'm not sure how you actually do it, a manufacturer-provided program might be needed.
hdparm can do it. --security-erase PWD Erase (locked) drive, using password PWD (DANGEROUS). Password is given as an ASCII string and is padded with NULs to reach 32 bytes. Use the special password NULL to represent an empty password. The applicable drive password is selected with the --user-master switch (default is "user" password). No other options are permitted on the command line with this one. --security-erase-enhanced PWD Enhanced erase (locked) drive, using password PWD (DANGEROUS). Password is given as an ASCII string and is padded with NULs to reach 32 bytes. The applicable drive password is selected with the --user-master switch (default is "user" password). No other options are permitted on the command line with this one. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.1 x86_64 (Minas Tirith))
From: Bernhard Voelker
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan.
References? How often would you run dd(1) to overwrite the block device? 3x? 10x? That still sounds very small compared to the expected life-time usage. Multiple overwriting is what shred(1) does. But by my understanding of SSD devices, doing it more than once is unnecessary; there is none of the mechanical wobble that makes it possible sometimes to read old tracks on a magnetic disk. Even then, I have read (I forget where) that overwriting more than three times is excessive, unless you suspect the NSA is going to go all-out to try to recover your files. -- Bob Rogers http://www.rgrjr.com/
On 17/05/2021 03.57, -pj wrote:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan.
Every write unit has a limited number of write operations on flash media. If you fill every sector with zeroes, you are reducing the number by 1 on the entire disk or partition. How many writes, varies; I don't have an actual figure.
1. What is the most effective non destructive way to erase or prepare a SSD drive for an openSUSE (LEAP or TDE) installation?
There is a "secure erase" function in hdparm, but I guess it is equally bad. I would simply use gparted and create a new, empty partition. The trim method mentioned by Michael, I will have to read about it.
I am wondering now about USB flash drive devices.
2. Does the use of "dd" on USB flash drives kill the limited lives on these devices in a similar manner also?
Much worse, it doesn't have wear levelling or trim.
3. Does the use of "dd" on a mechanical drive have less of a negative lifespan effect than that of it's effects on SSD or USB devices?
No effect at all. Except n hours more of use. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.1 x86_64 (Minas Tirith))
On Tuesday 18 May 2021, Carlos E. R. wrote:
On 17/05/2021 03.57, -pj wrote:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan.
Every write unit has a limited number of write operations on flash media. If you fill every sector with zeroes, you are reducing the number by 1 on the entire disk or partition.
How many writes, varies; I don't have an actual figure.
1. What is the most effective non destructive way to erase or prepare a SSD drive for an openSUSE (LEAP or TDE) installation?
There is a "secure erase" function in hdparm, but I guess it is equally bad.
I would simply use gparted and create a new, empty partition.
The trim method mentioned by Michael, I will have to read about it. ...
There is quite a bit of info in this OpenSUSE article: https://en.opensuse.org/SDB:SSD_discard_(trim)_support As usual, the archlinux wiki is a good source of info including on other issues such as NCQ incompatibilities (got bitten by that one): https://wiki.archlinux.org/title/Solid_state_drive#SSD_memory_cell_clearing Michael
On 18/05/2021 09.15, Carlos E. R. wrote:
On 17/05/2021 03.57, -pj wrote:
...
1. What is the most effective non destructive way to erase or prepare a SSD drive for an openSUSE (LEAP or TDE) installation?
There is a "secure erase" function in hdparm, but I guess it is equally bad.
I would simply use gparted and create a new, empty partition.
The trim method mentioned by Michael, I will have to read about it.
I forgot there is a way with dd, which is to zero a few sectors at the starts, where the GPT table resides, and a few sectors at the end, where there is a backup copy exists. However, this is what gparted does, more or less (replacing with a new table). However, I do not know how to calculate the exact sectors to erase. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.1 x86_64 (Minas Tirith))
On 2021-05-17 03:57, -pj wrote:
I was recently informed that using dd (dubbed - data-destroyer) can seriously shorten a SSD devices lifespan.
1. What is the most effective non destructive way to erase or prepare a SSD drive for an openSUSE (LEAP or TDE) installation?
I am wondering now about USB flash drive devices.
2. Does the use of "dd" on USB flash drives kill the limited lives on these devices in a similar manner also?
3. Does the use of "dd" on a mechanical drive have less of a negative lifespan effect than that of it's effects on SSD or USB devices?
-Best Regards :|
Hi PJ, I think I can shed some light on your questions,our team builds bootable USB-sticks, and during that process our flash drives are used thousands of times over and over again. And guess what, we do use "dd". True, we do have worn-out flash drives, but guess what, 99% of those were fresh from the packing... After the first dd ever applied to them, they became read-only, even for root. real wearing out (blocks becoming bad) is something i haven't seen for a long time. Actually, last time was indeed on a mechanical drive... Kind regards, Hans
On 20/05/2021 22.38, suse@a-domani.nl wrote:
On 2021-05-17 03:57, -pj wrote:
...
Hi PJ,
I think I can shed some light on your questions,our team builds bootable USB-sticks, and during that process our flash drives are used thousands of times over and over again. And guess what, we do use "dd".
True, we do have worn-out flash drives, but guess what, 99% of those were fresh from the packing... After the first dd ever applied to them, they became read-only, even for root.
real wearing out (blocks becoming bad) is something i haven't seen for a long time. Actually, last time was indeed on a mechanical drive...
You are talking of using dd to "burn" an image to an USB stick. That is, of course, the best scenario for using dd, it is the recommended tool. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.1 x86_64 (Minas Tirith))
Thank you once again for all your excellent advice on this topic. I apologize if I began the post under the incorrect subject matter. I have taken notes and will review these spoken of software applications slowly. Please feel free of course to input anymore thoughts on this matter if something comes to mind. --Best Regards On 5/20/21 6:05 PM, Carlos E. R. wrote:
On 20/05/2021 22.38, suse@a-domani.nl wrote:
On 2021-05-17 03:57, -pj wrote: ...
Hi PJ,
I think I can shed some light on your questions,our team builds bootable USB-sticks, and during that process our flash drives are used thousands of times over and over again. And guess what, we do use "dd".
True, we do have worn-out flash drives, but guess what, 99% of those were fresh from the packing... After the first dd ever applied to them, they became read-only, even for root.
real wearing out (blocks becoming bad) is something i haven't seen for a long time. Actually, last time was indeed on a mechanical drive...
You are talking of using dd to "burn" an image to an USB stick. That is, of course, the best scenario for using dd, it is the recommended tool.
participants (7)
-
-pj
-
Bernhard Voelker
-
Bob Rogers
-
Carlos E. R.
-
Lew Wolfgang
-
Michael Hamilton
-
suse@a-domani.nl