I want to force a disk partition to read only mode and keep it read-only for more than 30 minutes.
What I have tried:
mount -o remount,ro (partition-identifier) (mount-point) -t (filesystem)Issue: This gave device busy error as some processes were using the partition. I don't want to kill the processes using the disk. I want to simulate the disk suddenly going read-only when the processes are still using it.
Used magic sysrq key, like below
echo u > /proc/sysrq-triggerIssue: This will make all the disk partitions read-only (although device is busy). But after 20-30 minutes the machine is rebooting itself. Some machines are rebooting immediately once this command is executed. Not sure what is causing this reboot yet. I don't want the machine to reboot itself and need to keep the disk in read-only mode for 30+ minutes.
Question: Is there any better way I can force a single disk partition to read-only and sustain it in that state for half an hour and bring it back to read-write mode without causing any reboot in the process?