I am wondering how to check if a directory (on my RaspberryPi) is on an external drive or not.
I think I mounted my WD MyPassport correctly, and was able to write to it via /media/pi/MyPassport. However, something happened and it created a
MyPassport1 folder, which seemed to actually be the external drive. So I have
/media/pi/MyPassport1 when the external is connected.
I removed my external drive and still can see (and access/read/write) to
/media/pi/MyPassport...so something happened that moved the external directory, and created
I'd like to include in the script I have that copies data to
MyPassport to first check if
/media/pi/MyPassport is indeed on an external drive, before copying.
Is that possible?
Edit: I know, now, that the external drive is called
.../MyPassport1, so could just see if that directory exists, then keep copying...but I'm asking more generally, is there a way to check if a directory is indeed an external drive connected via USB?