1

How can I ”mount” an Audio CD in a Linux terminal or in a Bash script? When I insert my CD and open Thunar (the Xfce default file browser) and click the CD icon, I can see all the tracks as ”Track 1.wav”, ”Track 2.wav” and so on. In a terminal I can find these in $XDG_RUNTIME_DIR/gvfs/cdda:host=sr0/. So far so good, but if I insert the CD without doing the Thunar magics, that directory doesn't exist. It seems like it needs to be ”mounted” first. I know that an audio CD doesn't have a file system and isn't really ”mounted”, but Thunar obviously does something to make those tracks available. Whatever that is, I want to do that in my terminal or in a script. How can I do that? Preferably by not installing anything else; if Thunar can do it, the terminal should be able to do it, right?

I use Manjaro Linux with Xfce.

Example:

~ $ LC_ALL=C ls $XDG_RUNTIME_DIR/gvfs/cdda:host=sr0
ls: cannot access '/run/user/1000/gvfs/cdda:host=sr0': No such file or directory
~ $ 

Then I open Thunar and click the Audio CD icon in the left panel. Those tracks appear as wav files in the main panel, which is expected and great. And now let's go back to the terminal and do the same thing again:

~ $ LC_ALL=C ls $XDG_RUNTIME_DIR/gvfs/cdda:host=sr0
Track 1.wav  Track 2.wav  Track 3.wav  Track 4.wav  Track 5.wav  Track 6.wav  Track 7.wav
~ $

So there they are, I can even copy them using the cp command, but it would be nice if I could do all this without involving a file browser.

1 Answer 1

2

I finally found the answer: GIO.

gio mount cdda://sr0/

Unmounting:

gio mount --unmount cdda://sr0/

List contents:

~ $ gio list cdda://sr0/
Track 1.wav
Track 2.wav
Track 3.wav
Track 4.wav
Track 5.wav
Track 6.wav
Track 7.wav
~ $

More information:

man gio

or

gio --help

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .