I am compiling WRF on my HP Desktop. I'm in Ubuntu terminal and trying to use the cp command to copy from my D Drive, but it just won't work. Using cp D:\MyWRF/file.tar . All I get is cannot stat, Directory or file not found. I've tried switching \ to / but still no joy
-
I can assume you are running some kind of Linux you have not said. So there is no D drive that is a Windows construct. What version of Ubuntu are you using? It is unclear what you are truing to do. – David Oct 29 '22 at 08:25
-
See: Can I change directory to a Windows drive in Ubuntu Bash on WSL? – Nmath Oct 29 '22 at 08:36
2 Answers
Drives on Linux aren't addressed by a letter. Instead, you have to mount them first, to a folder, and then you can access them in that folder.
To mount a drive, go into the Disks program (you can find it by pressing the windows key and searching "Disks"), then select the disk you want on the left hand side. Click on the disk partition you would like to use. Then press the little play icon just below it. Just bellow the partitions, there should be a line that says "Contents" and next to it there should be something like "Mounted at /media/YOURUSERNAME/PARTITIONNAME
".
Then you would just be able to do cp /media/YOURUSERNAME/PARTITIONNAME/MyWRF/file.tar <your current working directory>
.
If you're mounting an NTFS drive, especially one with Windows on it, make sure to back up your data, since I've had some data corruption happen because of this.

- 118
Thanks all, I figured it out. It didn't recognise the drive, I needed to go to it via df -h