Is RAID1 over USB Reliable?
from anon2963@infosec.pub to selfhosted@lemmy.world on 25 May 2024 06:10
https://infosec.pub/post/12790091

I have an 11th gen Framework mainboard which I would like to repurpose as a server. Unfortunately, (unless I do some super janky stuff) I can only connect 1 drive to it over M.2 and any additional ones must be over USB.

I am thinking of just using some portable hard drives and plugging them in over USB. I plan to RAID1 them and use them as boot drives and data storage, and use the M.2 slot for something unrelated.

In your experiences, is USB reliable enough nowadays to run a RAID array for a server like this? If it is, does it depend on the specific drive used?

#selfhosted

threaded - newest

Ebby@lemmy.ssba.com on 25 May 2024 06:28 next collapse

In my experience, noooooo.

I’ve had too many momentary disconnects with USB devices to trust that on a 24/7 server.

An early server I built had a large USB backup drive for a RAID5 array and every month there was usually something that went wrong.

Untitled4774@sh.itjust.works on 25 May 2024 07:16 next collapse

Agreed. You’re at the mercy of your USB controllers as well as southbridge in that case.

You’re adding more things that can go wrong.

Generally HBA/RAID cards are usually built for enterprise rather than consumer so they’re usually more reliable as well.

narc0tic_bird@lemm.ee on 25 May 2024 12:58 collapse

Today’s CPUs usually expose some USB connections directly. Ryzen 7000 desktop CPUs expose 4 USB 3.2 Gen 2 directly on their on-package I/O die for example. So if you connect your USB drives directly to the ports your mainboard connects directly to the CPU, the chipset (“southbridge”) and any third-party USB controllers are out of the equation.

This is just information, I’m not advising to use USB for fixed storage.

ripcord@lemmy.world on 25 May 2024 16:37 collapse

I’ve been doing USB with raid on several servers for 10 years. No random disconnects.

lud@lemm.ee on 25 May 2024 19:47 collapse

Why though?

ripcord@lemmy.world on 25 May 2024 20:58 collapse

Because I have a total of 28 drives and it works really well and is flexible.

12 of them are in a Synology though

lud@lemm.ee on 25 May 2024 21:08 collapse

Sata extension cards aren’t expensive you should know.

[deleted] on 25 May 2024 22:49 collapse

.

Maxy@lemmy.blahaj.zone on 25 May 2024 06:38 next collapse

I’ve been running some external drives on my server for about a year now. In my experience, hard drives with an external power supply suffer less from random disconnects. The specific PC also makes quite a large difference in reliability. My server is just a regular desktop and has very little problem staying connected and powering my 3 external drives. My seedbox is an old laptop, and has been having almost constant problems with random disconnects and power issues. Maybe test how well your framework does with some external drives before committing to the plan?

lemmyvore@feddit.nl on 25 May 2024 06:38 next collapse

The big factor is the chip make in the USB enclosure/adapter. Realtek is most reliable, followed by Asmedia. JMicron is garbage (will get hot and drop connection).

What’s your goal by using RAID1? Do you really need redundancy — keep the system alive if the main drive good down?

If you only need backup then you don’t need RAID, and that should fare much better — just take an incremental snapshot to the USB drive periodically and let it sleep the rest of the time.

infeeeee@lemm.ee on 25 May 2024 06:40 next collapse

There should be an m.2 port for the wifi chip,you can buy sata expansion cards there, sthg like this:

<img alt="" src="https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.iocrest.com%2Fdata%2Fupload%2Fimage%2F20200901%2F1598959087400112.jpg&f=1&nofb=1&ipt=704f774fd54e19a6cbadc803092ccd26a35c46e2c13d4df8f3b1752bad053740&ipo=images">

Search for “m.2 key e sata”. Use wired net on a usb dongle, if it doesn’t have an ethernet port

machinin@lemmy.world on 25 May 2024 07:51 collapse

Any way to power the drives if you don’t have any more free power cables? Just have to buy a new PSU?

peregus@lemmy.world on 25 May 2024 08:17 next collapse

You can find an external SATA power supply

atzanteol@sh.itjust.works on 25 May 2024 11:16 collapse

You can get splitters for power cables.

ElectroLisa@lemmy.blahaj.zone on 25 May 2024 18:37 next collapse

Friendly reminder: Molex to SATA, Lose all of your data

catloaf@lemm.ee on 25 May 2024 19:16 collapse

Molded plugs are dangerous, crimped plugs are fine.

…linustechtips.com/…/molded-sata.png.a8f706c9da7d…

machinin@lemmy.world on 26 May 2024 12:58 collapse

Thanks, bought one!

Theoriginalthon@lemmy.world on 25 May 2024 07:39 next collapse

I did see a m.2 based expansion card based on ASM1166 chipset, or failing that a sata port multiplier, but those depend on the data port supporting it

Decronym@lemmy.decronym.xyz on 25 May 2024 08:25 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
NAS Network-Attached Storage
PSU Power Supply Unit
RAID Redundant Array of Independent Disks for mass storage
SATA Serial AT Attachment interface for mass storage
ZFS Solaris/Linux filesystem focusing on data integrity

[Thread #760 for this sub, first seen 25th May 2024, 08:25] [FAQ] [Full list] [Contact] [Source code]

TCB13@lemmy.world on 25 May 2024 09:17 next collapse

Well, nothing is reliable over USB type A. If you don’t want to DIY you can get a USB JBOD with type-c like this one or that one or this cheaper one. They’ll get the job done for a price. :)

