If you mount a filesystem read-only, there is no way to modify it through filesystem operations. Not even if you're root. If you want to perform any modification (write to a file, remove a file, change permissions, update the access time, etc.), you have to remount the file system read-write (mount -o remount,rw /dev/foo
).
You can still access the underlying device and write to it. (It's a very bad idea, of course.)
Disks and partitions are only accessible by root unless you've explicitly changed this (usually a bad idea too).
One thing that doesn't come up very often is that the action of mounting itself might write to the disk. This can happen even with read-only mounts for journaled filesystems: if the filesystem was not cleanly unmounted, the action of mounting the filesystem may replay the journal and perform the queued actions (it does for ext3; I don't know about ntfs). This means you can't easily inspect the disk of a suspended machine (e.g. the disk image of a paused virtual machine viewed on the host, or a hibernating system from a rescue CD).
/etc/fstab
defines the default configuration. It lists default filesystem/mount point/option combinations. When you mount a filesystem, if you don’t specify complete parameters and options, mount
will read the options from your fstab
. For example, you can type
mount /dev/sda1
and mount
will know where to put it, and you can type
mount /mnt/sda1
and mount
will know where to find it. But if you want to be peculiar, you can type
mount /dev/sda1 /mnt/sdq17
and mount
will do that. Similarly, you can specify on the command line that a filesystem should be mounted read-only. Conversely, you can specify in /etc/fstab
that a filesystem should be mounted read-only by default, and then override that on the command line. And you can manually mount filesystems that aren’t in /etc/fstab
at all.
Also, /etc/fstab
identifies which filesystems are automatically mounted at boot time; they are mounted with their specified default options.
But also, just as you can type mount /dev/sda1 /mnt/sda1
, a program can execute mount
with a complete argument list, and then (in principle) mount
doesn’t need to access /etc/fstab
at all. And the operating system automagically knows where its root partition is, and automatically mounts the root filesystem very early in the boot process. In fact, if the OS needed /etc/fstab
to be accessible before it could do mounts, we’d have a chicken-and-egg problem, since /etc
isn’t accessible until the root filesystem has been mounted. The root partition is included in /etc/fstab
for the other reason that /etc/fstab
exists — to give fsck
a list of things to check.
Best Answer
You should be able to simply use