0

I have a raspberry pi which I use as a NAS with SAMBA. After I installed a brand new drive (480 GB Lexar SSD) into a Sata-To-USB adapter, the system acts weird (raspbian bullseye).

When opening parted, it freezes and the CPU load goes to 25%. After a minute, parted unlocks and I can use it, with CPU load going back to minimum. After creating a partition with mkpart, parted hangs again and CPU goes to 25%. After some minutes again, the CPU usage goes down, I make another partition, the system hangs and the cycle continues until the 4th partition.

After partitioning the drive in 4 partition, the drive suddenly disappeared from lsblk command. I tried plugging it again but the only thing it happens is the activity LED blinking infinitely on the adapter.

I tried rebooting with the drive inserted and the raspberry wouldn't continue booting unless I removed the drive. (FYI the fstab file is empty, except the default boot and root partitions).

With system on again, I plugged in the drive and it got recognized. While making a file system with mkfs.ext4, the system hanged again, CPU up to 50% and after a couple minutes the mkfs started making the filesystem. This exact cycle continues until the last partition.

After the file system I tried mounting it with "mount /dev/sda1 /mnt/part1", but again the system hanged, CPU to 25%, and after some minutes it mounted. The exact thing happened for all the other 3 mounts remaining.

After the mount, using the lsblk -fp command I noticed that the UUID is missing on all 4 partitions, thus meaning I can't add the UUIDs on fstab. After the lsblk command, the disk disconnected again and the adapter started blinking.

Right now, after rebooting and connecting the drive afterward, the disk gets recognized, but when I try to use it with a command such as mount, mkfs and parted, the command hangs and after some minutes it returns the error "device not found" (the error has a different syntax for every command but the main problem is that). After the error the disk disconnects again and I have to remove it, reboot and plug it again to view it.

What could be the problem? The adapter I use works fine with Windows systems and works fine on another raspberry I have.

Thanks for your help.

Tried changing USB ports, tried changing mklabel option on the disk.

2
  • Which model of Pi? Are you using an official power supply? What spec?
    – CoderMike
    Dec 6, 2023 at 16:45
  • Hello, I have a raspberry pi 4 and I use a USB C power supply made for raspberry that I found on Amazon. I have the same power supply on another raspberry pi 4 I have and both work good.
    – Bellacoda
    Dec 7, 2023 at 8:01

1 Answer 1

0

First, I find the parted command to be slow even on pc desktops, so your experience with it on the pi matches what I've seen elsewhere. I don't think this is the pi's fault.

As to the missing UUIDs, the UUID is not created by the partition but by the filesystem creation. IT is possible (but unlikely) that the partitions didn't have UUIDs yet when you looked, or possibly if you made the filesystem, the kernel hadn't reread the UUIDs yet when you looked. The partprobe command may help here, but only after creating a filesystem in the partition.

Third, you didn't mention which pi you have, and in particular, the raspberry pi 3 and older are not fast systems, and can't handle full USB 3 (or 2?) bandwidth. So high utilization is not surprising on a pi3. (And how did you determine this is cpu utilization and not I/O pressure? Load average doesn't distinguish between the two.)

And lastly, USB is of variable quality. Bad USB cables (poor quality or worn cables) can cause all kinds of I/O irregularities and drop outs. Similarly, there are external USB devices that have issues and may be erratic. And even a high quality external disk can act slow and drop out if it has bad blocks that it is internally dealing with. (Hopefully you didn't ever drop it.)

As hinted at in comments, unreliable or insufficent power can also make external drives unreliable.

2
  • Hello, I have a raspberry pi 4. The USB3 adapter I'm using worked flawlessly with the old drive I replaced (PNY 240GB SSD). The CPU average I see is from the mobaxterm remote monitoring tab. Even after creating the file system and then mount it, the UUID still doesn't appear. The USB adapter is the only USB device plugged in the raspberry
    – Bellacoda
    Dec 7, 2023 at 7:57
  • Check /dev/disks/by-* for uuids. Just because a cable worked on an old drive doesn't mean that it isn't worn and broken now... I have no idea what mobaxterm is looking at.
    – user10489
    Dec 7, 2023 at 12:33

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.