You can connect your external hard disk, SSD, or USB stick to any of the USB ports on the Raspberry Pi, and mount the file system to access the data stored on it.
By default, your Raspberry Pi automatically mounts some of the popular file systems such as FAT, NTFS, and HFS+ at the /media/pi/<HARD-DRIVE-LABEL>
location.
Documentation usage kodi Using Kodi on the Raspberry Pi. Kodi is media centre software which runs on Raspberry Pi. Two Kodi distributions are included in our easy operating system installer NOOBS: LibreELEC and OSMC. First, install NOOBS on an SD card. Follow instructions on the NOOBS page. Raspberry Pi 3 B – This is an earlier revision of the 3 B+, it has a slower Ethernet connection but is still very suitable for a network-attached Kodi box. It sports a Quad Core 1.2GHz Broadcom BCM2837 64bit CPU. It also has WiFi and Bluetooth. Raspberry Pi 2 B – An older version but still very popular. It has Wired Ethernet but no WiFi.
To set up your storage device so that it always mounts to a specific location of your choice, you must mount it manually.
Tested on Raspbian Buster on a Raspberry Pi 4. Over this past weekend, I finally setup a network share via Samba on my Raspberry Pi with an old external USB hard drive I had laying around. My RetroPie installation already serves up a Samba share - so my goal was to throw an additional folder in there that mounts to an external drive. Plug your device to a free USB port. For big external drives, you will need extra power to run the drive correctly (“Under-voltage detected!” will appear in the terminal). Try to add a powered USB hub to the Raspberry Pi (check this one on Amazon for example if you don’t already have one). The Raspberry Pi 3 works good combining with the XBMS or kodi. Ethernet Networks is good than the built in wifi but it will average and also work fine with streaming movies. The Raspberry Pi 3 is such an great thing over Raspberry Pi 2. The Pi 2 also works same with the Kodi but several time it may stop working in between the processes.
Mounting a storage device
You can mount your storage device at a specific folder location. It is conventional to do this within the /mnt folder, for example /mnt/mydisk. Note that the folder must be empty.
- Plug the storage device into a USB port on the Raspberry Pi.
List all the disk partitions on the Pi using the following command:
The Raspberry Pi uses mount points
/
and/boot
. Your storage device will show up in this list, along with any other connected storage.- Use the SIZE, LABEL, and MODEL columns to identify the name of the disk partition that points to your storage device. For example,
sda1
. The FSTYPE column contains the filesystem type. If your storage device uses an exFAT file system, install the exFAT driver:
If your storage device uses an NTFS file system, you will have read-only access to it. If you want to write to the device, you can install the ntfs-3g driver:
Run the following command to get the location of the disk partition:
For example,
/dev/sda1
.Create a target folder to be the mount point of the storage device. The mount point name used in this case is
mydisk
. You can specify a name of your choice:Mount the storage device at the mount point you created:
Verify that the storage device is mounted successfully by listing the contents:
Setting up automatic mounting
You can modify the fstab
file to define the location where the storage device will be automatically mounted when the Raspberry Pi starts up. In the fstab
file, the disk partition is identified by the universally unique identifier (UUID).
Get the UUID of the disk partition:
- Find the disk partition from the list and note the UUID. For example,
5C24-1453
. Open the fstab file using a command line editor such as nano:
Add the following line in the
fstab
file:Replace
fstype
with the type of your file system, which you found in step 2 of 'Mounting a storage device' above, for example:ntfs
.- If the filesystem type is FAT or NTFS, add
,umask=000
immediately afternofail
- this will allow all users full read/write access to every file on the storage device.
Now that you have set an entry in fstab
, you can start up your Raspberry Pi with or without the storage device attached. Before you unplug the device you must either shut down the Pi, or manually unmount it using the steps in 'Unmounting a storage device' below.
Note: if you do not have the storage device attached when the Pi starts, the Pi will take an extra 90 seconds to start up. You can shorten this by adding ,x-systemd.device-timeout=30
immediately after nofail
in step 4. This will change the timeout to 30 seconds, meaning the system will only wait 30 seconds before giving up trying to mount the disk.
For more information on each Linux command, refer to the specific manual page using the man
command. For example, man fstab
.
Unmounting a storage device
When the Raspberry Pi shuts down, the system takes care of unmounting the storage device so that it is safe to unplug it. If you want to manually unmount a device, you can use the following command:
If you receive an error that the 'target is busy', this means that the storage device was not unmounted. If no error was displayed, you can now safely unplug the device.
Dealing with 'target is busy'
The 'target is busy' message means there are files on the storage device that are in use by a program. To close the files, use the following procedure.
Close any program which has open files on the storage device.
If you have a terminal open, make sure that you are not in the folder where the storage device is mounted, or in a sub-folder of it.
If you are still unable to unmount the storage device, you can use the
lsof
tool to check which program has files open on the device. You need to first installlsof
usingapt
:To use lsof:
Kodi is media centre software which runs on Raspberry Pi.
Install Kodi Raspberry Pi
Two Kodi distributions are included in our easy operating system installer NOOBS: LibreELEC and OSMC.
NOOBS
First, install NOOBS on an SD card. Follow instructions on the NOOBS page.
With NOOBS on your SD card, you should be able to boot the Raspberry Pi to the NOOBS operating system selection screen:
Select LibreELEC or OSMC and press the Install
button.
You'll be prompted to confirm. This will delete any data on the SD card, so if you previously had Raspberry Pi OS on it be sure to back up your files first. If you're sure, click Yes
to continue and start the installation. This will take some time; when it's complete NOOBS will show a window saying:
Click OK
and your Pi will reboot into the distribution you selected.
Using Kodi
Now you've got your Kodi distribution installed, you can play media files, configure the system, and install add-ons to add more functionality.
You may be shown a Welcome screen, which will help you configure your setup and get started.
Update Kodi Raspberry Pi
Power
You can power your Pi the conventional way with a wall socket USB micro cable; alternatively, if your TV has a USB port you can connect the Pi directly with a USB micro cable. This means your Pi will be powered when the TV is turned on, and powered down when the TV is turned off.
Kodi Raspberry Pi Os
Control
You can use a keyboard and mouse with Kodi, buy a TV remote with a USB receiver, or even use a presentation clicker with directional buttons.
You can also use a Kodi app on your smartphone; search for Kodi
in your phone's app store. Once configured to connect to your Kodi Pi's IP address, you can use the on-screen remote control or browse the files from your phone and select what to play.
Playing video files
You can copy video files onto your Pi's SD card, or put them on a USB stick or external hard drive. To play these files, simply choose VIDEOS in the slider on the main screen, then Files, and you should see your inserted media in the list of sources. Select your device and you should be able to navigate it like you would on a computer. Find the desired video file, select it and it will play.
Connecting a network drive
You can connect to a network device such as a NAS (Network Attached Storage) on your local network by using a wired connection. Connect your Raspberry Pi to your router with an Ethernet cable. To connect to the device, select VIDEOS from the main screen and click Add Videos....
The Add Video Source screen will be shown. Select Browse and choose the type of connection. For a NAS, choose Windows network (SMB); it will be using the Samba protocol, an open-source implementation of the Windows file share protocol. The device will show up if it can be found on the network. Add this device as a location and you'll be able to navigate its file system and play its media files.
Settings
Kodi has a host of configurable options. You can change the screen resolution, choose a different skin, set up a screensaver, configure the file view, set localisation options, configure subtitles, and much more. Just go to SYSTEM and Settings from the main screen.
Add-ons
Add-ons provide extra functionality or enable connection to web services like YouTube.
The YouTube add-on showing search results:
You can configure add-ons from the settings menu; a selection is available for you to browse. Select one and you'll be prompted to install it. Each add-on has its own configurations.