Changes

659 bytes added ,  09:41, 16 May 2022
no edit summary
Line 48: Line 48:     
With this CRIU will bind mount the /foo into proper mountpoint.
 
With this CRIU will bind mount the /foo into proper mountpoint.
 +
 +
Note: Mounts from same superblock should remain mounts from same superblock after migration. Options `--external mnt[smth]:/smth` force criu to bindmount from the provided source, that can lead to mounts, which were from the same supperblock before dump, appear to be from different supperblock after restore, which is wrong so these option should be used carefully (can break sharing groups restore).
    
== Auto detection ==
 
== Auto detection ==
Line 62: Line 64:  
: Also enable dumping of external shared mounts (as in <code>mount --make-shared</code>)
 
: Also enable dumping of external shared mounts (as in <code>mount --make-shared</code>)
   −
By default, neither master nor shared external mounts are not dumped (if found, dump is aborted). Note if <code>''flags''</code> are not given, semicolon is optional.
+
By default, neither master nor shared external mounts are dumped (if found, dump is aborted). Note if <code>''flags''</code> are not given, semicolon is optional.
    
=== Examples ===
 
=== Examples ===
Line 68: Line 70:  
  criu dump ... --external 'mnt[]'
 
  criu dump ... --external 'mnt[]'
   −
Auto detect and dump all external bind mounts.
+
Auto-detect and dump all external bind mounts.
    
  criu dump ... --external 'mnt[]:s'
 
  criu dump ... --external 'mnt[]:s'
   −
Auto detect and dump all external bind mounts, including the shared ones.
+
Auto-detect and dump all external bind mounts, including the shared ones.
    
  criu dump ... --external 'mnt[]:sm'
 
  criu dump ... --external 'mnt[]:sm'
   −
Auto detect and dump all external bind mounts, including the shared and the master ones.
+
Auto-detect and dump all external bind mounts, including the shared and the master ones.
 
  −
== Old days ==
  −
 
  −
For now the same behavior is configured with the <code>--ext-mount-map KEY:VAL</code> option. Soon this option will be [[deprecation|deprecated]].
  −
 
  −
[[Category:HOWTO]]
  −
[[Category:External]]
     −
=== Sharing for external bindmounts ===
+
== Sharing ==
    
External bindmounts can both have internal/external sharing. Please see the example:
 
External bindmounts can both have internal/external sharing. Please see the example:
Line 133: Line 128:  
  # 899 843 0:5 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
 
  # 899 843 0:5 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
   −
Mounts 812 (on host) and 861 (in container) have the same sharing (shared group) - external sharing and mount 898 has it's own local shared group - internal sharing.
+
Mounts 812 (on the host) and 861 (in a container) have the same sharing (shared group) - external sharing and mount 898 has it's own local shared group - internal sharing. Same is applicable for master_ids, if we convert them into slaves external/internal shared_id would convert to external/internal master_id.
 +
 
 +
[https://criu.org/Mount-v2 Mount-v2] is introducing a better support of external sharing:
 +
 
 +
- External sharing is not supported (converted to internal sharing after c/r) as reasonable container environments should not allow it due to security reasons, and implementing it's lookup would lead to bad performance (host mountinfo reading).
 +
 
 +
- External slavery is supported for mountpoint external mounts and the root mount. It is detected when criu can't lookup master_id of the mount across shared_ids in container mount namespaces. CRIU relies that mountpoint external source provides right shared/slave mount to copy sharing from. Everything else is considered as internal sharing/slavery.
 +
 
 +
== Old days ==
   −
Before [https://github.com/checkpoint-restore/criu/pull/906 #906] we were detecting this external/internal sharing state for auto detected external mounts only, but we need it for manual external mounts too. Moreover this also applies to manual external slave mounts they can be external/internal slaves too.
+
For now the same behavior is configured with the <code>--ext-mount-map KEY:VAL</code> option. Soon this option will be [[deprecation|deprecated]].
   −
So we detect that the mount is from external sharing if in mount namespace of CRIU there are mounts of same shared group and also we detect that the mount is from external slavery if there is no master mount for it in CT mount namespaces.
+
[[Category:HOWTO]]
 +
[[Category:External]]
37

edits