DietPi NAS w/online share

Good afternoon all,

Got myself a Raspberry Pi 4B and currently using it for PiHole which is working quite well,

Want to also give it NAS capability and be able to share access to a sole friend over the internet, using 2x USB 3.0 external hard drive enclosures.

I’m running DietPi as the distro - does anyone have any tips for what package I should install for the NAS ability?

I wanted to give it some redundancy, so have one of the drives as a mirror, couple options on my cases,

2x bay enclosure USB3.0

https://www.pccasegear.com/products/41429/orico-2-bay-usb-3-0-hard-drive-enclosure

Or 2x single bay enclosures:

https://www.pccasegear.com/products/41449/orico-3-5-inch-external-hard-drive-enclosure

The 2x bay enclosure setup is a bit more expensive, but it houses the two drives in one neat package with one power plug, but I’m not sure if there would be a hardware limitation on the enclosure which could cause an issue trying to set up RAID?

What are your thoughts and advice?

NAS you would need to setup and configure SAMBA

Outside network access safest and easiest way to share with a trusted friend would be to setup a VPN with openvpn or pivpn (dietpi-software) and give him access that way

This way he can connect directly to your network, you just setup a network share and he can map it that way

with that said…he will have full access to your LAN subnet however, but it will be thru a secure shell tunnel

Have his securely VPN into your network and then use a program that can do SCP like WinSCP or FileZilla and have him build a profile to connect to the RPi machine and then he can transfer files that way

I guess question was what would be best solution. A singe device having 2 disk or 2 device having a single disk each.

A typical NAS solution might be NextCloud or OwnCloud. There you are quite flexible on user access and permissions.

I run two drivers on one USB port with dual docking station here, and generally they appear as two fully dedicated drives, hence regarding RAID and any such there shouldn’t be any difference.

As of max USB 3.0 spec bandwidth and that all 4 USB ports share one PCIe lane, for concurrent R/W speak it shouldn’t matter either.

The could software solution depends on your needs. Nextcloud and ownCloud are highly extensible, can be accessed and managed from any browser, you can do calendar, tasks, contacts sync and much more, Nextcloud also supports video conferences and collaborated document writing via Nextcloud Talk, OpenOffice and Collabora apps/servers. If all of this is not needed, Synthing and File Browser are lighter solutions with a web interface, and if a web interface is not required, Samba of NFS servers are fine, depending on the client platforms you use. Pydio and FuguHub are other cloud (capable) servers you can install via dietpi-software: https://dietpi.com/docs/software/cloud/

For easy and litghtwight NAS solution use https://dietpi.com/docs/software/cloud/#file-browser

Good evening all,

Thanks for your help,

I have ordered 2x of these cases just to play it safe:

https://www.pccasegear.com/products/41449/orico-3-5-inch-external-hard-drive-enclosure

With 2x 10TB Seagate Ironwolf Drives.

I’m going to use RAID1 in a software RAID setup, does anyone have any tips how to configure this?

With File Browser, does it have media playback capability? IE on OneDrive I can open a video on there in a web browser on my phone, I can open a video file and it’ll stream on my phone, just like a youtube video and I can skip through it, rather than download the whole thing onto a local device then view it in a media player on the device locally.

honestly, I never testes these streaming feature on FileBrowser. Just give it a try.

ownCloud and Nextcloud do have video player apps (installed and enabled by default, AFAIK), but not sure in case of File Browser, TBH. Jep, should be quick and easy to try it out, it’s a very small tool, installing fast, uninstalled even faster when it doesn’t meet the requirements.

I’m doing the initial drive setup at the moment,

Created a RAID1 array from 2x USB3.0 external HDDs, using the 10TB Ironwolf drives in external enclosures listed above,

Seems to be taking a long time to sync:

How long would you expect this to take? Been about 10 minutes and is sitting on 1% at the moment.

something we can’t answer.

Alright, looks like one of the drives is faulty:

Is there any suggested tests I should run to confirm?

But strange, run Hdsentinel and it reported the following:

Removed and added the drive reporting fault from its housing, attempting rebuild on md0 RAID1 array.

Alright I think maybe it cant handle all the I/O or something as well as the drives started getting very hot building the RAID array,

Drives were sitting on 65 degrees C this morning and they both disappeared from mdadm and won’t be recognised by the Pi anymore under the USB ports.

I don’t think this is viable, but I’ll give it another try with cooling, rebooted the Pi, it recognised the drives again, will try do another RAID 1 and see how we go.

EDIT - update hours later

Certainly doesn’t like one of the drives

Anyone have any suggestions for further testing to see if its bad? What utilities are available?

Using dmesg it shows the following:

[ 1279.444248] md/raid1:md0: Disk failure on sda, disabling device.
md/raid1:md0: Operation continuing on 1 devices.

[23202.972901] blk_update_request: I/O error, dev sdb, sector 24 op 0x1:(WRITE) flags 0x800 phys_seg 1 prio class 0
[23202.972913] md: super_written gets error=-5
[23202.972927] md/raid1:md0: Disk failure on sdb, disabling device.
md/raid1:md0: Operation continuing on 1 devices.

[23202.973054] blk_update_request: I/O error, dev sdb, sector 7762177408 op 0x1:(WRITE) flags 0x0 phys_seg 64 prio class 0
[23202.973178] blk_update_request: I/O error, dev sdb, sector 7762177920 op 0x1:(WRITE) flags 0x0 phys_seg 64 prio class 0
[23202.973284] blk_update_request: I/O error, dev sdb, sector 7762176384 op 0x1:(WRITE) flags 0x0 phys_seg 64 prio class 0
[23202.973391] blk_update_request: I/O error, dev sdb, sector 7762176896 op 0x1:(WRITE) flags 0x0 phys_seg 64 prio class 0

[23202.973698] blk_update_request: I/O error, dev sdb, sector 7762179456 op 0x1:(WRITE) flags 0x0 phys_seg 64 prio class 0
[23202.973767] sd 1:0:0:0: [sdb] tag#7 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x06 cmd_age=65s
[23202.973782] sd 1:0:0:0: [sdb] tag#7 CDB: opcode=0x8a 8a 00 00 00 00 01 ce a9 77 80 00 00 01 80 00 00
[23202.973798] blk_update_request: I/O error, dev sdb, sector 7762179968 op 0x1:(WRITE) flags 0x0 phys_seg 48 prio class 0
[23202.973996] usb 2-2: USB disconnect, device number 3
[23202.974665] md: md0: resync interrupted.
[23202.980374] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
[23203.223726] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=0x00
[23203.440047] usb 2-2: new SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[23203.461112] usb 2-2: New USB device found, idVendor=174c, idProduct=55aa, bcdDevice= 1.00
[23203.461131] usb 2-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[23203.461145] usb 2-2: Product: ASMT105x
[23203.461158] usb 2-2: Manufacturer: ASMT
[23203.461170] usb 2-2: SerialNumber: 234567890126
[23203.471111] scsi host2: uas
[23203.476355] scsi 2:0:0:0: Direct-Access ST10000V N0008-2PJ103 0 PQ: 0 ANSI: 6
[23203.477414] sd 2:0:0:0: Attached scsi generic sg1 type 0
[23203.478189] sd 2:0:0:0: [sdc] 19532873728 512-byte logical blocks: (10.0 TB/9.10 TiB)
[23203.478201] sd 2:0:0:0: [sdc] 4096-byte physical blocks
[23203.478342] sd 2:0:0:0: [sdc] Write Protect is off
[23203.478352] sd 2:0:0:0: [sdc] Mode Sense: 43 00 00 00
[23203.478614] sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[23203.479206] sd 2:0:0:0: [sdc] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[23203.561820] sd 2:0:0:0: [sdc] Attached SCSI disk
[23203.964121] md: resync of RAID array md0

What does this show?

vcgencmd get_throttled

could that be some damage on the disk? Issue seems to be with both drives.

[ 1279.444248] md/raid1:md0: Disk failure on sda, disabling device.
md/raid1:md0: Operation continuing on 1 devices.



[23202.972927] md/raid1:md0: Disk failure on sdb, disabling device.
md/raid1:md0: Operation continuing on 1 devices.

Not sure where you placed your disk in. But you are sure they are powered correctly?

Some vendor offer tools (most likely on windows) where drives can be checked with.

Alright I think I know what was causing it, was too much I/O and the nature of USB it was dropping the drives as they were trying to do the software RAID array through mdadm,

Did various tests, no failures/bad sectors reported on either drives

I got myself a QNAP TR-004 and have it set up with the enclosure taking care of hardware RAID 1.

Pi sees it as a single 9.1TB volume, no dramas.

I’ve got another 2x Ironwolf 10TB drives coming to add to the array, then we’ll start organising the online side of things.