2017年12月6日 星期三

Mount Physical Host file system to Container


Physical host file system and source build

1. Ensure Container is shutdown

2. Edit config file
$ sudo vi /var/lib/lxc/myHDP2/config
:::
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs = /var/lib/lxc/myHDP2/rootfs
lxc.rootfs.backend = dir
lxc.mount = /var/lib/lxc/myHDP2/fstab (Added it)
lxc.utsname = myHDP2
lxc.arch = amd64
:::

3. Edit fstab file
$ sudo cat /var/lib/lxc/myHDP2/fstab
/opt /var/lib/lxc/myHDP2/rootfs/opt none bind 0 0

4. Container power on
5. Check file system


Refer: Ubuntu 和 LXC Container 互相存取檔案
Read more: http://www.arthurtoday.com/2015/03/ubuntu-exchanges-data-with-containers.html#ixzz50XjXu0wFhttp://www.arthurtoday.com/2015/03/ubuntu-exchanges-data-with-containers.html

沒有留言:

張貼留言

check_systemv1.1

 check_systemv1.1.bat 可用於電腦資產盤點 @echo off REM 後續命令使用的是:UTF-8編碼 chcp 65001 echo ***Thanks for your cooperation*** echo ***感謝你的合作*** timeout 1...