However, there are easy ways to get reliable SATA ports from m2 slots that your framework has. NVME to 6 SATA ports: www.aliexpress.com/item/1005004263885851.html

To power the disks you can use ANY standard ATX power supply (get something brand-gold second hand for 20$). To make sure the PSU stays ON, just plug a wire between the green and any black wire.

Another option for power is to get a cheap 12V power supply and a step down DC/DC to provide 5V. If you don’t have it a SATA cable like this is helpful. Simply cut the white plug and attach the red cable (5v) to the output of the DC/DC and the yellow one (12V) directly to the power supply.

There’s also these dual output power supplies that you can regulate to 12v+5v but frankly I would just go for the option above as it will be safer.

Make sure you check every voltage and polarity before plugging anything into your power supply!!

Paragone@lemmy.world on 25 May 2024 11:28 next collapse

USB-storage isn’t reliable.

Period.

ANY fscking thing that bumps any connection, can break the dam link.

Then your kernel can re-label the device when it re-connects,

and you’ve got to reassemble your RAID.

just my experience.

use ANY other method you can, other than USB.

stick a SATA adaptor on there somewhere, if you can.

Get a different motherboard.

ANYthing, but not USB.

exscape@kbin.social on 25 May 2024 12:35 collapse

Always use /dev/disk/* (I use by-id) for RAID, as those links will stay constant even if a disk is renamed (for example, from sdb to sdd).

hperrin@lemmy.world on 25 May 2024 11:44 next collapse

You should probably only do this if you’re using an enclosure that connects all the disks over a single cable. That way if it gets unplugged or otherwise disconnected, all the disks get disconnected, and they remain in sync. Otherwise, get very familiar with resyncing drives.

dhhyfddehhfyy4673@fedia.io on 25 May 2024 13:10 next collapse

You are quite likely to regret going down this route. Should do what you have to to get the drives properly connected.

Nomecks@lemmy.ca on 25 May 2024 13:52 next collapse

Erasure coding may be a better option than RAID.

Ferawyn@lemmy.world on 25 May 2024 14:37 next collapse

No. USB is not designed to be reliable. It’s designed to be plug and play. Don’t plug and play with your data.

Saik0Shinigami@lemmy.saik0.com on 25 May 2024 15:55 next collapse

Plug and play alone is not the reason. Nvme is plug and play.

ripcord@lemmy.world on 25 May 2024 16:35 collapse

Plug and play is not any reason at all.

catloaf@lemm.ee on 25 May 2024 19:14 next collapse

Plug and play means you don’t have to fiddle with drivers or IRQs or whatever.

the_third@feddit.de on 25 May 2024 23:29 collapse

That sentence does not make any sense whatsoever. SATA and SAS are hot pluggable as well.

possiblylinux127@lemmy.zip on 25 May 2024 15:11 next collapse

I have minipc that only has one drive slot. I use an external thunderbolt enclosure with a eNVM drive in it

It works ok for me but don’t expect great performance and reliability.

0000@lemmy.world on 25 May 2024 15:20 next collapse

I do not recommend it. I ran two USB hard drives for over a year in BTRFS RAID1, and I had millions of errors repaired every month when I scrubbed it.

conrad82@lemmy.world on 25 May 2024 16:35 next collapse

I am using a terramaster d6-320 connected with usb-c.

It has been running zfs disks for proxmox via a geekom a5 mini pc since February. It has lost contact with the drives twice so far, more than a month between each time so I don’t know the cause. I am mostly happy with the setup, but of course it is annoying when it fails

possiblylinux127@lemmy.zip on 26 May 2024 01:10 collapse

Check the kernel logs

NaibofTabr@infosec.pub on 25 May 2024 19:34 next collapse

I plan to RAID1 them and use them as boot drives

This will not work unless the mainboard is handling the RAID control in firmware. If you are doing software RAID then the OS must boot before the array can be accessed.

If you just want to set up a NAS, you can get a used PowerEdge tower for very little money, and it will work a lot better than what you have planned.

possiblylinux127@lemmy.zip on 26 May 2024 01:09 next collapse

This isn’t true. You can boot from raid without issue.

anon2963@infosec.pub on 26 May 2024 14:10 collapse

In the past I have used Proxmox with ZFS raid on a basic mini PC. With ZFS raid it syncs everything except /boot. Proxmox has a tool called “proxmox-boot-tool-refresh” which will syncs /boot between drives. ZFS kernel module can be loaded in the initramfs so it will boot fine, even if missing a drive.

For this project I do not plan to use ZFS, but AFAIK software raid is now standard. Here is a popular video from Level1Techs talking about the flaws of hardware RAID: youtu.be/l55GfAwa8RI

PipedLinkBot@feddit.rocks on 26 May 2024 14:10 collapse

Here is an alternative Piped link(s):

https://piped.video/l55GfAwa8RI

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source; check me out at GitHub.

Shimitar@feddit.it on 26 May 2024 07:34 collapse

Been running raid1 on USB for over a decade. Avoid chaeap USB stuff, get foot brand USB boxes and preferably a JBOD multi-disk enclosure, since they tend to be the best quality.

Never had a disconnect.

Beware to properly label your driver tough, as Linux software raid (I use that) tend to hiccup on boot if the kernel reassign USB devices after a reboot.