remount / as ro after boot

So we have a compact flash setup of 6.3.2 with a root partition 20% of the drive and a log partition that is the remaining 80%.

I want to mount / remount the / partition as read only. When I run mount /dev/hd0t79 / -r it just bellows about resource is busy. I have killed all processes that could possibly have open files and yet it still complains. I see that fstab is listed in qnx docs but my setup seems to ignore it. What is the proper way to accomplish this?

Also I’d like to be able to run via command line a remount command in the event a binary needs changing.



The very mount command itself that you are running to set the drive as read-only is read from the CF drive thus making the drive ‘busy’. Plus your shell/command line prompt is most likely sitting in a directory on the very drive you want to unmount keeping the drive ‘busy’.

What you’ll need to do is create a RAM drive and copy the mount command (and any other commands that you might need to accomplish the read-only mount) into the RAM drive. Then ‘cd’ to your RAM drive and run the commands directly from the RAM drive with a ./ prefix so that it doesn’t path to the CF card.

If you still can’t unmount due to the resource being busy you can always copy devb-eide + mount command + other commands you might need into the RAM drive. Then slay devb-eide then restart devb-eide + mount as read-only. I don’t recommend this approach because it’s heavy handed compared to getting unmount to work but I’ve used it before successfully.

What I would suggest you do is mount the partition as read-only in your boot image. You indicated that you may have need to mount as writeable at some point if you need to update a binary so you’ll need to do the RAM drive exercise anyway but just for making the partition writeable instead of read-only.

Just be aware that programs like the system logger require write capabilites to the CF card (or a RAM drive) if you plan to run the system logger.