I'm putting together a simple daily backup script which rsyncs my home directory to a separate partition. I want to have the backup partition mounted at all times to allow browsing, however I also want it to be readonly so I don't mess it accidentally.
My initial plan was to mount the backup partition as readonly and bind mount it read-write in the tmp directory before the backup starts. Something like this:
mount -o ro /dev/sda1 /backup
# At start of each backup session
mount --bind /backup /tmp/backup12345
mount -o remount,rw /tmp/backup12345
This doesn't seem to work. The bind mount remains readonly despite remounting it read-write.
Can anyone suggest a solution to this? Appreciated.