New Raspberry Pi 2b system experiences

Here are a few brief experiences of setting up my Raspberry Pi 2b and 2TB hard drive as a media centre. It might be of use to someone else. These notes assume you have some experience of managing a Linux system.

Spec:
Pi 2b
8GB micro SD root drive
2TB WD media drive via USB
An old, very old, USB wifi adapter. It works but is slow. I only use it to update my media and connect via SSH so it’s not an issue for now.
An OSMC remote control (I now realise that my Samsung One remote also does the job!)
OSMC build: 15/8/2023 (yes, I’m in the UK)
Kodi: 20.2

The OSMC install is very easy, but somewhat frustratingly the external USB drive is not automatically mounted. So, get my media drive (/dev/sda5 in this case) to mount at boot. First, identify it.

You need to ssh into the system.

osmc@fleapit:~$ blkid
/dev/sda5: LABEL=“Home” BLOCK_SIZE=“512” UUID=“3AF4A693F4A650C5” TYPE=“ntfs” PARTUUID=“61e3b368-05”
/dev/mmcblk0p1: LABEL_FATBOOT=“OSMCInstall” LABEL=“OSMCInstall” UUID=“01AB-C526” BLOCK_SIZE=“512” TYPE=“vfat” PARTUUID=“d2bd89ab-01”
/dev/mmcblk0p2: UUID=“256ce1f6-cb2c-457f-83cf-da682a38a452” BLOCK_SIZE=“4096” TYPE=“ext4” PARTUUID=“d2bd89ab-02”

This gives the UUID of my media drive “Home”.

Mount USB media drive on boot:
Add to /etc/fstab (fields are tab separated. That is important!)
UUID=“3AF4A693F4A650C5” /mnt/media ntfs defaults,relatime 0 0

Note the fstype from blkid.

Configure Samba (I forget if I had to install it or just configure). If it needs installing just do so via the app store.

Edit /etc/samba/smb-shares.conf and add something like:

[Media]
browsable = yes
read only = no
valid users = osmc
path = /mnt/media
comment = Films and TV

That is pretty much it. I am having a minor problem in that my hard drive seems to sleep after a while. Keep it awake so the media is always available. I don’t yet know why this is happening so I have created a simple cron script to run every 20 minutes to check the media drive is still mounted. I will investigate the cause of the drive sleeping in due course - if I can be bothered. It might be a thermal issue, I suppose, but I suspect it is just sleeping and needs to be woken up.

crontab -e
20 * * * * /home/osmc/bin/keepmounted.sh

The crontab script checks if my drive is mounted and then runs mount -a. I might adjust the timing.

#!/bin/bash
/bin/mount | /bin/grep sda5 > /dev/null
if [ $? != 0 ]; then
/bin/mount -a > /dev/null
/bin/echo $? > /home/osmc/keepmounted.status
fi

All in all, this is a very, very good system. I’m going to run with this for a while as I had a Pi lying around doing nothing and have lots of films to watch via a now integrated system.

My next step will be an upgrade to a Vero V with SSD media storage when my budget allows.

One last thing. I need to backup my precious films elsewhere. I’m looing at Backblaze B2 Cloud storage ($6USD per TB per month) and perhaps Duplicity to manage it for me. Early stages; I’m not in a rush.

Thank you Sam and team for a great product!

1 Like

I’m not sure why your drive didn’t work automatically the way you wanted. Typically when you plug a USB drive in there is a service that runs that automatically mounts it in /media using the partition label or the UUID as long as it isn’t mounted via fstab or autofs. If you have installed samba from the My OSMC add-on then auto-mounted drives are also automatically shared via SMB using the mount name. If you have manually created a mount point then a share for that would also need to be manually created. As for the mount our current recommend it to use autofs over fstab as it does a better job of maintaining the mount if the source is unreliable.

As for your drive spinning down this is typical of external drives. Some external WD I know do this outside of the OS and the feature can be modified with their drive management tool. It shouldn’t normally be an issue letting the drive spin down though.

I would note that if your plan is to leave the drive connected to the RPi and transfer files over the network to it then you will get a reduction in speed by using NTFS. You should find better performance and Windows compatibility with exFAT, and the best performance with ext4.

A Vero V would be an massive upgrade over a RPi 2B, but going with solid state storage for your media is a waste of money. The extra speed does nothing for media playback and they don’t necessarily use less power or provide more reliability.

Why not just keep a second copy at home and save the monthly charges? Are your films really so precious that they need the safety of going offsite?

2 Likes

I will investigate the WD drive management tool to see if that fixes the problem.

Network transfer speed is not really a problem atm as not a lot of data are routinely transferred, but I will bear your exFAT and ext4 comments in mind. Thanks.

What could have happened is when I first installed I left the system alone for a while before adding my repositories using the UI, the drive could have spun down and so I could not see any files to index. It’s possible.

As for my films being precious: only in terms of the amount of time spent assembling my library. I do have another backup drive, but I have also experienced a house fire once and so am perfectly willing to spend a modest amount of money each month for peace of mind.

Oh, and to your point about SSDs, my concern is purely form factor, not speed, reliability or power consumption. I have not yet had an SSD fail on me, but have had a good few hard drives fail.

I’ve seen numerous SSD’s fail. Not from hitting their normal wear limit, but just out of the blue dead, inaccessible, or non-functioning due to firmware bugs (seen both locked after a certain power on hours and a bug that made write amplification go up 200x normal) or hardware faults. Both solid state and spinning rust can fail.

When I could fit my collection on a couple of drives I just manually made backups once a week on external WD My Book and Elements 3.5" drives (which tend to be more reliable than 2.5" spinning rust drives) and kept them in a fireproof safe. If I had an issue it was quick and easy to recover with no monthly fees. Backup and restore time should be factored in as well. It may be convenient to let it upload to the web in the background, but often times these services are relatively slow. I just googled Backblaze and the first link from them was talking about restoring at a speed of only 1GB per hour or up to 10 days to get your data on a hard drive shipped.