it-artikel:linux:how-to-mount-home-from-another-already-mounted-drive-or-volume-for-better-snaps-support
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


it-artikel:linux:how-to-mount-home-from-another-already-mounted-drive-or-volume-for-better-snaps-support [2022-08-31 12:30] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== How to mount home from another already mounted drive or volume for better snaps support ======
  
 +===== Something historic =====
 + 
 +"snaps" seem Canonical's/Ubuntu's prefered package format for easy and fast installation of desktop apps. However the whole snaps system often fails with errors if someone has moved the **/home/** directory to another drive or data volume. Especially if the **/home** is a symbolic link, instead of a real mount point. 
 +
 +Some users have their **/home** on a separate partition and simply "mount" the /home partition there. That does solve the snaps problem. However having a separate /home partition is not optimal when it comes to storage space management. 
 +
 +I personally prefer to have and maintain one or more large data volumes and put my **/home/** directory there, so all users share the same storage space. Until lately i approached that using a very old method of "moving" the /home/ somewhere else and symlinking it back to /home . But this is problematic, as mentioned before. snapd does not like this and fails installing or executing snap apps. 
 +
 +The solution to this problem are "bind mounts". (see **man mount** for bind)
 +
 +===== Solution: "bind mount" /home =====
 +
 +Today any great Linux distro should be able to support "bind mounts" to solve that. It means you can mount directories or even single files from within already mounted volumes multiple times to wherever you like to, without trouble or danger. 
 +
 +Instead of mounting "partitions" or "devices" we just mount "a source directory" to an arbitrary mount point. Like this:
 +
 +<code>
 +mount --verbose --bind /somevolume/home/ /home/
 +</code>
 +
 +Or if we prefer using **/etc/fstab** instead its like:
 +
 +<file fstab /etc/fstab>
 +...
 +
 +#
 +# put this at the very end of the fstab file
 +# after all system and data volumes has been
 +# mounted properly. 
 +#
 +/somevolume/home/ /home/ none bind
 +</file>
 +
 +
 +----
 +{{tag>linux ubuntu bind mount home snaps snapd snap fstab}}
it-artikel/linux/how-to-mount-home-from-another-already-mounted-drive-or-volume-for-better-snaps-support.txt · Last modified: 2022-08-31 12:30 by 127.0.0.1