# Is Gentoo hard on nvme and ssd drives?

## C1REX

People say that life span (read/write) of solid state/nvme drives is not a concern for regular people. 

So how about gentoo users who very heavily use disk if not compiling in tmpfs?

----------

## Ionen

Unless we're talking something small (like 8-16GB where the same sectors would constantly get rewritten) or something very old and inefficient, then no.

Certainly can't be worse than all those huge VM images I keep moving in/out the ssd and backing up and reverting  :Rolling Eyes: 

My old 128GB ssd I abused for 9 years is still entirely fine (except for a dumb firmware bug that made it stop working early at a mere 2k hours uptime that a firmware upgrade fixed), but retired due to larger NVMe drives showing it the door.. and the larger they are, the less of an impact a little space use building on them will have.

----------

## NeddySeagoon

C1REX,

There is anecdotal evidence suggesting that early SSDs would not survive a Gentoo install.

Newer drives being both larger and with wear levelling should not be a problem.

Wear levelling moves around things that never change too.

The concept of a partition being a number of contiguous blocks does not exist in an SSD.

I would be a bit nervous of the latest four bits per cell SSDs but that's the way things are moving.

More bits per cell, means reduced erase cycles and reduced cells per SSD which means lower cost products. 

More bits per cell also means slower write speeds, which may be compensated for by various caches ... or not.

In short, its not a problem any more.

Gentoos arm64 build box has a 350G SSD

```
=== START OF INFORMATION SECTION ===

Device Model:     INTEL SSDSCKHB340G4

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  5 Reallocated_Sector_Ct   0x0032   100   100   000    Old_age   Always       -       0

  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       24822

241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       2129413

242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       1552020
```

Several users do nothing but build on that box and its several years old now.

Notice that the Total_LBAs_Written in larger than Total_LBAs_Read. That will be all the writes that are never read due to the kernel virtual memory system caching whatever it can.

----------

## saellaven

You might find this topic interesting

SSD wear poll (Gentoo root disk only!)

You'll find that a lot of us don't have any issues with our SSDs

To update my own drives from there

This is my root drive (installed Feb 17, 2016)

```

Device Model:     Samsung SSD 850 EVO 250GB

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   093   093   000    Old_age   Always       -       34855

 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       47

177 Wear_Leveling_Count     0x0013   099   099   000    Pre-fail  Always       -       8

179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0

181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0

182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0

183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0

187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0

190 Airflow_Temperature_Cel 0x0032   071   052   000    Old_age   Always       -       29

195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0

199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0

235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       27

241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       7099321901

```

This is for my games (installed August 28, 2017)

```

Device Model:     Samsung SSD 850 EVO 500GB

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       21474

 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       36

177 Wear_Leveling_Count     0x0013   099   099   000    Pre-fail  Always       -       2

179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0

181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0

182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0

183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0

187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0

190 Airflow_Temperature_Cel 0x0032   071   045   000    Old_age   Always       -       29

195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0

199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0

235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       12

241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       2493235045

```

Granted, I have 32 GB of RAM (but compile with -j16) and have -pipe set in my CFLAGS, but as you can see, my Wear_Leveling_Count on both drives is pretty low and neither drive has had a block fail or had to dip into reserved blocks. Needless to say, both drives still have a lot of life left.

As Neddy points out be wary of how many cells the drives use to store data. The fewer cells written, the longer it takes to wear them out and the longer the write lifetime of the drive (in Samsung SSD terminology, PRO = 2 bits, EVO = 3 bits, and QVO = 4 bits).

----------

## C1REX

 *saellaven wrote:*   

> 
> 
> As Neddy points out be wary of how many cells the drives use to store data. The fewer cells written, the longer it takes to wear them out and the longer the write lifetime of the drive (in Samsung SSD terminology, PRO = 2 bits, EVO = 3 bits, and QVO = 4 bits).

 

Interesting info. 

Do you know how can I check if some budget options like this have small or big cells? 

https://www.amazon.co.uk/Sabrent-Rocket-Internal-Performance-SB-RKTQ-1TB/dp/B07ZZYWTBP/ref=sr_1_4?crid=2LTPUXRRSDCWP&keywords=nvme+1tb&qid=1581355584&s=computers&sprefix=nvme%2Ccomputers%2C157&sr=1-4

This one says you can decide how big is sector size? Is it possibile?

Are 4 bits disks prone to dying early or it's still not likely for regular humans like me?

----------

## NeddySeagoon

C1REX,

Whats interesting is the 

```
Device Model:     Samsung SSD 850 EVO 250GB

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE 

241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       7099321901
```

from saellavens post.

A 250GB drive contains 61035156 4kB write blocks. With 7099321901 blocks written, that's 116 disk fulls.

