Mounting and unmounting filesystems

QNX SDP8.0User's GuideUser

The following utilities work with filesystems:
mount
Mount a block-special device or remote filesystem.
umount
Unmount a device or filesystem.
For example, if a block device is attached to your system and the necessary block device (devb-*) driver is already running, you can mount a Power-Safe filesystem to access files on that device like this:
mount -t qnx6 /dev/hd0t177 /mnt

By default, filesystems are mounted as read-write if the physical media permit it. You can use the -r option for mount to mount the filesystem as read-only. The io-blk.so library also supports an ro option for mounting block I/O filesystems as read-only.

You can also use the -u option for mount to temporarily change the way the filesystem is mounted. For example, if a filesystem is usually mounted as read-only, and you need to remount it as read-write, you can update the mounting by specifying -uw. For example:
mount -uw /
To return to read-only mode, use the -ur options:
mount -ur /
Block device drivers can use io-blk.so to implicitly mount filesystem images that are stored as files on another filesystem owned by the same process. This is done through an implicit loopback mechanism handled internally by io-blk.so. Suppose you have a devb-* process that services a Power-Safe filesystem partition at /mnt/q6. You can then mount any filesystem type that's supported by the block driver and stored as an image file on that partition by doing:
mount -t type -o ... /mnt/q6/file.img /newmnt

By mounting file images in this way, you can treat them as applications or optional packages, which can be protected using QNX Trusted Disk. On other OSs, you have to take an extra step and create a loop device before you can mount a filesystem image.

If the image file is located on a foreign storage solution or serviced by a resource manager that's not based on a block device driver, then you have to use devb-loopback to wrap the image file with a block device driver before mounting it. This is done as follows:
devb-loopback fd=/mnt/q6/file.img ...
mount -t type -o ... /dev/lo0 /newmnt

You should use umount to unmount a read-write filesystem before removing or ejecting removable media.

See the Utilities Reference for details on usage and syntax.

Page updated: