0

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.

3
  • You should check your logs for some evidence. /var/log/messages may be the first place to look, then maybe dmesg (see man dmesg for details)
    – Seamus
    Commented Jan 6, 2021 at 23:18
  • yes, thanks for pointing it out. I forgot about dmesg. Logs are updated in the post! Commented Jan 7, 2021 at 19:28
  • After re-reading your revised Question, my first thought is that you have too many pieces: LVM, LUKS, Ubuntu. You've verified your drive on Mint - not Ubuntu (yes, I know they're from the same "genetic pool", but still...). All I can do at this point is wish you luck, my friend - I have no idea either. I will say that if this were my project, I would take a much more incremental approach than you seem to be taking. In other words, get one thing working well, and then add something else.
    – Seamus
    Commented Jan 7, 2021 at 19:45

1 Answer 1

2

I have a very strange issue...

Yes - most issues are strange until you know what's behind them. But you ask this question as if you were addressing a group of fortune tellers! That's not what we do here. Learn how to ask a reasonable question - SE explains how to do that.

Unraveling "strange issues" often requires some "pick-and-shovel work". If you want resolution for your strange issue, you're going to have to do this work. N.B. You will not always get an answer!

All that said, you need to take your pick and shovel to /var/log first, and peruse the messages file. Note there are several files with the word messages; on my system for example:

$ ls -l /var/log | grep message
-rw-r----- 1 root        adm   41333 Jan  6 15:09 messages
-rw-r----- 1 root        adm    2407 Jan  3 00:00 messages.1
-rw-r----- 1 root        adm   16456 Dec 27 00:00 messages.2.gz
-rw-r----- 1 root        adm   16273 Dec 20 00:00 messages.3.gz
-rw-r----- 1 root        adm    8727 Dec 13 00:00 messages.4.gz

Try opening the most recent one (the current file) in a pager:

$ less /var/log/messages

In the pager, you may browse or search for items of interest (type h to see SUMMARY OF LESS COMMANDS). There are a couple of ways to use less to view compressed (*.gz) files. This is maybe the best way, but I usually do this:

$ zcat /var/log/messages.2.gz | less

Spend a few minutes browsing... you may be surprised your system is so busy! You are looking for a message pertaining to your strange issue... maybe mount is a good filter/search term? Also look at adjacent messages - they may contain clues as to the cause for strange issues.

It's also worth taking a look at dmesg (man dmesg for how-to). Perhaps you can correlate something in the dmesg output to a message?

While you're perusing all of this data, take a moment to share some information with us. Consider editing your question to tell us how you've mounted your disk... got a /etc/fstab entry? - If so, what is it? Mounted it manually? What command did you use? Run the command lsblk --fs, and add that output to your question.

Good luck & let us know if there's anything here that's unclear.

1
  • Thank you very much! Reg. last line of previous version of my post - "Please help me with debugging this problem, because I have no idea of what is wrong." You provided exactly what I expected - help with debugging this issue not guessing of what is the cause :) Commented Jan 7, 2021 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.