I'm fairly new to Ubuntu (I'm using 12.04) and I am looking for a way to make it so that when I boot from my USB stick the internal HDDs of the computer I'm using dont mount. I would also like to know if there is a good way to force all mounts to default as read only.
You need to edit
To have it mounted in readonly mode:
A complete manual for fstab is here, otherwise just google around!
You may find it best to use udev rules to ignore the HDD you want to ignore.
From this serverfault answer:
As root, open up /etc/udev/rules.d/60-persistent-storage.rules with your favorite text editor.
A few lines down, you'll probably see a line that looks like this:
# skip rules for inappropriate block devices KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end" Add "sdb*" to that second line, so it looks like this:
KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*|sdb*", GOTO="persistent_storage_end" Save the file and then reboot.
ErikA didn't have his system available to test this advice, and unfortunately I'm using a friends computer myself.
Many devices are now discovered by udev rather than relying on /etc/fstab, and that includes hard disks. Note that you may have to change sdb to the device you want to ignore (sda ?)
The udev man page has more information on udev rules, including how to change device permissions, which may be a good way to make such a device read-only.