User avatar
prthorsenjr
Posts: 5
Joined: Mon Nov 18, 2019 1:30 pm

Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Wed Mar 25, 2020 6:59 pm

Hi,

First off, if this isn't the right place for this posting, please let me know. I am new to the raspberry pi but not new to computers or linux. So, given that, let me describe what it is that I am trying to accomplish.

I have two Seagate 4 TB USB drives that I want to attach to the two USB 3.0 ports on my raspberry pi 4b.

I want to make both USB drives be one BIG lvm. Thus, creating one BIG 8TB file system.

When I have one of the drives connected, I can use gparted to make the lvm pv (physical volume). I can then use the pvcreate command and create the lvm physical volume. So far, so good. When I connect the second drive, the system freezes. It then says that one of the drives was disconnected without ejecting it. It does recover but this happens over and over with both drives connected.

I'm at a loss as to what to do?

Anyone else trying to do this?

If I find out anything else, I'll update this post.

Thanks in advance,

Pete

User avatar
prthorsenjr
Posts: 5
Joined: Mon Nov 18, 2019 1:30 pm

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Wed Mar 25, 2020 8:03 pm

So, I have made partial success. I got the first drive working as a logical volume. It's mounted and I can read/write from/to it.

However, when I add the second drive the system acts as I described before. It freezes and says that the drive was disconnected without ejecting.

Madness, I say.

User avatar
procount
Posts: 2058
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Wed Mar 25, 2020 8:12 pm

How are you powering the HDDs? Do they have their own power supplies, or are you powering them from the Raspberry Pi USB ports?
The Raspberry Pi is limited in what current it can deliver over USB, so the addition of the 2nd HDD might over power it if they don't have their own supply. In this case, the addition of a USB3 powered USB hub might solve it.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

User avatar
prthorsenjr
Posts: 5
Joined: Mon Nov 18, 2019 1:30 pm

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 11:55 am

Thanks for the suggestion. I've ordered a USB 3 powered hub and will pick it up today. This afternoon I will add everything to it and hope that this solves my issue.

Thinking about it, you're probably correct, I two wireless dongles (mouse and keyboard) in the two USB slots and then was trying to add to external USB drives as well.

I'll keep this post updated.

Thanks.

epoch1970
Posts: 4512
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 12:21 pm

Have you considered using an unioning file system, e.g. mergerfs?
This does not create a virtual block device, only merges files. Works perfect in read mode, write mode you'll have to see for yourself; writing to each physical volume is probably preferable.
Could save you some downtime rebuilding an 8TB VG/array...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
procount
Posts: 2058
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 12:44 pm

When you mentioned a "unioning" file system, I first thought of overlayfs, and how that can be used to overlay a readonly filesystem with writeable files that can be thrown away to restore the original content.
But a quick read of the provided link indicates mergerfs is a bit different and could be used to join 2 disks together.

I looked at using LVM2 myself to allow future extension of my fileserver by adding more disks to it, but I've decided on using zfs instead because I think it supports my backup scenarios to a remote site better. The downside is I lose the ability to shrink a pool once it has been extended, whereas lvm pools can be shrunk. Reality is always a compromise.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

r00t4rd3d
Posts: 8
Joined: Sat Dec 28, 2019 1:05 am

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 12:49 pm

prthorsenjr wrote:
Thu Mar 26, 2020 11:55 am
I have two wireless dongles (mouse and keyboard) in the two USB slots and then was trying to add two external USB drives as well.


With out a doubt you are drawing too much power. The powered hub should get you up and running.

User avatar
prthorsenjr
Posts: 5
Joined: Mon Nov 18, 2019 1:30 pm

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 3:29 pm

I got the USB 3 powered hub this morning. I ran home, installed it and "Voila!", both disks are connected to the raspberry pi via the hub and are behaving very nicely.

I cannot thank you guys enough for helping me troubleshoot this issue. I have another raspberry pi and two more 5 TB drives, so I went ahead and ordered another hub for that project.

Now, I know that I said that I wanted to use lvm for this but I am thinking of going with open media vault? I don't wanna hijack this thread with that though.

