Pi as main storage and server.

Sep 29, 2023 Last reply: 2 years ago 44 Replies

Currently my house server is x86, linux and mostly standard Linux Mint.



It is power hungry and old and runs a 2TB SATA drive as its main data store and a 4TB SATA drive as its backup area, and a repository for un-backed up videos



The drives are western digital 3.5" SATA



WDC WD20EFRX-68EUZN0 (82.00A82) WDC WD40EZRZ-00GXCB0 (80.00A80)



It probably doesnt need that much.



Totting up the partitions its only 2.6TB total. of which 1.6TB is simply videos that dont really need backing up at all



What I would like to do is have something that boots faster after a power cut, has far lower power consumption, and if it cant use the SATA drives has something reasonably cheap to replace them with.



I think a 2TB + 2TB setup is more than i need, 2 + 1 more than adequate probably.



So some of the known unknowns are:



1/. How much power is used by the spinning rust, when most of the time its idle? I find three figures quoted, active, idle and sleeping. Around
6-7W active and a couple of watts spinning
2/. How does Linux (Mint) operate disks which are seldom accessed?
3/. What is the power consumption of a typical SSD? I have seen figures as low as 50mW idle. And a couple of watts on read /write
4/.
How could I connect any disks that are not USB, to a PI?

I've looked at the current hardware and its basically



Intel® Core™2 Duo CPU E6850 @ 3.00GHz × 2 - about 75W!!! GeForce 210/PCIe/SSE2 which is another 25W or so, so it looks like that combo is dominating the power draw stakes.



Currently UK electricity is around £0.35p a kWh, so an annual consumption is roughly £3 per watt per year.



Saving 100W would net me £300 a year electricity savings (well almost - the server is a great room heater in winter)



Disk speed is essential to have except for booting. As I mentioned fscking a big server after a power cut is a long process. I'd probably boot off an SD card and mount something else for everything that moves so to speak. So USB interfaces to the SATA drives would probably work.



CPU power is not an issue. I could probably do this with a Pi Zero+Ethernet or an early Pi with onboard. I only have a 100Mbps switch, so networks speeds are not massively needed to be high.



I am guessing that for spinning rust drives, a powered USB hub plus USB to SATA cables would work?



And might be enough to power a Pi as well?



I am not au fait with powered hubs, and what powers what in the case of usb ports that are connected together both with power.



Having looked at the actual power figures I am leaning towards - as a first step, t any rate - simply trying to use the disks but dump the motherboard and graphics board and the PC case - or at least use them for something else on a more occasional basis.



Conceptually that would mean a powered hub, two USB to SATA cables, and an Ethernet equipped PI with at least 2GB RAM - it is nice to sometimes run a GUI on the server, though if I dumped that probably 512M would be enough. It looks like a zero with an ethernet + 3USB hat would do the job cheapest...



What have I misunderstood/forgotten?


...

For some data points, I have a couple of HP Gen7 microservers. I think they take sub 20W on their own.

Box A (N54L) has 6x 3.5" HDD, an HP RAID card and a USB 3 card. Takes ~100W idle.

Box B (N36L) has 4x 3.5" HDD, a DVD burner and no PCIe cards. Takes ~40W idle

So looking at box B we might budget about 5W per drive. I'm not sure where the watts go: in one of them (don't remember which) there's an 80Plus bronze Seasonic PSU, but maybe the HP PSU in the other one isn't so good.

Depends on the FS, but it shouldn't use them if not accessed. One thing to watch is for software that does background indexing to make file searching faster - one such is 'xapian'. I never use desktop search (just 'find' and 'grep') so I turn this off.

Sounds plausible. If it's idle it's doing nothing really.

Either a USB-SATA adapter. Or PCIe - the Pi 5's PCIe lane looks promising for a future PCIe SATA HAT. Going direct to SATA from PCIe is more robust than going through $5 Chinese USB-SATA adapters.

On the Pi 5 each USB port has dedicated bandwidth, whereas on the Pi 4 they are shared. HDD won't saturate a USB3 port, but SSD will.

Yes.

If the PSU is big enough, don't see why not. Although the hub may limit the output power on a given port.

Depends on what the Pi does for power routing, I'm not sure about current versions.

Have you considered just getting a big SSD? A 4TB Crucial P3 M.2 NVMe is £150, a Samsung 870 QVO SATA is £168:

formatting link
Or similar for multiple smaller drives.

Then use a SATA to USB or NVMe to USB dongle. Or a CM4 or Pi 5 with an M.2 HAT.

You can't fit USB 3 to a Pi Zero, so you'd be limited to <60Mbytes/s on the single USB 2, and that would be shared with the ethernet too. Pi 4, CM4 or Pi 5 are the only sensible platforms if you want decent bandwidth.

I think the Pi 5 is looking as an excellent platform for this sort of thing

- they've finally ironed out the I/O quirks of the earlier models, and PCIe is attractive. The PCIe HAT ecosystem hasn't developed yet, so I might be tempted to postpone this for a few months and see what happens - or think of a stopgap solution.

