Difference between revisions of "Mount"

From HalfgeekKB
Jump to navigation Jump to search
 
 
Line 21: Line 21:
  
 
  <nowiki># Put /tmp on /home/.tmp
 
  <nowiki># Put /tmp on /home/.tmp
/tmp /home/.tmp none bind</nowiki>
+
/home/.tmp /tmp none bind</nowiki>
  
(The actual mount command for this is <code>mount --bind /tmp /home/.tmp</code>, but this isn't permanent)
+
(The actual mount command for this is <code>mount --bind /home/.tmp /tmp</code>, but this isn't permanent.)

Latest revision as of 07:18, 9 January 2018

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.)