Recently I installed a 2TB usb drive on Ubuntu 20.04, and copied some files onto it. Now I would like to read those files in a Python program, but I can't get the path to the new drive.
The drive is /dev/sda1
, and it's mounted at /mnt/ssk2TB
. I have a USB key with files on it, and its path is /media/mpxt/A_MEDIA
. In /media/mpxt
I also have an entry for the new 2TB drive as /media/mpxt/6e9ee7e7-17af-4501-94aa-ffe6bb90c192
.
Lsblk
confirms it:
sda 8:0 0 1.8T 0 disk
└─sda1 8:1 0 1.8T 0 part /media/mpxt/6e9ee7e7-17af-4501-94aa-ffe6bb
Also,
ls -l /dev/disk/by-uuid
said its UUID is:
6e9ee7e7-17af-4501-94aa-ffe6bb90c192
, which matches.
I used that as a path:
fname = "/media/mpxt/6e9ee7e7-17-af-4501-94aa-ffe6bb90c192/Test_Data/Audit_Python/Python_Results"
testdata_fname = open(fname, 'rb')
I get this error message:
`FileNotFoundError: [Errno 2] No such file or directory: '/media/mpxt/6e9ee7e7-17af-4501-94aa-ffe6bb90c192/Test_Data/Audit_Python/Python_Results`
I can cd /media/mpxt/6e9ee7e7-17af-4501-94aa-ffe6bb90c192/Test_Data/Audit_Python
and get a listing of files. So why can't I use that path to open a file?
What do I use as a path for the USB drive described above?
Thanks for any help.