Theo (who is thinking of replacing the Microserver motherboard with a Pi 5 + SATA HAT when such appear)

Biggish USB3 SATA drive(s) for now, later get an M.2 hat for faster NVMe boot drive?

I think it's a good plan for a NAS to separate the boot drive from the data drives. So whether you do that with an SD card or an SSD is up to you, depends on what you're going to use it for.

You could use a USB SSD for boot drive, and then an M.2 for a data drive, as another possibility.

Theo

Ah Theo, excellent and well appreciated comments. I dont need speed. But looking at a Pi Zero +ethernet hat +USB extenders, you make the point that it all goes over the one USB connector and not a fast one at that.

The question is, is that actually more than good enough anyway?

In most use cases I will be backing up from the Internet at 5MByte/s max, or serving data over 100Mbps (12.5MByte/sec) Ethernet, so at first glance it looks like its not a serious issue, although the sharing of the same bus between ethernet and disk does raise some question marks .

I.e can a USB2 bus support reading off a disk and pumping out to a network simultaneously at 100Mbps?

I have discovered that there exist *powered* usb to SATA *cables* that run off 12V and those would work OK . I could hack them to run off an old PC case+PSU I have that would also be a decent cradle for the SATA drives.

The problem is a PI 4 or 5 costs more than a Zero, plus ethernet/USB HAT and yet still cannot power a 3.5" spinning rust drive over its USB.

I get would CPU memory and bus speed that I may actually not need...My current RAM usage WITH Mate and X-Windows is only 650Mbyte. If I went headless I doubt that it would be much greater than my ZERO W at 55MBytes

As far as SSDs are concerned, *once booted* I don't have any speed issues with my existing rust. They remain a 'nice to have one day' option

I can't comment on the simultaneously question - I'm sure there's info about that out there - but what would irritate me is that disk speed *inside* the box would also be slow. eg if you wanted to copy something from disc 1 to disc 2, that's subject to the USB2 bottleneck (~25Mbytes a sec after USB overhead and because you have to transfer the data over USB twice). If you're searching files, you need to pull them all over USB 2. And so on.

Once you start going multi-TB, at these speeds jobs start stacking up into the hours or days, and that gets irritating.

You didn't mention cost concerns, beyond being saving your electricity bill. Up to you, but any Pi is going to buy you a big saving in electricity every year. How much price/performance you want at this point is your choice. But the delta to get much better performance is not huge.

No 3.5" USB HDD is powered from its USB, since they need 12V. They all have external PSUs. A 2.5" HDD can run from 5V USB bus power, but not 3.5".

Your existing rust is likely on 6Gbps SATA3, and you're proposing going to something 12-25x slower (although the HDD likely can't saturate SATA3 for long periods so it's not quite so bad). Your decision whether that matters to you.

Theo

Ah, right. Yes that's a case I didn't cover. In my application, which has evolved over the years, that is simply a rsync backup - one disk is simply there in case the main disk suffers hardware failure and is based on bad experiences from running servers over the years - that disks used a lot fail. Especially if subjected to flaky power and disks used less dont.

The cost of a second disk that only gets activity once a night during backup is a lot less than a UPS and is the only thing that will protect against a drive that dies from old age to the point of unreadability.

It doesn't have to be fast

E.g although I back up TERABYTES, typically backing up the changes only takes less than two minutes

Well yes, to fully restore a backup drive when the last one failed took about 5 hours

But that is a very rare event

I fully agree with THAT, but the point really is what is the point of performance I never use?

My desktops need the power far far more than the server. They are my compile engines and where I process video files etc etc. You don't buy a Ferrari *just* to go to the supermarket...

Ah, ok . Hence the 'powered adapter' . It all begins to make sense.

I think they are in fact 3GBps SATA 3 - I cant remember which mobo is in there - I think I got given that mobo and case for nothing as it was a trade in on an early winXP machine :-) - but all the boads I have saved data on are 3GBPs SATA 3

It's cost me more in electricity than it ever did to buy

But the disks are: "Maximum interface speed 600 MB/s Maximum buffered read speed 428 MB/s Maximum read speed 197 MB/s"

Is that bytes/second or bits/second?

Which again shows the pointlessness of high speed connections to bottlenecks :-)

Although I DO take the point that if that is the raw disk speed going down to a 64MB/s shared USB2 bus is pretty crap

Well nothing short of a Pi 4B has USB3 does it?

Hence why you think it would suit.

Out of stock at my usual vendor, but price is not so bad

Could double as a wifi access point, too. :-)

Hmm. On balance that is so little more than a zero with hat its probably worth it

If I can get a 1GB model cheap

Thanks for the thoughts

2.5" HDDs - not always true. I had a 4Gb Seagate the ran fine from USB on a Pi3B. When I changed to a 5Tb WD, I had to add in external power (via a Y-cable).

