We are using a network Samba drive for Backup on our Linux Server. In order to store permissions (Samba does not support this), we have created a loop device to a large file (50GB) on the network drive. This works fine most of the time, but every few weeks the loop device goes into readonly mode.
Here is the fstab snippet for network drive and loop drive:
//xyxyxy.your-backup.de/backup /backup cifs credentials=/root/backup-credentials,iocharset=utf8 0 0
/backup/backup.lp /backup-loop ext3 loop,sync,defaults,_netdev 0 0
I aldo tried standard loop configuration, but the problem maintains:
/backup/backup.lp /backup-loop ext3 loop,sync 0 0
Our assumption: As far as I know the mounted drive goes into readonly mode when the connection to the physical device is lost. Thus when the network drive loses connection, the loop file is gone and the loop mount goes into readonly mode. The cifs handles reconnecting of its own mount, but loop knows nothing about it.
Our current solution is to force remount of both samba and loop device shortly before our cronjob would start the backup process. This works, but doesn't feel right.
Is there a possibility to trigger remount of loop device when the target loop file gets back online?
mount -o rw,remount /backup-loop
doesn't help once it's broken? You could run that before starting the backup job just in case.-o hard