Again, many thanks and I hope that it will help someone else down the line in a similar situation.

epoch1970
Posts: 4512
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 4:54 pm

prthorsenjr wrote:
Thu Mar 26, 2020 3:29 pm
Now, I know that I said that I wanted to use lvm for this but I am thinking of going with open media vault? I don't wanna hijack this thread with that though.
Well it's your thread, you more or less do what you want with it :) I suppose OMV is good because it is specialized, meaning tuned and stable. But I don't know it.
procount wrote:
Thu Mar 26, 2020 12:44 pm
I looked at using LVM2 myself to allow future extension of my fileserver by adding more disks to it, but I've decided on using zfs instead ...
I'm not one to say that a FUSE filesystem is a match for ZFS!
But, for some who are not sure why they would use LVM, RAID, ZFS, a unioning fs might be the right solution. Simple, lightweight, independent drives, etc. Zero maintenance, as a matter of fact.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
procount
Posts: 2058
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 5:32 pm

@epoch1970 - Yes, a FUSE file system like mergerfs may be the best solution for those users.

@prthorsenjr - Using OMV does not preclude the use of LVM. In fact, OMV includes a plugin for LVM so it integrates very well, allowing you to manage your lvm virtual groups and drives etc from within OMV's web interface. I don't know if OMV has a plugin for mergerfs (I doubt it) but I can't see why it wouldn't work, you'd just have to administer it externally. But if mergerfs is maintenance free, then you will need little interaction anyway.

OpenMediaVault is really just a Web-based Administration tool for the various tools that can implement a media server, like Samba, NFS, LVM, ZFS, RAID etc. and has several plugins that perform additional tasks.

I would not recommend using ZFS unless you are an expert (even though I am not one of them!) because it needs a 64-bit kernel to operate reliably, compilation of the zfs modules on a 64-bit OS (e.g. nspawn64) and I had to customise the ZFS plugin to get it to work with OMV on the Pi4 and avoid loading other dkms versions that didn't work. I think it's right for my use case, but may not be suitable for everyone.

Good luck with the rest of your project and I'm glad to have helped you.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

swampdog
Posts: 349
Joined: Fri Dec 04, 2015 11:22 am

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 7:21 pm

Stick with lvm. It's tried and tested tech. I've been using it on my rpi4's for a few months now. Getting reliable hardware/peripherals was a pain (mostly solved by self powered stuff as you've found).

One of the rpi4's has three identical caddies attached to it, each with a 3Tb disk. They're just ext4, for archiving (3 copies) of my virtual machines from my PC KVM hypervisor boxes. It replaced a dedicated PC, the idea being to save power. However, one of the disks won't spin back up after it sleeps so for the time being, it's bodged, with a cronjob to touch a file every 3 minutes to stop it sleeping (and because I dunno which caddy it might be in, all three have to be touched). I'm trying to say in long winded fashion - much of the hardware issues blamed on the pi are down to substandard peripherals.

With lvm, it's fairly painless to attach the disks to a PC, should it be required. It's also easy to upgrade in the future: just 'pvmove' to the new bigger disk(s).

I'm assuming lvm is being used here for data, not the OS. Two of my rpi4's do use lvm for the OS. The sdcard is there just for the vfat. It is reliable and raspbian works fine (SSD's with trim and lvm discard). Trouble is when you update - you need an "initrd" to boot lvm OS. When the kernel changes it won't boot. Manual intervention is required(*) before reboot to create it.

lvm for data. Yes. lvm for OS. No, not yet.

(*) I did post about it but no answers.

danjperron
Posts: 3456
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Raspberry Pi 4b, 2 Seagate 4TB USB External Drives and lvm2

Thu Mar 26, 2020 9:26 pm

I just removed my old linux server and use the Mediasonic ProRaid box SATA USB 3.0 with my two 4T HDD.

Maybe it should be good for you in LVM. This unit is able to handle two drives in normal mode but I'm using it has hardware raid 1 because it is configure to be a NAS and I don't want to lost the data.

check my post here https://www.raspberrypi.org/forums/view ... 0#p1632406

Return to “Advanced users”