Linux Container referred to as LXC, compared with traditional virtualization technology, it has the advantages of low performance loss, no instruction level simulation, etc., and can also make file system, ie rootfs, the following small I will introduce you to the steps of making a file system for Linux Container.
First, create a file system mount table
1, ready directory
mkdir /lxc
then enter /lxc directory, Create a directory for the root file system
mkdir rootfs
Enter the /lxc/rootfs directory and create additional directories
1 mkdir bin dev etc lib lib64 proc sbin sys usr var< Br>
2, create a mount table
In the /lxc directory, create a new file fstab, edit the content as follows:
/bin /lxc/rootfs/bin none ro,bind 0 0
/sbin /lxc/rootfs/sbin none ro,bind 0 0
/lib /lxc/rootfs/lib none ro,bind 0 0
/lib64 /Lxc/rootfs/lib64 none ro,bind 0 0
/etc /lxc/rootfs/etc none ro,bind 0 0
/usr /lxc/rootfs/usr none ro,bind 0 0
/dev /lxc/rootfs/dev none rw,bind 0 0
/dev/pts /lxc/rootfs/dev/pts none rw,bind 0 0
/proc /lxc/rootfs/proc proc defaults 0 0
/sys /lxc/rootfs/sys sysfs defaults 0 0
The effect that the host operating system /bin /sbin /lib /etc directory like directory under corresponding loading /lxc /rootfs in.
Second, start lxc
1, edit lxc configuration file
Edit config file, the content is as follows
lxc.utsname = host_name
lxc.rootfs = /lxc/rootfs
lxc.mount = /lxc/fstab
2, start lxc, execute bash command
lxc-execute -n lxc1 - f config bash
This starts a Container named lxc1. Executing bash is equivalent to entering the Container. If the output is not normal at the terminal, use the command reset.
3, view lxc internal file system
bash-4.1# ls
bin data dev etc lib lib64 proc sbin sys usr var
We found only Can operate inside /lxc/rootfs.
The above is the introduction of the steps of the Linux Container file system. You need to create the file system and the mount table first, and then start the LXC and editor configuration files to implement the file system.
We all know that one computer can follow two different systems at the same time, that is, we call th
In the previous article, the su command was introduced. The su command is used for
Krita is a bit of graphics editing software, including a painting program and photo editor, can hand
LVM partitions are generally found in U disk, Linux systems access these partitions
How to solve the omitting directory error when copying files in Linux?
Linux offline query dictionary method
Linux installation GBK/GB2312 program shows garbled how to do?
Notes on operating online replacement files on Linux systems
Ubuntu how to access samba server without password
Linux installation using eCryptFS to encrypt files
How Ubuntu implements screen-to-cut
Linux installation of MariaDB database through Yum
How to upgrade Docker in Ubuntu system
Linux system startx command function and usage
Family Safety: Parental Control or “Parents are Controlled” (4)
Piracy Win7 is versatile New activation technology can curb Win7 piracy
Can server virtualization really save SMB costs?
Win10 switch account prompt error code 0x80070057 solution
How to install new fonts for Wind system
Win10 allows users to select the display of the resource manager
Turn off VASTA or WIN7 to open the folder and make a "beep" sound