If the wear levelling were perfect, each block has been erased 116 times. Its erasing that kills SSDs, which is a necessary evil before writing.

4 bit cells can be rated as low as 300 erase cycles, so saellavens drive were a 4 bit cell type, (its not) it would have used about 1/3 of its life expectancy.

As its a 3bit cell device, it is expected to last over 1000 erase cycles, so its used about 1/10 of its life expectancy.

We also know

```
Device Model:     Samsung SSD 850 EVO 250GB

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  9 Power_On_Hours          0x0032   093   093   000    Old_age   Always       -       34855 
```

So with saellavens use pattern, a 4bit cell drive would be expected to run about 100,000 hours and a 3 bit cell drive about 350,000 hours. 

At 10 hours a day, that's 27 years and 96 years before cell wearout.

The question then becomes do you expect to be using that drive in  27 years or 96 years?

----------

## C1REX

 *NeddySeagoon wrote:*   

> 
> 
> So with saellavens use pattern, a 4bit cell drive would be expected to run about 100,000 hours and a 3 bit cell drive about 350,000 hours. 
> 
> At 10 hours a day, that's 27 years and 96 years before cell wearout.
> ...

 

The last sentence made me smile :)

I'm a regular person who just likes more. I don't need 3950x but I want one. I don't need or can afford a 3990x but also would love to have one :)

There is a huge gap in my life between what I need and what I desire.

----------

## Naib

My advice?  buy a cheap 100Gig SSD and use it for /var/tmp. Will it wear out? sure eventually just like a mechanical drive will break.  The key then is a sacrificial drive 

When I initially converted to SSD I kept a rotational drive for /var/tmp. When I rebuilt and went M.2 I used one of the old SSD for my /var/tmp

```

lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sda           8:0    0 238.5G  0 disk 

└─sda1        8:1    0 238.5G  0 part /var/tmp

nvme0n1     259:0    0 931.5G  0 disk 

├─nvme0n1p1 259:1    0   130M  0 part 

└─nvme0n1p2 259:2    0 931.4G  0 part /

```

at some point this ssd will fail and it will only be build errors not my data

----------

## NeddySeagoon

I have /var/tmp in RAM but thats getting to be a squeeze for a few packages now as my motherboard is maxed out at 16G RAM.

Build logs go to /var/log/portage, so I don't lose build errors at power off.

----------

## Tony0945

 *NeddySeagoon wrote:*   

> I have /var/tmp in RAM but thats getting to be a squeeze for a few packages now as my motherboard is maxed out at 16G RAM.

 

Building the Palemoon browser (takes 9G) and soon a few more on the Ryzen 2700X PC that I upgraded from 16 to 32G RAM along with it being about five times faster than the next best machine, a Phenom II maxed out with 8G RAM.  I believe you still have one of those also. 

I followed your advice on the forum and waited to buy the 2700X until after the 3000 series came out. That missed all the pain of the initial 1000 series rollout.

If I do retire the Phenom II this year, I'll wait until the 4000 series comes out, reportedly in mid-year, and buy a 3900X, maybe with 64G, more likely with 32G in two slots with two slots free.

Seems crazy after my first PC, a 486DX-100 with an amazing 16 Meg of RAM!

----------

## NeddySeagoon

Tony0945,

My Phenom II is maxed out at 16GRAM and creaking under the strain. Its also 11 years old in April and overdue retirement.

I have a Ryzen on my shopping list 'soon'.  I can't really justify a Threadripper and my budget won't stretch to a Power9 system.

I have not seen any arm64 boxes for sensible money either.  I'm not set on x86.

Building on a 96 core box shows that very few packages can use as many as 30 threads, so a 32 thread box is enough.

That indicates 64G RAM to start with.

A 32 tread Ryzen, on a motherboard that will take 128G RAM (or more) with 64G fitted looks like a good starting point.

----------

## Tony0945

 *NeddySeagoon wrote:*   

> A 32 tread Ryzen, on a motherboard that will take 128G RAM (or more) with 64G fitted looks like a good starting point.

 

Any ideas on a mobo? or at least a manufacturer?  I've mostly had MSI & Gigabyte but the recent sound fiasco leaves me sour on MSI, although BIOS upgrades are super easy.

Been looking at Gigabyte but they lean heavily to Windows, MSI is more OS agnostic. Reviews say the Gigabyte is more Intel oriented and their Ryzen boards are Windows-Centric.

Many swear by Asus, but it looks to me like you are paying for a name. But I'm drifting way off topic, should have posted this in a Ryzen thread.

----------

## C1REX

 *Tony0945 wrote:*   

