Two external hard drives (USB powered) are initially connected to a Raspberry Pi 4B via the two USB 3.0 ports and they have the following block ids: /dev/sda
, /dev/sdb
.
I used mdadm
to create a RADI0 configuration, however, at least once in a day, one of the drives get disconnected (probably). What results is a different id such as /dev/sdc
or /dev/sdd
.
For testing purposes, I removed the RAID0 configuration and timed how long the block name persists. While simply formatting the hard drive with mkfs.ext4
, the /dev/sda
device disappeared for some time and reappeared as /dev/sdc
.
Restarting the Pi again restores the original ids to the drives.
Initially:
pi@naspi:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
└─sda1 8:1 0 465.8G 0 part
sdb 8:16 0 465.8G 0 disk
└─sdb1 8:17 0 465.8G 0 part
Changes to: (sdb changes to sdc)
pi@naspi:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
└─sda1 8:1 0 465.8G 0 part
sdc 8:16 0 465.8G 0 disk
└─sdc1 8:17 0 465.8G 0 part
How can I fix this without restarting the Pi every time this happens? I do not even know why this is occurring.
(owing to this problem, I can never set up a RAID0 configuration and then share that over my local network as a SAMBA server)
part
vs.disk
), but I am pretty sure that's all you really need (I'm guessing the issue is actually the Samba config). You can find them (the UUIDs) withblkid
. – goldilocks Sep 22 '20 at 14:17mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb
Is there any way to use UUIDs instead of /dev/sda and /dev/sdb. I believe that would solve my problem. Thank you for responding again! :) – NovoBook Sep 22 '20 at 14:50