Mount

From HalfgeekKB
(Redirected from Fstab)
Jump to navigation Jump to search

Template:Lowercase

mount is the unixish program that mounts volumes and volume-like files.

Mount an ISO image as a device

mount -o loop image.iso /media/image

Where image.iso is the image file and /media/image is a directory upon which to mount.

Mapping /tmp to a directory on another filesystem

To move /tmp from the system partition to the bigger home partition on my system, I did this:

  • Create the new target directory, here /home/.tmp
  • Set permissions (chown to root:root, chmod to 1777)
  • Add an entry to fstab after the entry for /home (see below)
  • Mount /tmp to its fstab setting (sudo mount /tmp)

This fstab entry must come after the parent filesystem of the target:

# Put /tmp on /home/.tmp
/home/.tmp	/tmp	none	bind

(The actual mount command for this is mount --bind /home/.tmp /tmp, but this isn't permanent.)