Hacker Public Radio

HPR4136: Pi Samba Share


Listen Later

We live in a time where everything is streamed; from our TV, radio,

podcasts everything is fine until the internet goes down. Gone are the
days of simply turning on the TV with a set top aerial. With this in
mind, I set up an old Raspberry Pi 2 and connected it to use as a video
and music server through a Samba share.

To complete this task you will need:

  • A Raspberry Pi
  • A micro-SD card
  • An Ethernet cable
  • An external hard drive (min 2TB recommended)
  • Step 1: Update your Pi software in the terminal:

    sudo apt update && sudo apt upgrade

    Step 2: To allow us to share our files over a network we will install

    Samba:

    sudo apt install samba

    Step 3: To find UUID and the file system of the drive, enter:

    sudo blkid

    Ignore the line with fat32, this is your Micro-SD

    card.

    Step 4: We need to mount this drive automatically whenever the

    Raspberry Pi is switched on. Firstly, we'll need to create a location to
    mount the external hard drive, we can do this by using the command:

    sudo mkdir /media/external

    Step 5: Now we need to edit the fstab to tell the Raspberry Pi to

    automount the external drive every time it is switched on

    sudo nano /etc/fstab

    Insert the following line at the bottom of the page:

    UUID="{the UUID you noted down in step 3}" /media/external {type noted in step 3} auto,user,rw 0 0

    The above should all be on one line, pressing the tab key to create a

    gap between each piece of information.

    Step 6: Now we need to set up which folders are going to be shared.

    I'll assume that we are going to make the whole of the external drive
    available over the network

    sudo nano /etc/samba/smb.conf

    At the bottom of the page add the following, note that you can call

    this anything you wish, just exchange the word external but you must
    include [ ]:

    [external]
    path = /media/external
    available= yes
    browsable = yes
    public = yes
    writable = yes

    It's worth noting before we continue that I've set the option

    writable = yes, this means that you can add to or remove
    the contents of the external drive over the network. If you are not
    comfortable having this option then simply change it to
    writable = no. Now save and exit (ctrl + X), make sure that
    you answer 'yes' to save your changes.

    Step 7: We will now set the Raspberry Pi to log in automatically on

    startup, if the user Pi isn't logged in then all of things we've just
    set up will not work. Type:

    sudo nano /etc/inittab

    Navigate down to the line:

    1:2345:respawn:/sbin/getty --noclear 38400 tty1

    and add --autologin pi after getty to make

    the line:

    1:2345:respawn:/sbin/getty --autologin pi --noclear 38400 tty1

    Save and exit (ctrl + X) make sure that you answer 'yes' to save

    it.

    Step 8: We can try it out our system and auto-login by using the

    command

    sudo reboot

    Assuming that everything goes well, your system should be up and

    running. Try and find it on a computer through the file manager. I
    personally recommend saving the Pi location on Kodi for an easy to use
    solution for browsing your media on a TV.

    ...more
    View all episodesView all episodes
    Download on the App Store

    Hacker Public RadioBy Hacker Public Radio

    • 4.2
    • 4.2
    • 4.2
    • 4.2
    • 4.2

    4.2

    34 ratings


    More shows like Hacker Public Radio

    View all
    Security Now (Audio) by TWiT

    Security Now (Audio)

    1,971 Listeners

    Off The Hook by 2600 Enterprises

    Off The Hook

    117 Listeners

    No Agenda Show by Adam Curry & John C. Dvorak

    No Agenda Show

    5,941 Listeners

    The Changelog: Software Development, Open Source by Changelog Media

    The Changelog: Software Development, Open Source

    283 Listeners

    LINUX Unplugged by Jupiter Broadcasting

    LINUX Unplugged

    265 Listeners

    BSD Now by JT Pennington

    BSD Now

    89 Listeners

    Open Source Security by Josh Bressers

    Open Source Security

    43 Listeners

    Late Night Linux by The Late Night Linux Family

    Late Night Linux

    154 Listeners

    The Linux Cast by The Linux Cast

    The Linux Cast

    35 Listeners

    Darknet Diaries by Jack Rhysider

    Darknet Diaries

    7,873 Listeners

    This Week in Linux by TuxDigital Network

    This Week in Linux

    36 Listeners

    Linux Dev Time by The Late Night Linux Family

    Linux Dev Time

    21 Listeners

    Hacking Humans by N2K Networks

    Hacking Humans

    314 Listeners

    2.5 Admins by The Late Night Linux Family

    2.5 Admins

    92 Listeners

    Linux Matters by Linux Matters

    Linux Matters

    20 Listeners