>  *NeddySeagoon wrote:*   A 32 tread Ryzen, on a motherboard that will take 128G RAM (or more) with 64G fitted looks like a good starting point. 
> 
> Any ideas on a mobo? or at least a manufacturer?  I've mostly had MSI & Gigabyte but the recent sound fiasco leaves me sour on MSI, although BIOS upgrades are super easy.
> 
> Been looking at Gigabyte but they lean heavily to Windows, MSI is more OS agnostic. Reviews say the Gigabyte is more Intel oriented and their Ryzen boards are Windows-Centric.
> ...

 

I'm not an expert but on PC Builds YouTube channels and Reddit people recommend MSI Tomahawk MAX almost exclusively if going for b450 chip.

For more expensive x570 there is no simple pick but many recommend ASUS x570 TUF.

----------

## NeddySeagoon

Tony0945,

I've only used ASUS for years.

Knowing how hard a life the Vcore regulator gets, the determinant for me is what quality parts go into that.

I've seen poorer quality ones fail bun not since the time when the Pentium II was old.

I think thats the last time I chaged the caps too. :)

If you are building with an eye to the future,  you need the x570 chipset so you can have PCIe ver 4.

PCIe ver 3 will be fine today and probably tomorrow but what about the day after?

My spec so far is  

x570 chipset

High quality Vcore parts.

>=128G Max RAM.

32 threads

Lots of spare slots becaue I keep running out. 

That boils down to a high end Ryzen or a Threadripper of some sort.

The  Threadripper being a siamised Ryzen. provides more PCIE lanes.

----------

## C1REX

I've heard that ASUS TUF x570 gets the same vcore as the top end models. Some say that ASUS made a mistake with this board and the price is too low for the spec.

It wins in temperature tests in that price range.

I might be biased as I ordered one from Amazon. I like WiFi version with cabled antena for better reach.

----------

## NeddySeagoon

C1REX,

Wifi is an attack vector. The household Android devices will not be on the same network as our PCs

My paranoid firewall already blocks lots of attempts from them to phone home on strange ports for undeclared purposes.

----------

## saellaven

I went with an Asus Prime x570-Pro and have been very happy with it and my 3700x. It's been rock stable for me.

and the 3700x, compared to my old FX-8350 it replaced, is crazy fast with 8 cores/16 threads.

----------

## Tony0945

 *NeddySeagoon wrote:*   

> If you are building with an eye to the future,  you need the x570 chipset so you can have PCIe ver 4.
> 
> PCIe ver 3 will be fine today and probably tomorrow but what about the day after?

 

I had been planning on a B450 because I'm not a gamer and have no need for two video cards, but you raise a valid point about future peripherals.

Also I have been thinking of maybe needing lots of "rotating rust" for storage, perhaps RAID. The x570 would give more SATA ports.

I am planning on NVME for the system drive, although I'm pleased with the SATA SSD on my newest system.

----------

## Tony0945

 *saellaven wrote:*   

> I went with an Asus Prime x570-Pro and have been very happy with it and my 3700x. It's been rock stable for me.

 

I'm looking right now at (in order of increasing cost)

1) ASUS Prime X570P

2) ASUS TUF Gaming X570 Plus

3) MSI MPG X570 Gaming Plus

4) ASUS Prime x570 Pro

From least expensive to most expensive is a $100 range which is less than a dollar a month over 11 years (might outlast me!) which is nothing. Even amortizing over a year, it's negligible.

Major differences I see are the LAN chip, number of SATA's, and WOL. WOL not mentioned for your board, although it is the most expensive.

Cheapest board doesn't have as high a user rating.  Don't know about things like VRM's and Linux support for sensors. 

Did you go with yours for the intel LAN? I don't care about the pretty lights, it's a computer, not an art work.

I had a colleague that bought a few Asus. he could never tune the BIOS.

----------

## saellaven

 *Tony0945 wrote:*   

>  *NeddySeagoon wrote:*   If you are building with an eye to the future,  you need the x570 chipset so you can have PCIe ver 4.
> 
> PCIe ver 3 will be fine today and probably tomorrow but what about the day after? 
> 
> I had been planning on a B450 because I'm not a gamer and have no need for two video cards, but you raise a valid point about future peripherals.
> ...

 

The Prime x570 pro supports 6 SATA drives, has 2 M.2 slots, 2 PCI 4.0 16x slots (plus more PCI slots), supports 128 GB of RAM, a ton of USB 3.2 ports, etc. I picked it because of just how much life I think I can get out of it.

----------

## saellaven

 *Tony0945 wrote:*   

>  *saellaven wrote:*   I went with an Asus Prime x570-Pro and have been very happy with it and my 3700x. It's been rock stable for me. 
> 
> I'm looking right now at (in order of increasing cost)
> 
> 1) ASUS Prime X570P
> ...

 

