File creation on mounted drives often needs sudo access. Issues with permissions can arise.
File creation on mounted drives often needs sudo access. Issues with permissions can arise.
The correct command is chown user:group file. Group is unnecessary unless you're using a multi-user configuration. Using sudo chown -R $USER /media/2TB will grant full ownership of the entire directory. Applying sudo chown $USER aptpackages.txt will only assign ownership to that specific file. If neither works, the drive might be mounted in read-only mode and you'll need to remount it. Use fdisk -l to check the drive, then create the desired path with sudo mount -o remount,rw /dev/pathtodrive. Finally, run chown -R $USER /yournewdirectory to secure ownership.
It's odd I have to manage the drive once it's mounted, but it seems to work now. Thanks!