Mount an external drive

Comments

8 comments

  • Avatar
    Andy Taylor

    Hey I might be a year late, but I've literally just did this on my Firewalla RED. 

     

    Here is a guide based on the notes I took whilst messing around to get this to work (took a couple of failed attempts and recovering the box back to factory to get it right)

    GUIDE:

    SSH into your Firewalla box and then first update and insall Samba, I used these two commands:

    # sudo apt-get update
    # sudo apt-get install samba samba-common python-glade2 system-config-samba

    Once installed, you then want to find your USB disk (make sure you have plugged it in!).


    # fdisk -l

    This will give you an output, the bottom line should be somthing like
    /dev/sda2 * 8192 15523839 15515648 7.4G b W95 FAT32

    Create a directory for your share:

    # sudo mkdir /media/usb-drive
    # sudo chmod 744 /media/usb-drive

    Now mount the drive (replace sda2 with whatever your drive comes up as from the fdisk -l command ran earlier):

    mount /dev/sda2 /media/usb-drive/

    test it worked by typing

    # mount

    If no output, it didn't work.

    To see whats on the drive,

    # cd /media/usb-drive

    Type the below to get a full listing

    # ls

    OK now back to the Samba set up,

    Create a permission for the sharing:
    # sudo chown -R nobody:nogroup /media/usb-drive/
    # sudo chmod -R 0775 /media/usb-drive/

    Copy the Samba default configuration file to a backup (in case you need to revert)

    # sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup

    Edit Samba configuration file

    # sudo vi /etc/samba/smb.conf

    Add the next lines to Samba configuration file (press "i" to enable input/edit):

    -----------------------------------------------------

    [global]
    workgroup = WORKGROUP
    server string = Samba Server %v
    netbios name = Firewalla-Box
    security = user

    [SambaShare]
    Comment = Samba Shared Directory
    path = /media/usb-drive
    writable = yes
    guest ok = yes
    read only = no
    force user = nobody

    -----------------------------------------------------

     

    Press Escape then save by typing

    :wq

    Restart Samba

    # sudo service smbd restart

     

    You should be good to log into the share

    type your path in file explorer (replace x with Firewalla's IP)

    \\192.168.1.x\sambashare

     

    0
    Comment actions Permalink
  • Avatar
    Paul van Laarhoven

    Thanks Andy!! Works like a charm!

    It seems the USB drive has to be formatted in ext4, otherwise the chown command doesn't work.

    0
    Comment actions Permalink
  • Avatar
    Alejandro Sánchez Márquez

    Wonderful, will be doing it. I already have a NAS but this can serve well for another purpose while being protected under the Firewalla umbrella.

    0
    Comment actions Permalink
  • Avatar
    Alexander Lai

    Can anyone take a picture or draw something to illustrate how the physical connections should be done before getting on?

    0
    Comment actions Permalink
  • Avatar
    Andy Taylor

    Here is a better/cleaner guide with screens. Just tried it it works fine.

     

    https://hackmypi.com/NASpi.php

    0
    Comment actions Permalink
  • Avatar
    Chris Hewitt

    You guys are working way too hard. Just use sshfs.

    I’m not a Samba fan - why install something new when the functionality already exists. But yes, there are times and places where samba is great - but not on tight lil Firewallas.

    SSHFS (SSH Filesystem) is a filesystem client based on FUSE for mounting remote directories over an SSH connection. SSHFS is using the SFTP protocol, which is a subsystem of SSH and it is enabled by default on most SSH servers.

    When compared to other network file system protocols such as NFS and Samba the advantage of SSHFS is that it does not require any additional configuration on the server side. To use SSHFS you only need SSH access to the remote server - which we already have.

    Because SSHFS uses SFTP , all transmitted data between the server and the client is encrypted and decrypted. This results with a slightly degraded performance compared to NFS, and higher CPU usage on the client and server.

    0
    Comment actions Permalink
  • Avatar
    Firewalla

    A quick note, CPU, and memory on these units (especially on the red/blue) are scarce resources, so use them wisely :)

     

    0
    Comment actions Permalink
  • Avatar
    Chris Hewitt

    And that’s why I ask for a waiver of liability on some of my posts :-)

    0
    Comment actions Permalink

Please sign in to leave a comment.