I have a very strange issue with external HDD (4TB) attached to my rpi 4. External drive has it's own chassis with power supply. I chose this chassis especially for my rpi project in order to prevent possible power drops. Both, HDD and chassis are new and unused before.
I've tested this drive on my pc, and it works fine. No issues, connection errors even when I move it around it stays mounted, decrypted (LUKS) and works just fine.
When it is plugged to my rpi it randomly unmounts itself and changes its name from sda to sdb. It seems to me, that it happens when I touch usb or ethernet cable. I even gave it back to shop under warranty, because I thought that this is some kind of hardware problem with rpi. They gave me back a new one, but the same behavior happens again.
I tested every usb port on rpi with regular pen drive, and everything works fine, even when I firmly wiggle pen drive in port or ethernet cable, file system stays mounted and everything is fine. It looks like there is no issue with rpi from the hardware side.
It looks to me, like rpi doesn't like my hdd drive and I have no clue why is such a thing happening. HDD has separate power supply. Raspberry runs Ubuntu Server 20 (version for rpi) and my PC, where I've tested hdd, runs Linux Mint.
Please help me with debugging this problem, because I have no idea of what is wrong.
edit.
Adding more information, as you requested.
Hardware setup:
- HDD: Seagate BARRACUDA 4TB SATA III 3.5"
- HDD enclosure: Orico 7688U3 3.5″ SATA USB3.0 HDD Docking Enclosure
- rpi: Raspberry Pi 4 B WiFi DualBand Bluetooth 8GB RAM 1,5GHz
Hard drive is entirely encrypted with LUKS and LVM is created on top of LUKS. It is automatically decrypted with key file during startup and lv's are automatically mounted by fstab. This part works perfectly fine after system boot - all mountpoints are accessible.
output from lsblk looks like this right after boot:
ubuntu@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 48.8M 1 loop /snap/core18/1936
loop1 7:1 0 48.9M 1 loop /snap/core18/1949
loop2 7:2 0 59.9M 1 loop /snap/lxd/18152
loop3 7:3 0 27M 1 loop /snap/snapd/10494
loop4 7:4 0 27M 1 loop /snap/snapd/10709
loop5 7:5 0 63.6M 1 loop /snap/lxd/16103
sda 8:0 0 3.7T 0 disk
└─vault 253:0 0 3.7T 0 crypt
├─vg_storage-lv_ops_quarantine 253:1 0 50G 0 lvm /mnt/ops_quarantine
├─vg_storage-lv_ops_operational--data 253:2 0 50G 0 lvm /mnt/ops_operational-data
├─vg_storage-lv_ops_appdata 253:3 0 100G 0 lvm /mnt/ops_appdata
├─vg_storage-lv_repo_dotfiles 253:4 0 10G 0 lvm /mnt/repo_dotfiles
├─vg_storage-lv_repo_windows--apps 253:5 0 1G 0 lvm /mnt/repo_windows-apps
├─vg_storage-lv_repo_iso 253:6 0 50G 0 lvm /mnt/repo_iso
├─vg_storage-lv_repo_git 253:7 0 50G 0 lvm /mnt/repo_git
├─vg_storage-lv_multimedia_video 253:8 0 700G 0 lvm /mnt/multimedia_video
├─vg_storage-lv_multimedia_audio 253:9 0 400G 0 lvm /mnt/multimedia_audio
├─vg_storage-lv_multimedia_ebooks 253:10 0 100G 0 lvm /mnt/multimedia_ebooks
├─vg_storage-lv_multimedia_resources 253:11 0 200G 0 lvm /mnt/multimedia_resources
└─vg_storage-lv_data_documents 253:12 0 80G 0 lvm /mnt/data_documents
mmcblk0 179:0 0 116.5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 116.2G 0 part /
After just a random, slight movement of usb plug from the side of raspberry pi, or after just moving rpi on the table, ORICO enclosure blinks red and after that, output from lsblk looks like this:
ubuntu@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 48.8M 1 loop /snap/core18/1936
loop1 7:1 0 48.9M 1 loop /snap/core18/1949
loop2 7:2 0 59.9M 1 loop /snap/lxd/18152
loop3 7:3 0 27M 1 loop /snap/snapd/10494
loop4 7:4 0 27M 1 loop /snap/snapd/10709
loop5 7:5 0 63.6M 1 loop /snap/lxd/16103
sdb 8:16 0 3.7T 0 disk
mmcblk0 179:0 0 116.5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 116.2G 0 part /
as you can notice, sda changed to sdb and is unmounted now.
I pasted logs to pastebi for brevity of this post. These are the logs, that I collected right after the issue occurred:
I did additional test with another usb drive, and I was able to reproduce the error, so it looks for me, like there is an issue with usb ports on the Raspberry Pi. Seems like I was super unlucky and maybe my vendor has a faulty batch of raspberries (it was already replaced under warranty), but I would like to hear your opinion.
logs
for some evidence./var/log/messages
may be the first place to look, then maybedmesg
(seeman dmesg
for details)