2014-10-17 35 views
0

我嘗試在克隆想改變根文件系統目錄:LXC-克隆:無法識別的選項 '--dir'

lxc-clone -o foo -n bar --dir /lxc/bar 

,但我得到這個錯誤:

lxc-clone: unrecognized option '--dir' 

然後我嘗試使用「 -B」選項和 「LVM」 值來設置根文件系統在LV:

lxc-clone -o foo -n bar -B lvm --vgname lxc-vg 

和我得到這個錯誤:

Error: vgname not supported 
Usage: lxc-clone [-s] [-B backingstore] [-L size[unit]] [-K] [-M] [-H] 
      [-p lxcpath] [-P newlxcpath] orig new 

    -s: snapshot rather than copy 
    -B: use specified new backingstore. Default is the same as 
     the original. Options include aufs, btrfs, lvm, overlayfs, 
     dir and loop 
    -L: for blockdev-backed backingstore, use specified size * specified 
     unit. Default size is the size of the source blockdev, default 
     unit is MB 
    -K: Keep name - do not change the container name 
    -M: Keep macaddr - do not choose a random new mac address 
    -p: use container orig from custom lxcpath 
    -P: create container new in custom lxcpath 

爲什麼我不能在「lxc-clone」中使用「--vgname」或「--dir」?
我在做什麼錯? 克隆容器時可以更改rootfs目錄嗎?

PS:我使用Ubuntu 14.04和LXC 1.0.5

回答

1

很久以前我還以爲這是在「啓動板」,因此報道中的錯誤。他們現在回答我,我發現我犯了一個很大的錯誤。

這裏從啓動板答案:

Hi,

"dir" is just an option of -b/--backingstore not an option itself.

So it has to be:

sudo lxc-clone -o u1 -n u1-clone2 -B dir 

or:

sudo lxc-clone -o u1 -n u1-clone4 --backingstore dir 

這裏的鏈接頁面:

https://bugs.launchpad.net/lxc/+bug/1383245

希望對大家有用