I feel that the Pis power supply limits to its peripherals are one of its most poor features. One feels one ought to be able to bang a 50W psu on a pi and not have issues

Especially if you use one of the 15Krpm screamers made for high performance storage arrays just before NVMe SSDs took over.

It *can*, but not all USB ports have enough bus power. In that case you need a powered hub to provide more bus power.

Point being a 3.5" *can't*, because they use 12V power and USB hubs don't provide that (maybe a USB-C PD hub could, but I doubt any HDD are built that way).

Theo

Beware if you use a powered hub. My Pi 4 refuses to boot (it hangs before even displaying anything on screen) if I have a powered USB hub and HDD connected to it, and the Pi, hub and HDD are powered on simultaneously (eg when power is restored after a power cut). If the hub and HDD are powered on first, and the Pi 4 a couple of seconds later, everything is fine. My older Pi 3 did not have this problem.

I had to change to a powered USB/SATA caddy and a SATA drive, rather than a powered USB hub and a USB HDD.

Someone suggested that the Pi 4 didn't like the +5V line of one of its USB ports being powered by an external source, if the hub feeds power

*upstream* to the Pi as well as downstream to the HDD. But that doesn't explain the exact opposite which is what I see: the hub *not* being powered at boot time. I did try making up a special USB cable with its +5V line cut, but that did not help.

It was definitely an interaction with the hub, because if I plugged the USB HDD directly into the Pi (*), or if I didn't plug the HDD in at all, with an auto-mount command in /etc/fstab in both cases, it worked fine. I suspect it was a hardware problem, long before Unix tried to mount the drive.

(*) Don't do that as a long-term solution: the Pi runs *very* hot if you try to power a spinning HDD from its USB ports. I found that out...

They require a lot of power to spin up. That pretty much dictates they cannot be powered from the rPi USB, even a 2.5" hdd requires a separately powered USB to SATA connector.

I assume it spins them down. I've been abusing a laptop 2.5" hdd for years, mainly used to write rsnapshot backups.

It's low enough, not to matter.

AIUI spinning rust does not use a huge amount of power normally, when spinning, but does require a lot of power to spin up. There was some discussion of an SSD and HDD being equivalent power for constant access, I'm not sure if I believe that, but whatever it is only a few watts. SSDs are clearly more power efficient for occasional access.

I have used a rpi4 as a NAS since a couple of weeks after it was released. It is surprisingly unproblematic. I use SAMBA. I did remote desk benchmarking, showing I was getting 80 or 90% of the 1Gb/s network speed.

I've used various USB2SATA cables. Unpowered for only SSD, powered for HDD.

Currently, I'm using this:

formatting link

Supposedly handles 3.5" hdd (although I use 1 ssd + 1 2.5 hdd)

In the past I used

formatting link
formatting link

My rPi4 does boot slowly, off SD, but I have 5 docker containers running on it as well as the NAS, including CCTV.

100Mb/s is slow for disk access. 1Gb/s switches are dirt cheap, and a modern one will also be lower power.

Does 3 years and counting of 24/7 mean I've killed my Pi :-) My Pi powers a USB connected 2.5 spinning disk just fine.

Is your Pi in a case? Mine is, in a case without a CPU fan, which will limit the cooling from the heatsink a bit. I stopped powering the HDD from the Pi when I smelled hot plastic case... Admittedly the Pi and the disk are kept in a cupboard of a cabinet on which the TV stands, so the enclosed space in the cabinet gets a little bit warm.

With the HDD powered by a USB/SATA caddy adjacent to the Pi in its case, the Pi's CPU runs at about 60 deg C. Not sure what it got up to when the HDD was powered by the Pi.

I have/had something similar. However the computer I use is a Fujitsu Esprimo P9xx which consumes only around 15 watts when idle. If you shop around and look at the 'Energy Star' listings you can find even lower power 'desktop' machines nowadays. Some of the newer Fujitsu machines use less than 10 watts and yet have all the things you want like NVME disk drive ability, SATA, etc. You also get a box to put it all in! :-)

I currently have an external 8Tb USB3 drive which powers down when idle.

I have several Raspberry Pis but I don't think they make particularly good NAS/Backup machines.

...oh, almost forgot, you can get refurbished Fujitsu Esprimos (lots of different models) quite cheaply.

Yeah. In my case further acquisition of Knowledge™ has made the question redundant. You can't apparently run (bare) 3.5inch drives off *just* USB because they need 12V.

There exist USB to SATA cables that take a 12V power source. And that looks to be a simpler solution.

I think the answer would be 'it depends on the drive and if linux is configured to spin down on idle' . You are in effect powering an electric motor and the more friction there is and the more rpms you want it to do. in general, the more power it will need

..

Ah, that caddy looks neat. ..

Not a 1U rack mounted 16 port one. And not sure the house wiring is up to it! It is on my list of 'nice to haves' if i can come up with a decent cheap one

But its not a crashing essential - i can play HD videos OK over the network and that's the fastest transfers I normally do...

>

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required