Ubuntu: Sharing externally connected drives over network

Harry Lee

January 10, 2015

When you have external drives connected to the server, it would be very useful if you can share these drives to users accessing the server as well. This is useful if you have a home media server with externally connected drives.

This post aims to share drives that are NTFS formatted and changing the permissions of the mounted drives.

Method

  1. Unmount the drive that is connected already and remount to another folder giving permissions to users.

       $ sudo umount -l /dev/sdX1
    

    Where sdX1 is the device ID.

    To check the device ID, execute:

        $ df
    

    or

        $ lsblk
    

    Remount to another folder.

       $ sudo mount -t ntfs-3g -o rw /dev/sdX1 /media/path/to/folder
    

    This assumes that you are connecting a NTFS formatted drive.

  2. Change the permission of the mount point to allow access to users.

       $ sudo chown -R $USER:$USER /media/path/to/folder
    

    This gives permission, both read and write, to the logged in user that accesses the drive. You can adjust this accordingly.