Dinâmica do produto
Dinâmica de atualização de imagem pública
Anúncio do produto
sudo parted -l /dev/sda | grep 'Partition Table'
msdos, the MBR partition is used. In this case, proceed to the next step.gpt, the GPT partition is used.sudo ls /sys/firmware/efi
/etc/grub2.cfg: it’s recommended to use uuid in the kernel parameter for mounting root. Other methods (such as root=/dev/sda) may cause a system startup failure./etc/fstab: no other disks are mounted. Otherwise, these disks may be lost and cause the system startup failure after migration./etc/shadow: granted with the read-write permissions.mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)dev on /dev type devtmpfs (rw,nosuid,relatime,size=4080220k,nr_inodes=1020055,mode=755)run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)/dev/sda1 on / type ext4 (rw,relatime,data=ordered)securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)systemd-1 on /home/libin/work_doc type autofs (rw,relatime,fd=33,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12692)systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=39,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12709)debugfs on /sys/kernel/debug type debugfs (rw,relatime)mqueue on /dev/mqueue type mqueue (rw,relatime)hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)tmpfs on /tmp type tmpfs (rw,nosuid,nodev)configfs on /sys/kernel/config type configfs (rw,relatime)tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=817176k,mode=700,uid=1000,gid=100)gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
/dev/sda1. No independent partitions reside in /boot or /home. sda1 contains the boot partition, and mbr is missing. Therefore, we only need to copy the entire sda./boot and /home are independent partitions in the current operating system, the exported image should also contain them.qemu-img commandqemu-img for CentOS.apt-get install qemu-utils
/dev/sda to /mnt/sdb/test.qcow2.sudo qemu-img convert -f raw -O qcow2 /dev/sda /mnt/sdb/test.qcow2
/mnt/sdb indicates the mounted new disk or another network storage.-O parameter to one of the following:Parameter Value | Description |
qcow2 | qcow2 format |
vhd | vhd format |
vmdk | vmdk format |
raw | No format |
dd commandsudo dd if=/dev/sda of=/mnt/sdb/test.imag bs=1K count=$count
count parameter specifies the number of partitions to be copied, which can be queried by running the fdisk command. To copy all partitions, ignore count.
For example, run the following command to view the number of partitions of /dev/sda.fdisk -lu /dev/sda
Disk /dev/sda: 1495.0 GB, 1494996746240 bytes255 heads, 63 sectors/track, 181756 cylinders, total 2919915520 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk identifier: 0x0008f290Device Boot Start End Blocks Id System/dev/sda1 * 2048 41945087 20971520 83 Linux/dev/sda2 41945088 46123007 2088960 82 Linux swap / Solaris/dev/sda3 46123008 88066047 20971520 83 Linux/dev/sda4 88066048 2919910139 1415922046 8e Linux LVM
fdisk command, the sda1 ends at 41945087 * 512 bytes, so set count to 20481 MB.dd command is in raw format. We recommend that you convert it to qcow2, vhd, or other image formats.qemu-img command.
For example, run the following command to convert the image in raw format to the qcow2 format.sudo qemu-img convert -f raw -O qcow2 test.img test.qcow2
-f is the source image file format.-O indicates the destination image format. For the supported formats, see -O Parameter Values.qemu-nbd to open QCOW2 images, and the Xen platform allows you to directly open VHD files. This document uses the Linux platform as an example:modprobe nbd
lsmod | grep nbd
CONFIG_BLK_DEV_NBD is enabled. If not, enable it or change the system before compiling the kernel again.

qemu-nbd -c /dev/nbd0 xxxx.qcow2
mount /dev/nbd0p1 /mnt
qemu-nbd command, /dev/nbd0 maps to xxx.qcow2, and /dev/nbd0p1 indicates the first partition of the virtual disk. If nbd0p1 does not exist or mount fails, the image may be incorrect.
You can also start the CVM to check whether the image file works before uploading the image.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários