Troubleshooting Storage Space Error while Copying Files in File Explorer, WSL, and Ubuntu Server 24.04
In this article, we will diagnose and solve the storage space error issue that occurs while copying files in File Explorer, Windows Subsystem for Linux (WSL), and Ubuntu Server 24.04. Specifically, we will focus on a scenario where a Plex server is running on Ubuntu Server 24.04 and formatted a brand new 8TB NAS drive using the EXT4 file system to store media files. The user has also set up WSL on a Windows 11 machine and wants to access the NAS drive for file operations.
Setting up the NAS drive in Ubuntu Server 24.04
Assuming that the NAS drive has already been formatted using the EXT4 file system, we will start by connecting it to the Ubuntu Server 24.04 system. Then, we will mount the NAS drive to the server's file system, allowing the server to access and manage the files stored in the drive.
# Connect the NAS drive to the Ubuntu Server system
# Identify the NAS drive using lsblk or fdisk -l
# Create a mount point, e.g., /mnt/nas
# Mount the NAS drive to the mount point using mount /dev/sdX1 /mnt/nas
Accessing the NAS drive in WSL
To access the NAS drive via WSL, we must ensure that the WSL system shares the same network environment as the Ubuntu Server system. By default, WSL runs in a separate network environment, preventing it from accessing the Ubuntu Server's resources.
To share the network environment, follow these steps:
# Open the Windows Terminal as an administrator
# Run wsl --shutdown to shut down the WSL environment
# Open the C:\Windows\System32\etc\wsl.conf file in a text editor
# Add the following lines:
[network]
generateResolvConf = false
sharedNetowrk = true
# Save and close the file
# Restart the WSL environment
Now, when accessing the NAS drive in WSL, we can use the IP address of the Ubuntu Server system, the mount point, and the network credentials:
# Access the NAS drive in WSL:
smb://192.168.0.100/mnt/nas -U username
copying files between the Windows host and the NAS drive via WSL
Now that we have access to the NAS drive via WSL, we can transfer files between the host system (Windows) and the NAS drive. We will use the cp command to transfer the files:
# Copy a file from the Windows host to the NAS drive:
cp /mnt/c/users/username/file.txt /mnt/nas/file.txt