I don't use it, but the Prime x570 Pro does support WOL.

I went with mine specifically for the features and how long I plan to have it for - I seem to get around 6-8 years out of my systems before I feel the need for a major overhaul (I may add RAM, more storage, upgrade the video card, but I don't see any pressing need to upgrade beyond the capabilities of a 3700x right now, so the core of this system will last a while).

And, while I sicken myself with this fact sometimes, I typically drop $30-40 a day on lunch for my employee and myself out of my personal pocket, so what's an extra $100 or so as a one time cost?

----------

## Goverp

My new box is a Ryzen 3900X in an ASUS TUF x570.  I chose that mb 'cos it was the cheapest one from my local supplier (i.e. a real shop, not mail order) that supports ECC memory.  IIRC, with 16 GB ram, you can expect 5 bits/hour flipped by cosmic rays.  OK, most of them will be 0's in unallocated or unused memory, but every so often one will be significant.

Having installed it, my first impressions are that it's well build and laid out.  If you're paranoid, you might worry that its BIOS can call home to download an upgrade.  I did that immediately after installing; in theory it will only do it when I ask, but well, for all I know, Crypto AG might own ASUS  :Smile: 

----------

## C1REX

 *Goverp wrote:*   

> My new box is a Ryzen 3900X in an ASUS TUF x570.  I chose that mb 'cos it was the cheapest one from my local supplier (i.e. a real shop, not mail order) that supports ECC memory.  IIRC, with 16 GB ram, you can expect 5 bits/hour flipped by cosmic rays.  OK, most of them will be 0's in unallocated or unused memory, but every so often one will be significant.
> 
> 

 

I already have the board and consider the same CPU. How long does it take for your system to compile popular big stuff? How much better is it vs your older setup?

----------

## Tony0945

 *NeddySeagoon wrote:*   

> Wifi is an attack vector. The household Android devices will not be on the same network as our PCs
> 
> My paranoid firewall already blocks lots of attempts from them to phone home on strange ports for undeclared purposes.

 

Scary!  I do leave the battery out of the control on my one Alexa-enabled Amazon Firestick and the Samsung "Smart" TV  is not connected to the LAN.

I use MAC address filtering although many people tell me that's useless.  The router has an internal timer for the wireless and I have it set to be active only during evening hours when we typically stream video. I have enough old PC's strewn around the house to not need wifi to connect to the internet. A minimalist Gentoo can at least turn a very old PC into a smart terminal. Really really old things like the k6-3 AT need an add-in card to get gigabit LAN but they are available new for what saellaven (and I) spend for lunch in a sitdown restaurant.

----------

## dimko

55gigs, ssd, as root, for god knows how many years.

Still is alive, swapped it for NVME for root. Planning to use it as swap drive.(yes, seriously, cause I need extra sata slot)

No indication of failure on it.

----------

## Goverp

 *C1REX wrote:*   

> ...
> 
> I already have the board and consider the same CPU. How long does it take for your system to compile popular big stuff? How much better is it vs your older setup?

 

I compiles kernel 5.5.whatever a couple of days ago.  "grep MHz /proc/cpuinfo" gave 24 lines of just over 4000.  (IIUC the TUF mb is set with mild overclocking by default.)  The old box had 4 lines of 1600.  That's 15:1 better.  The reality is probably in step with that; it tdok a minute or two, rather than around 30 mins.

I don't have the numbers to hand for firefox and qtwebengine, but I ran what amounts to "emerge -e --keep-going @world" producing 760 packages in I guess around 4 hours, though with a number of failures I've yet to revisit, using "-j12" and "--jobs 8 --load-average 24".  I'd started with "--jobs 3", but could see lots of idle processors in htop.

----------

## C1REX

 *Goverp wrote:*   

> ...

 

Do you have tmpfs set up?

https://www.reddit.com/r/C_Programming/comments/f2wowt/improving_compilation_time_of_cc_projects/?utm_medium=android_app&utm_source=share

Somebody shared this article and suggested that extra threads scaling is bad if not using RAM for compiling.

----------

## NeddySeagoon

C1REX,

There is little performance difference between choosing to use tmpfs for build space and not.

If you have that RAM for tmpfs, the kernel VM manager will cache everything and the disk writes will never be read.

tmpfs saves the writes. 

The write is a few CPU cycles setting up the DMA controller' and the memory bandwidth while the DMA transfer takes place. That's not a lot.

----------

## Goverp

 *C1REX wrote:*   

> 
> 
> Do you have tmpfs set up?
> 
> ...

 Not on the new box; the old one did, with package.env options to switch it off for certain builds.

----------

