Access file after FS mounted on parent folder
I've set up debian to run in a read only envoirement. /var and /etc are ram drives. The way I do this is to run a boot script right after the usual boot mounting that mounts a ram disk(tmpfs specifically) on /etc and /var. I then mount the root partition a second time on /mnt/sda1 and copy over the contents from /mnt/sda1/etc to /etc and the contents from /mnt/sda1/var to /var. My problem is that mounting the same device twice has unpredictable results. Sometimes it works, sometimes it returns "mount: /dev/sda1 already mounted or /dev/sda1 busy"
I'm thinking the best way of fixing this issue is to not mount the root filesystem a second time, it's an ugly solution anyway. Is there anyway to access /etc on the device /dev/sda1 after a ram disk has been mounted on /etc?