this post was submitted on 17 Feb 2024
1 points (100.0% liked)

Self Hosted - Self-hosting your services.

11391 readers
2 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 3 years ago
MODERATORS
 

I have a disk for local backups (that is the only purpose of that disk). I was wondering what would make it last longer:

- Keep it mounted to my server permanently (current solution)
- Keep it unmounted most of the time, mount it when I'm going to do a backup (either daily or every 3 days, I don't mind changing that) and unmounting after the backup is done.

What would be the best strategy?

cc @[email protected] @[email protected]

top 7 comments
sorted by: hot top controversial new old
[–] [email protected] 0 points 8 months ago

If you want your hard drive to last, it's important to reduce spin-ups/spin-downs. Mounting isn't really important.

It may be tempting to save power by spinning down your disks the moment they're no longer mounted (which some disks do by themselves, though that can often be turned off). However, keeping the disk going between writes may actually be beneficial for its service life.

I think you won't ruin your drive by spinning it up daily. Mounting and unmounting aren't direct causes for the drive to spin up/down, though, this is normally based on simple activity. For this reason, it's probably best to write your backup scripts in such a way that once the backup starts, there's always something to write to disk. Don't touch a file to start the backup, then do a deep folder scan, then start copying, then stop and do another scan, but scan once and do a long copying operation, especially if you've bought one of those "power efficient" drives.

It'd be wise to make your backup disk redundant. In a perfect world, you have three copies of each file, spread across at least two physical locations. In the real world, that would probably translate to "back up to a file and then upload a(n encrypted) copy to a cloud server". Don't just backup to a local NAS, because when your house burns down, your server and your NAS will both be gone.

If you don't want to bother with cloud servers (i.e. when your internet has a data cap), I would recommend adding redundancy by using multiple hard drives in a RAID configuration, so that when your drive does die, it won't take all of your data with it. If you do set up RAID, it's worth ordering the drives from different stores to try and get drives from different batches. Drives produced in a single batch have an annoying tendency to die around the same time, so when your drive eventually dies, a drive from the same batch my die before you have a chance to replace the broken one and get your RAID array back to full reliability.

[–] [email protected] 0 points 8 months ago

Mounting or unmounting a filesystem won't make a difference for drive longevity.

If you want to keep your backups secure, you want to keep them offline, so if you get ransomware it doesn't encrypt your backup too. (Or if you just mistype a command and target the wrong device, folder, etc.)

But drive motor starts and stops are when the most failures occur. So the ultimate question isn't how to make a drive last longer, it's how you plan to handle it when the failure inevitably occurs.

[–] [email protected] 0 points 8 months ago

I don't think unmounting in itself does any difference to it's longeviy. I think what you want is powering it down.

[–] [email protected] 0 points 8 months ago

Hmm. I unmount mine to reduce noise. Didn't think about endurance though, curious to see opinions too.

[–] [email protected] 0 points 8 months ago (1 children)

Longer lasting I think; leave it powered on and warm.

Best in reality; buy 3 drives, and after you do a backup move one off site.

3-2-1-1

[–] [email protected] 0 points 8 months ago

100% this. If we're talking about a mechanical drive, you want to minimize the state changes it goes through. So leaving it powered on all the time and spinning is the best. There's data centers with old computers that engineers are afraid to turn off cuz they're not sure they'll turn back on.

[–] [email protected] 0 points 8 months ago

@alvaro @selfhosted @selfhost

How many hours do the specs say it last?