What happens when a drive fails?

So my drive hasn’t failed or started to fail yet but I have a few questions.

  1. How to properly check for a failing drive?
  2. What do I do if my HDD starts to fail/has failed?
  3. Can the data be transferred from a dying drive to a new working one?

This next one is a bit confusing but I will describe it the best I can.
4. If the drive is failing, can it be replaced with a new drive of the same identity, start accepting data to the new drive and THEN manually copy over the old data from the dying drive to the new drive?

You can use smartmontols to see some warning signs, but generally it’s impossible to predict drive failure

You can stop the node and clone the drive to another drive

Yes, see the manual How do I migrate my node to a new device? - Storj Docs

No. You need to do it the other way around – first copy bulk of data, then stop old node, sync differences, and then start migrated node. See link above

You may check its S.M.A.R.T. from time to time, it’s a good way to get aware of the expected failure.
If the disk would start to lose data, you better to migrate it to a new drive and perhaps do this offline so as not to increase the load on the failing disk. You can be offline up to 12 days before suspension, the online score will recover in the next 30 days online.
If the node would lose more than 4% of stored data, it will be disqualified.

no, if you start the node with the same identity but without data, it will be disqualified for lost data.
So you need to transfer all data to a new drive before you bring it online on a new drive. But you may transfer the data to a new drive while the old one is running, but in the case of a failing drive it could be dangerous, because it will increase the load on the already failing disk.

So how would I transfer all data, while offline, to a new drive? Got to copy identity too? Clone the drive?

Thank you for this information.

If the drive is close to full, cloning is preferable—will be faster and you can use recovery tools like ddrescue.

If the drive is close to empty, copying files will be faster.

Yes, you have to preserve the identity. Without the identity the node cannot present itself to the satellite, and so satellite would not know what data the node is expected to hold. Identity files are small enough to keep a backup on other media, and this is a recommended action to take.

1 Like

Smartmontools returns the following error when running this command:

sudo smartctl -a /dev/sdb

Read Device Identity failed: scsi error unsupported field in scsi command

A mandatory SMART command failed: exiting. To continue, add one or more ‘-T permissive’ options.

The drive is a 16TB external Seagate drive connected to a pi4 through USB3.

You would need to remove the disk from the enclosure and connect to the PC via SATA, or use better usb to sata enclosure; cheap USB enclosures don’t support SMART and many other features. Adpaters on VIA chipsets, like VL716 tend to work, some popular ASMedia based ones (forgot the actual chipset name), including early revisions of StarTech cables — tend not to.

Btw if you get such cable/enclosure, and decide to connect it to pi— either use USB2 ports or disable would likely need to use usb-storage.quirks to disable UAS.

Do you mean this? I found this article on something relative to what you mentioned: Getting SMART information from a Seagate Expansion Portable drive – Lennart's weblog

These enclosures are rebrands of cheap Chinese bottom of the barrel crap. In particular, Ugreen brand specifically tends to be most overpriced and worst engineered garbage. But I digress.

What does lsusb report?

The trickery disabling UAS to make SMART work not always works, but you can try. It’s a good idea to disable it anyway on RPi4.

You would need to take vendorID:deviceID as reported by lsusb, remount boot volume as read/write sudo mount -o remount,rw /boot and add usb-storage.quirks=<vendorID>:<deviceID>:u to first and only line in the /boot/cmdline.txt

1 Like

I am sorry, I just realized that I am not currently using the UGREEN enclosure one this HDD, that is for the other one. The drive I am using is an external Seagate expansion drive: Seagate Expansion Desktop Hard Drive 16TB External - Newegg.com

Doesn’t matter :slight_smile: There are just a handful of chipsets with handful of firmware versions around. The approach is the same regardless of the wording on the box

1 Like

And seems, this is no go anywhere, until they connect a HDD to the motherboard via SATA…

You can try:

smartctl -d sat -a /dev/sdX
smartctl -d ata -a /dev/sdX

See smartctl -h for the options.

Okay so what would be the best way to connect 4x or more 3.5" HDDs to a pi 4b via SATA?

You need to Google it, we do not suggest any hardware.
I found an extension board only for one 3.5" HDD: For Raspberry Pi 4, X832 V1.2 12V 3.5 inch SATA HDD Storage Expansion – Geekworm, and some DIY Raspberry Pi 4 as a NAS or personal cloud server? - Raspberry Pi Forums.
For me it looks like there is no robust solution for that and you will be forced to use an external USB enclosures with the external power supply.

Yeah, I found these same results, I don’t like them so I guess I will stick to what I have.

wich is physically an usb adapter without case.

thats recommended,
16 tb is a long way to fill up.