View Single Post
Old 10-31-2014, 02:14 AM   #1
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 457
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
Can someone please explain bind mounts to me?

I've been reading all over the web and still can't seem to get the info I want.

I want to make temporary changes to system files while a program is running.

For example, if I wanted to make a change to /usr/share/alsa/alsa.conf which is in the read-only system files, I want to "bind mount" and make a change to that file (with sed or whatever), then unmount it when I want. How do I do that?

I try:
touch alsa.conf
mount --bind /usr/share/alsa/alsa.conf alsa.conf
sed -ie s/cards.pcm.front/cards.pcm.default/g alsa.conf

error - cant move alsa.conf3ETwkI to alsa.conf -> obviously sed made a temp file and tried to move it to a read-only file.

Is this even possible? I'm thinking it's just the syntax I'm doing wrong?

edit: yep it's just the syntax. I made an edited rw file and can bind that to the ro system file.
ie: mount --bind bind/alsa.conf /usr/share/alsa/alsa.conf
that seems to work fine. I'll add it to my pianobar script...

Thanks anyway!

Last edited by brianinmaine; 10-31-2014 at 03:47 AM.
brianinmaine is offline   Reply With Quote