Re: mount: Operation not permitted
- In reply to: Ronald F. Guilmette: "mount: Operation not permitted"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 30 Nov 2021 02:16:27 UTC
On 11/29/21 1:33 PM, Ronald F. Guilmette wrote: > I have a shell script that uses rsync to make backups of all of the > several partitions on my main drive to a second removable drive. > The script goes one-by-one through the partitions, mounting each > corresponding backup partition in turn, running rsync, and then > umount'ing that backup partition. > > Mostly this script works well, but every so often, seemingly at random, the > mount command for one or more of the backup partitions fails for no apparently > good reason, and I get the message "mount: Operation not permitted". If I > retry the same thing a little later it invariably works. > > What am I doing wrong and how can I fix it? rsync(1) and mount(8) are designed to work with filesystems, not partitions. Assuming your script goes one-by-one through the filesystems, perhaps a newly mounted filesystem is not quite ready when rsync(1) is invoked. I would try adding a time delay (e.g. 'sleep 10') before invoking rsync(1). David