Mount External Disk on Ubuntu and Map it on Windows as a Network Drive

Introduction

This guide shows you through how to mount an external USB disk on an Ubuntu system and then access it from a Windows computer by mapping it as a network drive via SSH.
You don’t need to set up Samba or NFS — just SSH, which is often already available on Linux.


Part 1: Mount the External Disk on Ubuntu

  1. Identify the USB device (e.g., /dev/sdb1):

    1
    2
    3
    4
    5
    # lsblk is a command-line utility in Linux that lists information about all available or specified block devices in a tree-like format.
    $ lsblk

    # blkid is a command-line tool used to display or locate block devices by their UUID, LABEL, or filesystem type.
    $ sudo blkid
  2. Create a mount directory (we’ll name it ext_disk):

    1
    $ sudo mkdir /mnt/ext_disk
  3. Mount the external disk to that directory:

    1
    2
    # Example: the external disk is /dev/sdb1
    $ sudo mount /dev/sdb1 /mnt/ext_disk
  4. To unmount the disk:

    1
    $ sudo umount /mnt/ext_disk

Part 2: Map the Ubuntu Disk on Windows as a Network Drive

  1. Install sshfs-win (allows Windows to mount drives over SSH):

    • Download and install it from the GitHub release page

    • Or use the Windows terminal to install via winget:

      1
      $ winget install SSHFS-Win.SSHFS-Win
  2. Map the Ubuntu disk as a Windows drive (e.g., Z:):

    1
    2
    # If you don't specify !PORT, the default is port 22
    $ net use Z: \\sshfs.r\<USERNAME>@<IP>!<PORT> /user:<USERNAME>

    🧩 To map a specific path (e.g., /mnt/ext_disk):

    1
    $ net use Z: \\sshfs.r\<USERNAME>@<IP>!<PORT>\/mnt/ext_disk /user:<USERNAME>
  3. To unmount the network drive:

    1
    $ net use Z: /delete

Tips for Beginners

  • Replace <USERNAME> with your Ubuntu username.
  • Replace <IP> with the IP address of your Ubuntu machine (e.g., 192.168.1.100).
  • Check that:
    • SSH is running on Ubuntu (sudo systemctl status ssh)
    • Port 22 is not blocked by a firewall
    • You have permission to access the mounted directory
  • Make sure your Windows and Ubuntu machines are on the same network, or that the Ubuntu server is publicly accessible.