You’ve had success with your latest Raspberry Pi project. Perhaps you’re using it to create photos, music, or even video? Whatever the case, at some point you’re going to want an easy way to get the data off the Pi’s SD card and onto your PC’s HDD.

This can be tricky.

With virtually no support from cloud services, the answer comes in the form of removable media, email, and local network tricks. If you’ve ever had to copy data to or from a Raspberry Pi and run into problems, these five methods should help you out in future.

You might prefer to access Gmail via the Chromium web browser — either option is fine.

How you send the email is up to you. If you’re using Gmail, you’ll be able to save the message as a draft. Then when you sign into Gmail on your main PC, it will be there. Otherwise, if you’re using an email client, just email it to your own address, or a second email account you have access to.

If you don’t have a second email account but have a Facebook account, then you have a Facebook email account. In a squeeze, send the data to this.

2. Access Cloud Storage in the Browser

Another obvious-but-slow option is to access one of your cloud accounts and sync data this way. Unfortunately, no well-known cloud services offer apps for the Raspberry Pi, so your best bet is to upload your files via the Chromium browser.

But which service should you use?

Dropbox and Box are both available via the browser, but are slow. OneDrive and Google Drive, meanwhile, can barely be used. We’d suggest sticking to whichever you find the most useful.

3. Use a USB Drive

Another sensible choice is to use a USB drive. Simply insert a formatted drive into a spare USB slot in your Raspberry Pi, and wait for it to appear in the Raspbian file manager. If you’re using an older Pi or a Raspberry Pi ZeroGetting Started with Raspberry Pi ZeroGetting Started with Raspberry Pi ZeroWhether you bought a magazine with one glued to the front, or found a kit online, the chances are you're now the proud owner of a $5 computer: the Raspberry Pi Zero.Read More and are short of USB ports, then it’s time to employ a USB hub. While a standard USB hub will be fine for a USB flash device, note that a powered hub will be needed for devices that will draw power from the Pi.

With the USB drive inserted, it should automatically mount. If not, you’ll need to mount it manually. Begin by finding its unique ID:

ls -l /dev/disk/by-uuid/

Typically you’ll find an entry called sda1 (although this may differ), so keep a note of the name before proceeding.

Next, create a mount point. This is essentially a directory that will display the contents of the drive.

sudo mkdir /media/usb

(You don’t have to call it “usb” but it helps.)

Next, ensure the Pi user owns the folder. Otherwise, you won’t be able to view the contents!

sudo chown -R pi:pi /media/usb

You can then mount the drive with:

sudo mount /dev/sda1 /media/usb -o uid=pi,gid=pi

Once you’re done, you can easily copy files to the USB drive and, after safely ejecting, copy them to your main computer. To manually unmount use:

sudo umount /media/usb

4. Send and Receive Data With SCP

A little complicated to get working, the idea with this is that you can use the command line to send and receive data between your Raspberry Pi and your PC.

SFTP stands for SSH File Transfer Protocol, so as long as SSH is enabled on your Raspberry Pi (typically via the raspi-config screen) you can use SFTP for pushing and pulling files in the GUI.

With FileZilla running, open File > Site Manager, and click New Site. From here, enter the IP address of your Raspberry Pi in the Host box (or just raspberrypi.local if you have Bonjour services running).

Continue filling the form, selecting SFTP – SSH File Transfer Protocol for the Protocol and Normal for the Login Type. Enter the current Raspbian username and password for User and Password (by default this is pi and raspberry). You might want to click Rename to give the connection a descriptive name — this is particularly useful if you use FileZilla regularly.

As long as the Pi is already booted, you can click Connect to begin the connection. In FileZilla, the local device (your PC) is represented on the left, with the remote computer (your Raspberry Pi) on the right. You’ll need to browse through the directories on both sides to find the source and destination files. Once you’ve done this, you can copy files from your Raspberry Pi by dragging them to the left pane, or right-clicking and selecting Download.

(To copy files to the Pi, simply move them from left to right.)

Although a little fiddly to setup, we reckon SFTP is the best solution for transferring files to and from your Raspberry Pi.

Do you find transferring data between your PC and a Raspberry Pi troublesome? Have you tried any of these methods or do you have a trick of your own? Tell us in the comments!

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Edwin

November 16, 2017 at 7:57 pm

But wht if I keep getting those 'permission denied' messages? I changed to another user/password and connecting to the directory on the Pi is working, but whenever I try to move something there with Filezilla it gives the above message.

Hello nice tips, but I have a rather special request for help.
I want to download data from my pc to the RPi BUT
using Bash or - if need be - Python.
So I can dynamically load data files as and when needed.
In fact those data files could be scripts, python and pure data.
I would be most grateful for any tips!
3D

"Dropbox and Box are both available via the browser, but are slow. OneDrive and Google Drive, meanwhile, can barely be used. We’d suggest sticking to whichever you find the most useful."
Is #2 for reals? Use cloud but it's slow and or "can barely be used". Does Google not have a drive app you can run on the pi instead of using a browser?