Editing Physical to container

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 114: Line 114:
 
=== /etc/fstab ===
 
=== /etc/fstab ===
 
Since you do not have any real disk partitions in a container, /etc/fstab (or most part of it) is no longer needed. Empty it (excluding the lines for <code>/dev/pts</code>, <code>/proc</code>, <code>/sys</code> and such):
 
Since you do not have any real disk partitions in a container, /etc/fstab (or most part of it) is no longer needed. Empty it (excluding the lines for <code>/dev/pts</code>, <code>/proc</code>, <code>/sys</code> and such):
<source lang="bash">
+
 
 
  mv /vz/private/123/etc/fstab /vz/private/123/etc/fstab.old
 
  mv /vz/private/123/etc/fstab /vz/private/123/etc/fstab.old
 
  egrep '/dev/pts|/dev/shm|/proc|/sys' /vz/private/123/etc/fstab.old > /vz/private/123/etc/fstab
 
  egrep '/dev/pts|/dev/shm|/proc|/sys' /vz/private/123/etc/fstab.old > /vz/private/123/etc/fstab
</source>
 
  
 
You can also mount a devpts in a running (but not fully functional) container:
 
You can also mount a devpts in a running (but not fully functional) container:
 
  vzctl exec 123 mount -t devpts none /dev/pts
 
  vzctl exec 123 mount -t devpts none /dev/pts
 
A still better approach would be simply to copy the <code>/etc/fstab</code> from a previously created container from a template of the same or similar distribution. In the case of RedHat/CentOS 5 this is:
 
<source lang="bash">
 
none    /dev/pts        devpts  rw      0      0
 
</source>
 
and for RedHat/CentOS 6:
 
<source lang="bash">
 
none    /dev/pts        devpts  rw,gid=5,mode=620      0      0
 
</source>
 
  
 
=== /dev ===
 
=== /dev ===

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: