How to mount a qnx partition as read -write enabled only for executing particular lines of code?

StackOverflow https://stackoverflow.com/questions/13176361

  •  25-07-2021
  •  | 
  •  

質問

ie the partition of interest is already mounted as read-only.the partition need to be mounted as a rw enabled partition for executing particular lines of script alone.After that the partition should go to it's previous state of read only.

役に立ちましたか?

解決

To remout a partition read-write:

mount /mnt/mountpoint -oremount,rw

and to remout read-only

mount /mnt/mountpoint -oremount,ro

他のヒント

Question is for QNX operating system. And correct way to remount partition as read/write can be done using below command.

mount -uw /

you may be interested in remount option.

for example, this command is widely used in rooted androids.

mount -o remount,rw /system
mount -o remount,ro /system

mount(8) - Linux man page

Filesystem Independent Mount Options

remount

Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writeable. It does not change device or mount point.

The remount functionality follows the standard way how the mount command works with options from fstab. It means the mount command doesn't read fstab (or mtab) only when a device and dir are fully specified.

mount -o remount,rw /dev/foo /dir

After this call all old mount options are replaced and arbitrary stuff from fstab is ignored, except the loop= option which is internally generated and maintained by the mount command.

mount -o remount,rw /dir

After this call mount reads fstab (or mtab) and merges these options with options from command line ( -o ).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top