USB3 Boot Hard Drive Corruption Issues

Having issues with your DietPi installation or found a bug? Post it here.
in03
Posts: 7
Joined: Sun Aug 08, 2021 2:19 pm

USB3 Boot Hard Drive Corruption Issues

Post by in03 »

Hey guys!

Long time desktop Linux user, fairly new to Raspberry Pi and DietPi.
Really thankful for all the effort you guys have put into this distro!

I've got a RPI 4 8GB I'm using as a home server and I've been keen to get it booting off USB instead of SD card.
So I bought a 1TB Crucial MX300 SSD and a cheap unpowered Wavlink USB3 enclosure from Amazon. It's booting fine, but I seem to be running into occasional issues with corruption and I'm not entirely sure what the cause is.

Today I was mid-way through building offline Mimic TTS for Mycroft (which I know is a bit of an intensive process) and it suddenly failed, spitting out errors. When I tried to diagnose over SSH I was greeted with "input/output error" for every bash command. When I went to look at the Pi's display, it was riddled with EXT4 read errors - I can't quite remember now the exact error, but if it happens again I'll make a note.

I've since run fsck on the drive and it seems to be up and running with no dramas. I have a PlayStation 3 Eye that I'm using as a mic for Mycroft and a camera for MotionEye and I noticed that I'd get those same EXT4 errors on boot if the PS3 Eye was plugged in. I unplugged it and had no issues with booting or corruption until today, when I decided to get Mycroft up and running again and plugged it in.

My best guess is that maybe I'm maxing out the Pi's power output? I am running it off the official power supply though.

I haven't seen to many other forum posts or videos of others complaining about compatibility or corruption issues with certain drives, so I've just assumed that my drive enclosure is working fine.

Any ideas or similar experiences would be much appreciated!
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: USB3 Boot Hard Drive Corruption Issues

Post by Joulinar »

Hi,

First thing, don't run the external disk unpowered. We always recommend to use an own power supply for USB disk. Otherwise it could lead to under voltage issue and data corruption in the external disk

You could have a look to kernel error messages as follow

Code: Select all

dmesg -l err,crit,alert,emerg
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
in03
Posts: 7
Joined: Sun Aug 08, 2021 2:19 pm

Re: USB3 Boot Hard Drive Corruption Issues

Post by in03 »

Thanks for the reply, Joulinar

The only error dmesg brought up was:

Code: Select all

vc4_hdmi fef00700.hdmi: Could not register sound card: -517
I have been running for a good 12 hours since the crash though. If it happens again I'll run dmesg sooner.
Thanks for the tip RE external power. I've got a desktop drive enclosure I can try, just not a snug-fit for the 2.5" drive. If it seems stable I'll get a proper enclosure.

Will keep you posted!
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: USB3 Boot Hard Drive Corruption Issues

Post by Joulinar »

From our experience, such issues are gone in most cases while the external disk was powered in addition. Let's see how it's going for you.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
in03
Posts: 7
Joined: Sun Aug 08, 2021 2:19 pm

Re: USB3 Boot Hard Drive Corruption Issues

Post by in03 »

Hi guys,

Sorry for the delay.
I tried my externally powered enclosure (Seagate Expansion 16TB with the drive swapped)
Unfortunately I get a kernel panic error:

Code: Select all

VFS: Cannot open root device "sda1" or unknown-block(0,0)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) 
Is this a driver issue perchance?
I can see the partitions on both my PC and Linux machine.

I know my current unpowered enclosure works, besides the presumed low-power corruption issues, so my current thinking is to get a USB 3 micro 'Y' cable and plug the powered cable into a decent USB phone charger. Any perceived problems with this? Or recommended powered drive enclosures?
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: USB3 Boot Hard Drive Corruption Issues

Post by Joulinar »

hmm there could be some corruption on the disk. Therefore the system is not able to boot. The 'Y' cable should be fine. We had another user who could solve his voltage issues with such a cable.

@MichaIng could you have a look pls
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
in03
Posts: 7
Joined: Sun Aug 08, 2021 2:19 pm

Re: USB3 Boot Hard Drive Corruption Issues

Post by in03 »

Ahh, sorry I should've been more clear. After receiving that mount error I popped the drive into the unpowered enclosure and it worked just fine. I didn't run fsck or anything and it seemed to boot fine.

Thanks for your help so far, Joulinar! I'll buy that cable and see how it goes.
in03
Posts: 7
Joined: Sun Aug 08, 2021 2:19 pm

Re: USB3 Boot Hard Drive Corruption Issues

Post by in03 »

Looks like I spoke too soon. I can't seem to find any decently priced that won't arrive before next month.
Ended up getting this:
https://www.ebay.com.au/itm/403040186383

It should arrive in a week and a bit :)
Will post back with results.
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: USB3 Boot Hard Drive Corruption Issues

Post by Joulinar »

ok crossing fingers it will help on your issue.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3216
Joined: Sat Nov 18, 2017 6:21 pm

Re: USB3 Boot Hard Drive Corruption Issues

Post by MichaIng »

Generally, the USB ports of the Raspberry Pi (and most SBCs) are not designed to reliably power 2.5" drives or larger. The absolute maximum power they can serve, shared across all USB ports, is 1.2A/6W: https://www.raspberrypi.org/documentati ... wer-supply
A single 2.5" SSD can peak this when powering on, or during some usage peaks or so, and then sudden unmounts or I/O errors may happen.

When powering the drive hence externally, please don't use a phone charger to power the drive, but a PSU like you use to power the SBC. Charging does not require a stable voltage, so cheap phone chargers, even when theoretically serving sufficient current, may not reliably power a device, as they are simply not designed to cover this need. So use a PSU which is explicitly designed to power devices, holding voltage in a sufficiently tight range even on usage fluctuations.
Post Reply