The most non destructive way to prepare a SSD for Linux Mint?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

The most non destructive way to prepare a SSD for Linux Mint?

Post by panorain »

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 a Linux Mint 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
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.
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
LanceM

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by LanceM »

You don't need to do anything radical all. Just erase its partition table with Disks and make a new one using GPT or MSDOS depending if it's a legacy or UEFI install. Most installers will do all that for you anyway, but it's good to clean a drive first. Same thing with flash drives and HDD unless you want it erased securely, in which case dd if okay, but puts a lot of writes on flash memory.
pterodax
Level 1
Level 1
Posts: 1
Joined: Tue Jun 29, 2021 12:31 pm

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by pterodax »

panorain wrote: Sun May 16, 2021 11:20 pm 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 a Linux Mint 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
You can use DBAN to format a disk beforehand (there should still be a free version floating around, despite the commercial ones).

Also, are you 'panorain' at ##aix on IRC? (libera.chat now instead of freenode)
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5819
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by Lady Fitzgerald »

A simple reformat is all you need to do.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
djph
Level 7
Level 7
Posts: 1958
Joined: Thu Jun 27, 2019 5:43 am
Location: ::1

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by djph »

panorain wrote: Sun May 16, 2021 11:20 pm I was recently informed that using dd (dubbed - data-destroyer) can
seriously shorten a SSD devices lifespan.
This is untrue, at least in any meaningful sense.

panorain wrote: Sun May 16, 2021 11:20 pm 1. What is the most effective non destructive way to erase or prepare a
SSD drive for a Linux Mint installation?
Just let the installer format it. Granted it is "destructive" to any data on the drive (and equally "destructive" to the SSD anyway).
panorain wrote: Sun May 16, 2021 11:20 pm 2. Does the use of "dd" on USB flash drives kill the limited lives on
these devices in a similar manner also?
Technically, yes. It is SLIGHTLY more meaningful on USB flash drives, but still mostly meaningless.
panorain wrote: Sun May 16, 2021 11:20 pm 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?
TECHNICALLY yes, although you still ultimately have physical wear and tear on the drive.



ANYWAY -- on flash media (SSD, USB, SD Cards, etc), you have a limited number of writes to any single memory cell before it becomes "worn out". On modern devices that implement pretty decent wear leveling (basically everything made in the last half decade or so), you're looking at several orders of magnitude difference.

For example, according to the datasheet for my WD Blue 250 GiB drive can a lifetime of 100 TiB written (or 400 full overwrites. Sorry I can't link to the sheet directly, stupid javascript downloader wall on their site). I normally blow away a harddrive (dd /dev/zero ... format ... install ... ) about every 5-6 years ... so over the generally accepted lifespan of a drive (7-10 years) I'll "waste" about 5 of the full overwrites. So ... 395 rewrites to go (or about 98 TiB). Let's assume I shuffle around 100 GiB per month -- 10 years (120 months) is _only_ 12 TiB (or what, another 12% of the expected write lifespan?).
DeathDancer
Level 2
Level 2
Posts: 92
Joined: Wed Jun 02, 2021 3:44 pm

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by DeathDancer »

pterodax wrote: Tue Jun 29, 2021 3:31 pm You can use DBAN to format a disk beforehand (there should still be a free version floating around, despite the commercial ones).
Do not use DBAN on an SSD, DBAN will render most SSD,s unusable!
Just install Mint as you would on a regular drive, and let fstrim do the rest.
Mint will setup fstrim to run once a week, so you need not worry about trim settings in Mint 19.X or later.
As such your drive should perform well for years to come.
Come over to the Darkside (we have Cookies).
User avatar
kc1di
Level 18
Level 18
Posts: 8180
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by kc1di »

As has been said you don't really need to do anything the installer will format the SSD for you. After install you may want to follow the instructions on this blog to give the SSD longer life. https://easylinuxtipsproject.blogspot.com/p/ssd.html
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
DeathDancer
Level 2
Level 2
Posts: 92
Joined: Wed Jun 02, 2021 3:44 pm

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by DeathDancer »

kc1di wrote: Tue Jul 06, 2021 6:27 am After install you may want to follow the instructions on this blog to give the SSD longer life. https://easylinuxtipsproject.blogspot.com/p/ssd.html
While I agree with most of the site’s advice I disagree with resetting trim to a daily job.
Trim is in fact a write job to the drive, Mint /Ubuntu’s once a week is a good default for most users, except if you move, copy or delete a large amount of files. Even then I would advise maybe twice weekly. Some early and/or cheap SSD drives will conk out very fast if trimmed to much.

You might also want to give this thread about ssd optimization a look.
viewtopic.php?f=50&t=350518
Come over to the Darkside (we have Cookies).
User avatar
panorain
Level 5
Level 5
Posts: 572
Joined: Mon Dec 16, 2013 3:21 pm

Re: The most non destructive way to prepare a SSD for Linux Mint?

Post by panorain »

Thank you all for your replies. I would like to ask a few more questions that I put together after reviewing your input.

Code: Select all

systemctl status fstrim.timer

reports the following:
  • ● fstrim.timer - Discard unused blocks once a week
    Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
    Active: active (waiting) since Sun 2021-11-28 18:18:53 CST; 2h 10min ago
    Trigger: Mon 2021-11-29 00:00:00 CST; 3h 30min left
    Triggers: ● fstrim.service
    Docs: man:fstrim

    Nov 28 18:18:53 panorain-HP-ProDesk-405-G1-MT systemd[1]: Started Discard unused blocks once a week.
1. Does above phrase "Started Discard unused blocks once a week" in the

Code: Select all

systemctl status fstrim.timer
output when interpreted correctly mean that Mint is currently adjusted to set the drives trim each week?

Code: Select all

journalctl | grep fstrim.service
  • Oct 04 00:04:01 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Oct 11 00:00:38 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Oct 18 00:00:32 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Oct 25 00:00:31 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Nov 01 02:36:43 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Nov 08 11:30:08 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Nov 15 02:22:36 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.
    Nov 22 08:49:29 panorain-HP-ProDesk-405-G1-MT systemd[1]: fstrim.service: Succeeded.

2. I can see by the output produced by

Code: Select all

journalctl | grep fstrim.service
above, that it certainly looks that every 7 days the SSD drive is being trimmed.

Code: Select all

fstrim -av
Gives the following output:
/home/panorain: 340.5 GiB (365594382336 bytes) trimmed on /home/panorain/.Private
/boot/efi: 507.7 MiB (532312064 bytes) trimmed on /dev/sda1
/boot: 482.4 MiB (505856000 bytes) trimmed on /dev/sda2
/: 0 B (0 bytes) trimmed on /dev/mapper/mint--vg-root

3. Then running

Code: Select all

journalctl | grep fstrim.service
once again does not show the current date. Why is this? Even after I powercycle the computer the current date Nov 28 or even a more future date is not listed. Does this have something to do with the fstrim log maybe?

I have to read https://wiki.archlinux.org/title/Solid_ ... iodic_TRIM yet.

-Best Wishes
Linux Mint 21.2 Victoria
Always =updatedb=
GNU/LINUX
Locked

Return to “Storage”