libguestfs手册(1): 架构

2023-06-14,,

要编辑一个image,则运行下面的命令

guestfish -a ubuntutest.img

><fs>

会弹出一个命令行工具

运行run

><fs> run

我们来ps一下进程

root# ps aux | grep guest
root     11697  0.0  0.0  96216  4604 pts/0    S+   02:14   0:00 guestfish -a ubuntutest.img
root     11832  7.0  0.1 1912136 99384 pts/0   Sl   02:14   0:02 /usr/bin/qemu-system-x86_64 -global virtio-blk-pci.scsi=off -nodefconfig -enable-fips -nodefaults -nographic -machine accel=kvm:tcg -m 500 -no-reboot -rtc driftfix=slew -no-hpet -no-kvm-pit-reinjection -kernel /var/tmp/.guestfs-0/kernel.11697 -initrd /var/tmp/.guestfs-0/initrd.11697 -device virtio-scsi-pci,id=scsi -drive file=ubuntutest.img,cache=writeback,id=hd0,if=none -device scsi-hd,drive=hd0 -drive file=/var/tmp/.guestfs-0/root.11697,snapshot=on,id=appliance,cache=unsafe,if=none -device scsi-hd,drive=appliance -device virtio-serial-pci -serial stdio -device sga -chardev socket,path=/tmp/libguestfsi7ht7F/guestfsd.sock,id=channel0 -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 -append panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 TERM=linux
root     11833  0.0  0.0  96212  1300 pts/0    S    02:14   0:00 guestfish -a ubuntutest.img

由此看出libguestfs的架构

guestfish -a ubuntutest.img启动的进程,也即那个交互命令行是main program,当运行run的时候,会创建一个child process,在child process中,qemu运行一个称为appliance的小的虚拟机。创建子进程是由guestfs_launch函数完成的。

在appliance中,运行了linux kernel和一系列用户空间的工具(LVM, ext2等),以及一个后台进程guestfsd。

main process中的libguestfs和这个guestfd通过RPC进行交互。

由child process的kernel来操作disk image

Normally when you run libguestfs on a disk image, we launch a qemu process running a small custom appliance. Inside the appliance is a Linux kernel, Linux userspace tools (like mkfs, parted, LVM), and a daemon called guestfsd.

By the way, it’s a common mistake for people to think that the qemu process is the virtual machine. It’s not the VM. It’s a custom, minimal appliance containing our own tools, and the VM is not running.

Although we used fork to run qemu, we don’t talk to the daemon over stdin/stdout. We use a fast virtio-serial port instead.

Across the virtio-serial port, we send simple commands using an efficient XDR-based remote protocol. Many libguestfs API functions directly map to remote procedure calls in this protocol.

For example, calling guestfs_mkfs in the library, translates to a mkfs remote procedure call over the virtio-serial port, and ultimately guestfsd runs the mkfs command inside the appliance.

libguestfs是一个C的library, 你可以写一个C的程序,将这个类库加载进去,调用它的API。文档http://libguestfs.org/guestfs.3.html就描述了这些C的API。

而guestfish是一个交互命令行,可以通过执行命令,他来调用C类库的API,帮我们完成操作。文档http://libguestfs.org/guestfish.1.html描述了这些命令,几乎所有的API,都有对应的命令。

APPLIANCE BOOT PROCESS

In order to follow the stages involved below, enable libguestfs debugging (set the environment variable LIBGUESTFS_DEBUG=1).

export LIBGUESTFS_DEBUG=1

guestfish -a ubuntutest.img

然后在里面运行run,打印出了很多的log,可以显示下面的过程

Create the appliance

supermin --build is invoked to create the kernel, a small initrd and the appliance.

The appliance is cached in /var/tmp/.guestfs-<UID> (or in another directory if LIBGUESTFS_CACHEDIR or TMPDIR are set).

For a complete description of how the appliance is created and cached, read the supermin(1) man page.
Start qemu and boot the kernel

qemu is invoked to boot the kernel.
Run the initrd

supermin --build builds a small initrd. The initrd is not the appliance. The purpose of the initrd is to load enough kernel modules in order that the appliance itself can be mounted and started.

The initrd is a cpio archive called /var/tmp/.guestfs-<UID>/appliance.d/initrd.

When the initrd has started you will see messages showing that kernel modules are being loaded, similar to this:

 supermin: ext2 mini initrd starting up
supermin: mounting /sys
supermin: internal insmod libcrc32c.ko
supermin: internal insmod crc32c-intel.ko

Find and mount the appliance device

The appliance is a sparse file containing an ext2 filesystem which contains a familiar (although reduced in size) Linux operating system. It would normally be called /var/tmp/.guestfs-<UID>/appliance.d/root.

The regular disks being inspected by libguestfs are the first devices exposed by qemu (eg. as /dev/vda).

The last disk added to qemu is the appliance itself (eg. /dev/vdb if there was only one regular disk).

Thus the final job of the initrd is to locate the appliance disk, mount it, and switch root into the appliance, and run /init from the appliance.

If this works successfully you will see messages such as:

 supermin: picked /sys/block/vdb/dev as root device
supermin: creating /dev/root as block special 252:16
supermin: mounting new root on /root
supermin: chroot
Starting /init script ...

Note that Starting /init script ... indicates that the appliance's init script is now running.

Initialize the appliance

The appliance itself now initializes itself. This involves starting certain processes like udev, possibly printing some debug information, and finally running the daemon (guestfsd).

The daemon

Finally the daemon (guestfsd) runs inside the appliance. If it runs you should see:

 verbose daemon enabled

The daemon expects to see a named virtio-serial port exposed by qemu and connected on the other end to the library.

The daemon connects to this port (and hence to the library) and sends a four byte message GUESTFS_LAUNCH_FLAG, which initiates the communication protocol (see below).

root:# export LIBGUESTFS_DEBUG=1
root:# guestfish -a ubuntutest.img
libguestfs: create: flags = 0, handle = 0x1942830, program = guestfish

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run

#启动guestfish

libguestfs: launch: program=guestfish
libguestfs: launch: version=1.24.5
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfsg4qzER
libguestfs: launch: umask=0022
libguestfs: launch: euid=0

#run supermin

libguestfs: command: run: /usr/bin/supermin-helper
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ -f checksum
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib/guestfs/supermin.d
supermin helper [00000ms] whitelist = (not specified)
supermin helper [00000ms] host_cpu = x86_64
supermin helper [00000ms] dtb_wildcard = (not specified)
supermin helper [00000ms] inputs:
supermin helper [00000ms] inputs[0] = /usr/lib/guestfs/supermin.d
supermin helper [00000ms] outputs:
supermin helper [00000ms] kernel = (none)
supermin helper [00000ms] dtb = (none)
supermin helper [00000ms] initrd = (none)
supermin helper [00000ms] appliance = (none)

#选择kernel

checking modpath /lib/modules/3.13.0-27-generic is a directory
checking modpath /lib/modules/3.13.0-24-generic is a directory
checking modpath /lib/modules/3.13.0-27-generic is a directory
checking modpath /lib/modules/3.13.0-24-generic is a directory
picked kernel vmlinuz-3.13.0-27-generic.efi.signed
supermin helper [00000ms] finished creating kernel

#选择initrd, root images, 创建appliance

supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/base.img
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/daemon.img.gz
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d/hostfiles
supermin helper [00015ms] visiting /usr/lib/guestfs/supermin.d/init.img
supermin helper [00015ms] visiting /usr/lib/guestfs/supermin.d/udev-rules.img
supermin helper [00015ms] adding kernel modules
supermin helper [00067ms] finished creating appliance
libguestfs: checksum of existing appliance: ba13dfd651367e8d7658388ecf86813d4f57285b5edd09daea04961ced636040

#检测qemu

libguestfs: [00071ms] begin testing qemu features
libguestfs: command: run: /usr/bin/qemu-system-x86_64
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -help
libguestfs: command: run: /usr/bin/qemu-system-x86_64
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -version
libguestfs: qemu version 2.0
libguestfs: command: run: /usr/bin/qemu-system-x86_64
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -machine accel=kvm:tcg
libguestfs: command: run: \ -device ?
libguestfs: [00122ms] finished testing qemu features

#启动qemu appliance

[00123ms] /usr/bin/qemu-system-x86_64 \
    -global virtio-blk-pci.scsi=off \
    -nodefconfig \
    -enable-fips \
    -nodefaults \
    -nographic \
    -machine accel=kvm:tcg \
    -m 500 \
    -no-reboot \
    -rtc driftfix=slew \
    -no-hpet \
    -no-kvm-pit-reinjection \

#appliance缓存在/var/tmp/.guestfs-<UID>

-kernel /var/tmp/.guestfs-0/kernel.8754 \
    -initrd /var/tmp/.guestfs-0/initrd.8754 \
    -device virtio-scsi-pci,id=scsi \

#你的image是第一个disk

-drive file=ubuntutest.img,cache=writeback,id=hd0,if=none \
    -device scsi-hd,drive=hd0 \

#第二个是appliance的disk

-drive file=/var/tmp/.guestfs-0/root.8754,snapshot=on,id=appliance,cache=unsafe,if=none \
    -device scsi-hd,drive=appliance \

-device virtio-serial-pci \
    -serial stdio \
    -device sga \
    -chardev socket,path=/tmp/libguestfsg4qzER/guestfsd.sock,id=channel0 \
    -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
    -append 'panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=linux'
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
Could not open option rom 'sgabios.bin': No such file or directory
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.13.0-27-generic (buildd@akateko) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 (Ubuntu 3.13.0-27.50-generic 3.13.11)
[    0.000000] Command line: panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=linux
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001f3fdfff] usable
[    0.000000] BIOS-e820: [mem 0x000000001f3fe000-0x000000001f3fffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 2.4 present.
[    0.000000] Hypervisor detected: KVM
[    0.000000] No AGP bridge found
[    0.000000] e820: last_pfn = 0x1f3fe max_arch_pfn = 0x400000000
[    0.000000] PAT not supported by CPU.
[    0.000000] found SMP MP-table at [mem 0x000f0b60-0x000f0b6f] mapped at [ffff8800000f0b60]
[    0.000000] Scanning 1 areas for low memory corruption
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000] init_memory_mapping: [mem 0x1f000000-0x1f1fffff]
[    0.000000] init_memory_mapping: [mem 0x1c000000-0x1effffff]
[    0.000000] init_memory_mapping: [mem 0x00100000-0x1bffffff]
[    0.000000] init_memory_mapping: [mem 0x1f200000-0x1f3fdfff]
[    0.000000] RAMDISK: [mem 0x1f27c000-0x1f3eefff]
[    0.000000] No NUMA configuration found
[    0.000000] Faking a node at [mem 0x0000000000000000-0x000000001f3fdfff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x1f3fdfff]
[    0.000000]   NODE_DATA [mem 0x1f3f9000-0x1f3fdfff]
[    0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[    0.000000] kvm-clock: cpu 0, msr 0:1f3f5001, boot clock
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009efff]
[    0.000000]   node   0: [mem 0x00100000-0x1f3fdfff]
[    0.000000] SFI: Simple Firmware Interface v0.81 http://simplefirmware.org
[    0.000000] Intel MultiProcessor Specification v1.4
[    0.000000] MPTABLE: OEM ID: BOCHSCPU
[    0.000000] MPTABLE: Product ID: 0.1        
[    0.000000] MPTABLE: APIC at: 0xFEE00000
[    0.000000] Processor #0 (Bootup-CPU)
[    0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[    0.000000] Processors: 1
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
[    0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[    0.000000] e820: [mem 0x1f400000-0xfeffbfff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on KVM
[    0.000000] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:1 nr_node_ids:1
[    0.000000] PERCPU: Embedded 29 pages/cpu @ffff88001f000000 s86336 r8192 d24256 u2097152
[    0.000000] kvm-clock: cpu 0, msr 0:1f3f5001, primary cpu clock
[    0.000000] KVM setup async PF for cpu 0
[    0.000000] kvm-stealtime: cpu 0, msr 1f00dfc0
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 125879
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=linux
[    0.000000] Disabling memory control group subsystem
[    0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[    0.000000] Checking aperture...
[    0.000000] No AGP bridge found
[    0.000000] Memory: 485188K/511600K available (7354K kernel code, 1142K rwdata, 3396K rodata, 1332K init, 1440K bss, 26412K reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] \tRCU dyntick-idle grace-period acceleration is enabled.
[    0.000000] \tRCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=1.
[    0.000000] \tOffload RCU callbacks from all CPUs
[    0.000000] \tOffload RCU callbacks from CPUs: 0.
[    0.000000] NR_IRQS:16640 nr_irqs:256 16
[    0.000000] Console: colour *CGA 80x25
[    0.000000] console [ttyS0] enabled
[    0.000000] tsc: Detected 2793.268 MHz processor
[    0.008000] Calibrating delay loop (skipped) preset value.. 5586.53 BogoMIPS (lpj=11173072)
[    0.008000] pid_max: default: 32768 minimum: 301
[    0.008000] Security Framework initialized
[    0.008000] AppArmor: AppArmor initialized
[    0.008000] Yama: becoming mindful.
[    0.008000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.008118] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[    0.008946] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[    0.009692] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[    0.010610] Initializing cgroup subsys memory
[    0.011117] Initializing cgroup subsys devices
[    0.011624] Initializing cgroup subsys freezer
[    0.012005] Initializing cgroup subsys blkio
[    0.012490] Initializing cgroup subsys perf_event
[    0.013021] Initializing cgroup subsys hugetlb
[    0.013589] mce: CPU supports 10 MCE banks
[    0.014100] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.014100] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.014100] tlb_flushall_shift: 6
[    0.029713] Freeing SMP alternatives memory: 32K (ffffffff81e6c000 - ffffffff81e74000)
[    0.034709] ftrace: allocating 28458 entries in 112 pages
[    0.044235] Enabling x2apic
[    0.044571] Enabled x2apic
[    0.045055] Switched APIC routing to physical x2apic.
[    0.048310] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.048977] smpboot: CPU0: Intel QEMU Virtual CPU version 2.0.0 (fam: 06, model: 06, stepping: 03)
[    0.161682] Performance Events: Broken PMU hardware detected, using software events only.
[    0.162753] Failed to access perfctr msr (MSR c1 is 0)
[    0.164616] x86: Booted up 1 node, 1 CPUs
[    0.165077] smpboot: Total of 1 processors activated (5586.53 BogoMIPS)
[    0.166059] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.166856] devtmpfs: initialized
[    0.169739] EVM: security.selinux
[    0.170125] EVM: security.SMACK64
[    0.170496] EVM: security.ima
[    0.170830] EVM: security.capability
[    0.171949] pinctrl core: initialized pinctrl subsystem
[    0.172052] regulator-dummy: no parameters
[    0.172580] RTC time:  8:07:48, date: 07/09/14
[    0.173102] NET: Registered protocol family 16
[    0.173698] cpuidle: using governor ladder
[    0.174163] cpuidle: using governor menu
[    0.174736] PCI: Using configuration type 1 for base access
[    0.176549] bio: create slab <bio-0> at 0
[    0.177093] ACPI: Interpreter disabled.
[    0.177580] vgaarb: loaded
[    0.178011] SCSI subsystem initialized
[    0.178490] usbcore: registered new interface driver usbfs
[    0.179114] usbcore: registered new interface driver hub
[    0.179720] usbcore: registered new device driver usb
[    0.180068] PCI: Probing PCI hardware
[    0.180507] PCI host bridge to bus 0000:00
[    0.180970] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    0.181650] pci_bus 0000:00: root bus resource [mem 0x00000000-0xffffffffff]
[    0.182422] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.187606] pci 0000:00:01.3: quirk: [io  0xb000-0xb03f] claimed by PIIX4 ACPI
[    0.188011] pci 0000:00:01.3: quirk: [io  0xb100-0xb10f] claimed by PIIX4 SMB
[    0.200378] pci 0000:00:01.0: PIIX/ICH IRQ router [8086:7000]
[    0.201167] NetLabel: Initializing
[    0.201555] NetLabel:  domain hash size = 128
[    0.202036] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.202593] NetLabel:  unlabeled traffic allowed by default
[    0.203274] Switched to clocksource kvm-clock
[    0.203774] AppArmor: AppArmor Filesystem Enabled
[    0.204314] pnp: PnP ACPI: disabled
[    0.205622] NET: Registered protocol family 2
[    0.206219] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.207011] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[    0.207741] TCP: Hash tables configured (established 4096 bind 4096)
[    0.208467] TCP: reno registered
[    0.208832] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.209475] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.210196] NET: Registered protocol family 1
[    0.210691] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    0.211351] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    0.211995] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    0.212761] Trying to unpack rootfs image as initramfs...
[    0.214277] Freeing initrd memory: 1484K (ffff88001f27c000 - ffff88001f3ef000)
[    0.215132] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.216041] microcode: CPU0 sig=0x663, pf=0x1, revision=0x1
[    0.216698] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    0.217661] Scanning for low memory corruption every 60 seconds
[    0.218429] Initialise system trusted keyring
[    0.218955] audit: initializing netlink socket (disabled)
[    0.219555] type=2000 audit(1404893268.160:1): initialized
[    0.242451] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.243814] zbud: loaded
[    0.244223] VFS: Disk quotas dquot_6.5.2
[    0.244700] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.245699] fuse init (API version 7.22)
[    0.246191] msgmni has been set to 950
[    0.246653] Key type big_key registered
[    0.247246] Key type asymmetric registered
[    0.247713] Asymmetric key parser 'x509' registered
[    0.248296] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.249141] io scheduler noop registered
[    0.249585] io scheduler deadline registered (default)
[    0.250169] io scheduler cfq registered
[    0.250643] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.251272] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.252062] ipmi message handler version 39.2
[    0.252697] virtio-pci 0000:00:02.0: PCI->APIC IRQ transform: INT A -> IRQ 34
[    0.254858] virtio-pci 0000:00:03.0: PCI->APIC IRQ transform: INT A -> IRQ 35
[    0.256171] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[    0.284494] serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.311767] Linux agpgart interface v0.103
[    0.312994] brd: module loaded
[    0.313708] loop: module loaded
[    0.314926] scsi0 : ata_piix
[    0.315303] scsi1 : ata_piix
[    0.315654] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc060 irq 14
[    0.316421] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc068 irq 15
[    0.317368] libphy: Fixed MDIO Bus: probed
[    0.317894] tun: Universal TUN/TAP device driver, 1.6
[    0.318457] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    0.319356] PPP generic driver version 2.4.2
[    0.320053] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.320785] ehci-pci: EHCI PCI platform driver
[    0.321288] ehci-platform: EHCI generic platform driver
[    0.321872] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.322556] ohci-pci: OHCI PCI platform driver
[    0.323055] ohci-platform: OHCI generic platform driver
[    0.323637] uhci_hcd: USB Universal Host Controller Interface driver
[    0.324372] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    0.325742] serio: i8042 KBD port at 0x60,0x64 irq 1
[    0.326298] serio: i8042 AUX port at 0x60,0x64 irq 12
[    0.326900] mousedev: PS/2 mouse device common for all mice
[    0.327755] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    0.328551] rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram
[    0.329314] device-mapper: uevent: version 1.0.3
[    0.329874] device-mapper: ioctl: 4.27.0-ioctl (2013-10-30) initialised: dm-devel@redhat.com
[    0.330809] ledtrig-cpu: registered to indicate activity on CPUs
[    0.331545] TCP: cubic registered
[    0.331979] NET: Registered protocol family 10
[    0.332614] NET: Registered protocol family 17
[    0.333125] Key type dns_resolver registered
[    0.333719] Loading compiled-in X.509 certificates
[    0.334978] Loaded X.509 cert 'Magrathea: Glacier signing key: 23984ac203784325ccf7b95b51f6c119380eb933'
[    0.336371] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[    0.337357] registered taskstats version 1
[    0.338216] Key type trusted registered
[    0.338730] Key type encrypted registered
[    0.339446] AppArmor: AppArmor sha1 policy hashing enabled
[    0.340077] IMA: No TPM chip found, activating TPM-bypass!
[    0.340812] regulator-dummy: incomplete constraints, leaving on
[    0.341506]   Magic number: 6:592:118
[    0.341995] rtc_cmos rtc_cmos: setting system clock to 2014-07-09 08:07:48 UTC (1404893268)
[    0.342934] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[    0.343602] EDD information not available.
[    0.477905] Freeing unused kernel memory: 1332K (ffffffff81d1f000 - ffffffff81e6c000)
[    0.479944] Write protecting the kernel read-only data: 12288k
[    0.482579] Freeing unused kernel memory: 828K (ffff880001731000 - ffff880001800000)
[    0.484862] Freeing unused kernel memory: 700K (ffff880001b51000 - ffff880001c00000)

#启动initrd

supermin: mounting /proc
supermin: uptime: 0.48 0.17
supermin: ext2 mini initrd starting up: 4.1.6 zlib xz
supermin: cmdline: panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=linux
supermin: mounting /sys

#load kernel modules

supermin: internal insmod megaraid_mm.ko
[    0.489773] megaraid cmm: 2.20.2.7 (Release Date: Sun Jul 16 00:01:03 EST 2006)
supermin: internal insmod megaraid_mbox.ko
[    0.492225] megaraid: 2.20.5.1 (Release Date: Thu Nov 16 15:32:35 EST 2006)
supermin: internal insmod megaraid_sas.ko
[    0.495378] megasas: 06.700.06.00-rc1 Sat. Aug. 31 17:00:00 PDT 2013
supermin: internal insmod megaraid.ko
supermin: internal insmod libcrc32c.ko
supermin: internal insmod crc32-pclmul.ko
[    0.500109] PCLMULQDQ-NI instructions are not detected.
insmod: init_module: crc32-pclmul.ko: No such device
supermin: internal insmod crct10dif-pclmul.ko
insmod: init_module: crct10dif-pclmul.ko: No such device
supermin: internal insmod crc-itu-t.ko
supermin: internal insmod crc32.ko
supermin: internal insmod crc-ccitt.ko
supermin: internal insmod crc7.ko
supermin: internal insmod crc8.ko
supermin: internal insmod sym53c8xx.ko
supermin: internal insmod ideapad_slidebar.ko
[    0.511759] ideapad_slidebar: DMI does not match
insmod: init_module: ideapad_slidebar.ko: No such device
supermin: internal insmod sparse-keymap.ko
supermin: internal insmod ideapad-laptop.ko
supermin: internal insmod virtio-rng.ko
supermin: internal insmod virtio_scsi.ko

#mount sda, sdb

[    0.518386] scsi2 : Virtio SCSI HBA
[    0.520458] scsi 2:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.0. PQ: 0 ANSI: 5
[    0.521481] scsi 2:0:1:0: Direct-Access     QEMU     QEMU HARDDISK    2.0. PQ: 0 ANSI: 5
[    0.538823] sd 2:0:0:0: Attached scsi generic sg0 type 0
[    0.539535] sd 2:0:0:0: [sda] 10485760 512-byte logical blocks: (5.36 GB/5.00 GiB)
[    0.540778] sd 2:0:0:0: [sda] Write Protect is off
[    0.541524] sd 2:0:1:0: [sdb] 8388608 512-byte logical blocks: (4.29 GB/4.00 GiB)
[    0.542557] sd 2:0:1:0: Attached scsi generic sg1 type 0
[    0.543334] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.544821] sd 2:0:1:0: [sdb] Write Protect is off
[    0.545592] sd 2:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.547407]  sda: sda1 sda2 < sda5 >
[    0.548353]  sdb: unknown partition table
[    0.549137] sd 2:0:0:0: [sda] Attached SCSI disk
[    0.550043] sd 2:0:1:0: [sdb] Attached SCSI disk

#将sdb作为root device

supermin: picked /sys/block/sdb/dev as root device
supermin: creating /dev/root as block special 8:16
supermin: mounting new root on /root
[    0.552368] EXT4-fs (sdb): mounting ext2 file system using the ext4 subsystem
[    0.554670] EXT4-fs (sdb): mounted filesystem without journal. Opts:
supermin: chroot

#运行init

Starting /init script ...
[    0.601208] systemd-udevd[83]: starting version 204
[    0.626557] ACPI Exception: AE_BAD_PARAMETER, Thread 489390080 could not acquire Mutex [0x1] (20131115/utmutex-285)
[    0.627882] piix4_smbus 0000:00:01.3: SMBus Host Controller at 0xb100, revision 0
[    0.655881] device-mapper: multipath: version 1.6.0 loaded
/init: 63: /init: systemd-tmpfiles: not found
/init: 69: /init: cannot create /sys/block/{h,s,ub,v}d*/queue/scheduler: Directory nonexistent
Cannot find device "eth0"
Cannot find device "eth0"
RTNETLINK answers: Network is unreachable
mdadm: No arrays found in config file or automatically
/init: 90: /init: lvmetad: not found
[    0.931219] random: lvm urandom read with 69 bits of entropy available
  Reading all physical volumes.  This may take a while...
  No volume groups found
  No volume groups found
/init: 96: /init: ldmtool: not found
Linux (none) 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
/dev:
total 0
crw------- 1 0 0  10, 235 Jul  9 08:07 autofs
drwxr-xr-x 2 0 0      620 Jul  9 08:07 block
drwxr-xr-x 2 0 0       80 Jul  9 08:07 bsg
crw------- 1 0 0  10, 234 Jul  9 08:07 btrfs-control
drwxr-xr-x 2 0 0     2800 Jul  9 08:07 char
crw------- 1 0 0   5,   1 Jul  9 08:07 console
lrwxrwxrwx 1 0 0       11 Jul  9 08:07 core -> /proc/kcore
drwxr-xr-x 2 0 0       60 Jul  9 08:07 cpu
crw------- 1 0 0  10,  60 Jul  9 08:07 cpu_dma_latency
crw------- 1 0 0  10, 203 Jul  9 08:07 cuse
drwxr-xr-x 5 0 0      100 Jul  9 08:07 disk
crw------- 1 0 0  10,  61 Jul  9 08:07 ecryptfs
lrwxrwxrwx 1 0 0       13 Jul  9 08:07 fd -> /proc/self/fd
crw-rw-rw- 1 0 0   1,   7 Jul  9 08:07 full
crw-rw-rw- 1 0 0  10, 229 Jul  9 08:07 fuse
drwxr-xr-x 3 0 0      100 Jul  9 08:07 input
crw-r--r-- 1 0 0   1,  11 Jul  9 08:07 kmsg
crw------- 1 0 0  10, 232 Jul  9 08:07 kvm
crw------- 1 0 0  10, 237 Jul  9 08:07 loop-control
brw------- 1 0 0   7,   0 Jul  9 08:07 loop0
brw------- 1 0 0   7,   1 Jul  9 08:07 loop1
brw------- 1 0 0   7,   2 Jul  9 08:07 loop2
brw------- 1 0 0   7,   3 Jul  9 08:07 loop3
brw------- 1 0 0   7,   4 Jul  9 08:07 loop4
brw------- 1 0 0   7,   5 Jul  9 08:07 loop5
brw------- 1 0 0   7,   6 Jul  9 08:07 loop6
brw------- 1 0 0   7,   7 Jul  9 08:07 loop7
drwxr-xr-x 2 0 0       60 Jul  9 08:07 mapper
crw------- 1 0 0  10, 227 Jul  9 08:07 mcelog
crw------- 1 0 0  10,  57 Jul  9 08:07 megadev0
crw------- 1 0 0   1,   1 Jul  9 08:07 mem
drwxr-xr-x 2 0 0       60 Jul  9 08:07 net
crw------- 1 0 0  10,  59 Jul  9 08:07 network_latency
crw------- 1 0 0  10,  58 Jul  9 08:07 network_throughput
crw-rw-rw- 1 0 0   1,   3 Jul  9 08:07 null
crw------- 1 0 0   1,   4 Jul  9 08:07 port
crw------- 1 0 0 108,   0 Jul  9 08:07 ppp
crw------- 1 0 0  10,   1 Jul  9 08:07 psaux
crw-rw-rw- 1 0 0   5,   2 Jul  9 08:07 ptmx
brw------- 1 0 0   1,   0 Jul  9 08:07 ram0
brw------- 1 0 0   1,   1 Jul  9 08:07 ram1
brw------- 1 0 0   1,  10 Jul  9 08:07 ram10
brw------- 1 0 0   1,  11 Jul  9 08:07 ram11
brw------- 1 0 0   1,  12 Jul  9 08:07 ram12
brw------- 1 0 0   1,  13 Jul  9 08:07 ram13
brw------- 1 0 0   1,  14 Jul  9 08:07 ram14
brw------- 1 0 0   1,  15 Jul  9 08:07 ram15
brw------- 1 0 0   1,   2 Jul  9 08:07 ram2
brw------- 1 0 0   1,   3 Jul  9 08:07 ram3
brw------- 1 0 0   1,   4 Jul  9 08:07 ram4
brw------- 1 0 0   1,   5 Jul  9 08:07 ram5
brw------- 1 0 0   1,   6 Jul  9 08:07 ram6
brw------- 1 0 0   1,   7 Jul  9 08:07 ram7
brw------- 1 0 0   1,   8 Jul  9 08:07 ram8
brw------- 1 0 0   1,   9 Jul  9 08:07 ram9
crw-rw-rw- 1 0 0   1,   8 Jul  9 08:07 random
crw------- 1 0 0  10,  62 Jul  9 08:07 rfkill
lrwxrwxrwx 1 0 0        4 Jul  9 08:07 rtc -> rtc0
crw------- 1 0 0 254,   0 Jul  9 08:07 rtc0
brw------- 1 0 0   8,   0 Jul  9 08:07 sda
brw------- 1 0 0   8,   1 Jul  9 08:07 sda1
brw------- 1 0 0   8,   2 Jul  9 08:07 sda2
brw------- 1 0 0   8,   5 Jul  9 08:07 sda5
brw------- 1 0 0   8,  16 Jul  9 08:07 sdb
crw------- 1 0 0  21,   0 Jul  9 08:07 sg0
crw------- 1 0 0  21,   1 Jul  9 08:07 sg1
crw------- 1 0 0  10, 231 Jul  9 08:07 snapshot
drwxr-xr-x 2 0 0       80 Jul  9 08:07 snd
lrwxrwxrwx 1 0 0       15 Jul  9 08:07 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 0 0       15 Jul  9 08:07 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 0 0       15 Jul  9 08:07 stdout -> /proc/self/fd/1
crw-rw-rw- 1 0 0   5,   0 Jul  9 08:07 tty
crw------- 1 0 0   4,   0 Jul  9 08:07 tty0
crw------- 1 0 0   4,   1 Jul  9 08:07 tty1
crw------- 1 0 0   4,  10 Jul  9 08:07 tty10
crw------- 1 0 0   4,  11 Jul  9 08:07 tty11
crw------- 1 0 0   4,  12 Jul  9 08:07 tty12
crw------- 1 0 0   4,  13 Jul  9 08:07 tty13
crw------- 1 0 0   4,  14 Jul  9 08:07 tty14
crw------- 1 0 0   4,  15 Jul  9 08:07 tty15
crw------- 1 0 0   4,  16 Jul  9 08:07 tty16
crw------- 1 0 0   4,  17 Jul  9 08:07 tty17
crw------- 1 0 0   4,  18 Jul  9 08:07 tty18
crw------- 1 0 0   4,  19 Jul  9 08:07 tty19
crw------- 1 0 0   4,   2 Jul  9 08:07 tty2
crw------- 1 0 0   4,  20 Jul  9 08:07 tty20
crw------- 1 0 0   4,  21 Jul  9 08:07 tty21
crw------- 1 0 0   4,  22 Jul  9 08:07 tty22
crw------- 1 0 0   4,  23 Jul  9 08:07 tty23
crw------- 1 0 0   4,  24 Jul  9 08:07 tty24
crw------- 1 0 0   4,  25 Jul  9 08:07 tty25
crw------- 1 0 0   4,  26 Jul  9 08:07 tty26
crw------- 1 0 0   4,  27 Jul  9 08:07 tty27
crw------- 1 0 0   4,  28 Jul  9 08:07 tty28
crw------- 1 0 0   4,  29 Jul  9 08:07 tty29
crw------- 1 0 0   4,   3 Jul  9 08:07 tty3
crw------- 1 0 0   4,  30 Jul  9 08:07 tty30
crw------- 1 0 0   4,  31 Jul  9 08:07 tty31
crw------- 1 0 0   4,  32 Jul  9 08:07 tty32
crw------- 1 0 0   4,  33 Jul  9 08:07 tty33
crw------- 1 0 0   4,  34 Jul  9 08:07 tty34
crw------- 1 0 0   4,  35 Jul  9 08:07 tty35
crw------- 1 0 0   4,  36 Jul  9 08:07 tty36
crw------- 1 0 0   4,  37 Jul  9 08:07 tty37
crw------- 1 0 0   4,  38 Jul  9 08:07 tty38
crw------- 1 0 0   4,  39 Jul  9 08:07 tty39
crw------- 1 0 0   4,   4 Jul  9 08:07 tty4
crw------- 1 0 0   4,  40 Jul  9 08:07 tty40
crw------- 1 0 0   4,  41 Jul  9 08:07 tty41
crw------- 1 0 0   4,  42 Jul  9 08:07 tty42
crw------- 1 0 0   4,  43 Jul  9 08:07 tty43
crw------- 1 0 0   4,  44 Jul  9 08:07 tty44
crw------- 1 0 0   4,  45 Jul  9 08:07 tty45
crw------- 1 0 0   4,  46 Jul  9 08:07 tty46
crw------- 1 0 0   4,  47 Jul  9 08:07 tty47
crw------- 1 0 0   4,  48 Jul  9 08:07 tty48
crw------- 1 0 0   4,  49 Jul  9 08:07 tty49
crw------- 1 0 0   4,   5 Jul  9 08:07 tty5
crw------- 1 0 0   4,  50 Jul  9 08:07 tty50
crw------- 1 0 0   4,  51 Jul  9 08:07 tty51
crw------- 1 0 0   4,  52 Jul  9 08:07 tty52
crw------- 1 0 0   4,  53 Jul  9 08:07 tty53
crw------- 1 0 0   4,  54 Jul  9 08:07 tty54
crw------- 1 0 0   4,  55 Jul  9 08:07 tty55
crw------- 1 0 0   4,  56 Jul  9 08:07 tty56
crw------- 1 0 0   4,  57 Jul  9 08:07 tty57
crw------- 1 0 0   4,  58 Jul  9 08:07 tty58
crw------- 1 0 0   4,  59 Jul  9 08:07 tty59
crw------- 1 0 0   4,   6 Jul  9 08:07 tty6
crw------- 1 0 0   4,  60 Jul  9 08:07 tty60
crw------- 1 0 0   4,  61 Jul  9 08:07 tty61
crw------- 1 0 0   4,  62 Jul  9 08:07 tty62
crw------- 1 0 0   4,  63 Jul  9 08:07 tty63
crw------- 1 0 0   4,   7 Jul  9 08:07 tty7
crw------- 1 0 0   4,   8 Jul  9 08:07 tty8
crw------- 1 0 0   4,   9 Jul  9 08:07 tty9
crw------- 1 0 0   4,  64 Jul  9 08:07 ttyS0
crw------- 1 0 0   4,  65 Jul  9 08:07 ttyS1
crw------- 1 0 0   4,  74 Jul  9 08:07 ttyS10
crw------- 1 0 0   4,  75 Jul  9 08:07 ttyS11
crw------- 1 0 0   4,  76 Jul  9 08:07 ttyS12
crw------- 1 0 0   4,  77 Jul  9 08:07 ttyS13
crw------- 1 0 0   4,  78 Jul  9 08:07 ttyS14
crw------- 1 0 0   4,  79 Jul  9 08:07 ttyS15
crw------- 1 0 0   4,  80 Jul  9 08:07 ttyS16
crw------- 1 0 0   4,  81 Jul  9 08:07 ttyS17
crw------- 1 0 0   4,  82 Jul  9 08:07 ttyS18
crw------- 1 0 0   4,  83 Jul  9 08:07 ttyS19
crw------- 1 0 0   4,  66 Jul  9 08:07 ttyS2
crw------- 1 0 0   4,  84 Jul  9 08:07 ttyS20
crw------- 1 0 0   4,  85 Jul  9 08:07 ttyS21
crw------- 1 0 0   4,  86 Jul  9 08:07 ttyS22
crw------- 1 0 0   4,  87 Jul  9 08:07 ttyS23
crw------- 1 0 0   4,  88 Jul  9 08:07 ttyS24
crw------- 1 0 0   4,  89 Jul  9 08:07 ttyS25
crw------- 1 0 0   4,  90 Jul  9 08:07 ttyS26
crw------- 1 0 0   4,  91 Jul  9 08:07 ttyS27
crw------- 1 0 0   4,  92 Jul  9 08:07 ttyS28
crw------- 1 0 0   4,  93 Jul  9 08:07 ttyS29
crw------- 1 0 0   4,  67 Jul  9 08:07 ttyS3
crw------- 1 0 0   4,  94 Jul  9 08:07 ttyS30
crw------- 1 0 0   4,  95 Jul  9 08:07 ttyS31
crw------- 1 0 0   4,  68 Jul  9 08:07 ttyS4
crw------- 1 0 0   4,  69 Jul  9 08:07 ttyS5
crw------- 1 0 0   4,  70 Jul  9 08:07 ttyS6
crw------- 1 0 0   4,  71 Jul  9 08:07 ttyS7
crw------- 1 0 0   4,  72 Jul  9 08:07 ttyS8
crw------- 1 0 0   4,  73 Jul  9 08:07 ttyS9
crw------- 1 0 0   5,   3 Jul  9 08:07 ttyprintk
crw------- 1 0 0  10, 239 Jul  9 08:07 uhid
crw------- 1 0 0  10, 223 Jul  9 08:07 uinput
crw-rw-rw- 1 0 0   1,   9 Jul  9 08:07 urandom
crw------- 1 0 0   7,   0 Jul  9 08:07 vcs
crw------- 1 0 0   7,   1 Jul  9 08:07 vcs1
crw------- 1 0 0   7, 128 Jul  9 08:07 vcsa
crw------- 1 0 0   7, 129 Jul  9 08:07 vcsa1
crw------- 1 0 0  10,  63 Jul  9 08:07 vga_arbiter
crw------- 1 0 0  10, 238 Jul  9 08:07 vhost-net
drwxr-xr-x 2 0 0       60 Jul  9 08:07 virtio-ports
crw------- 1 0 0 251,   1 Jul  9 08:07 vport1p1
crw-rw-rw- 1 0 0   1,   5 Jul  9 08:07 zero

/dev/block:
total 0
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:0 -> ../ram0
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:1 -> ../ram1
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 1:10 -> ../ram10
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 1:11 -> ../ram11
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 1:12 -> ../ram12
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 1:13 -> ../ram13
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 1:14 -> ../ram14
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 1:15 -> ../ram15
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:2 -> ../ram2
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:3 -> ../ram3
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:4 -> ../ram4
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:5 -> ../ram5
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:6 -> ../ram6
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:7 -> ../ram7
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:8 -> ../ram8
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 1:9 -> ../ram9
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:0 -> ../loop0
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:1 -> ../loop1
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:2 -> ../loop2
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:3 -> ../loop3
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:4 -> ../loop4
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:5 -> ../loop5
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:6 -> ../loop6
lrwxrwxrwx 1 0 0 8 Jul  9 08:07 7:7 -> ../loop7
lrwxrwxrwx 1 0 0 6 Jul  9 08:07 8:0 -> ../sda
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 8:1 -> ../sda1
lrwxrwxrwx 1 0 0 6 Jul  9 08:07 8:16 -> ../sdb
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 8:2 -> ../sda2
lrwxrwxrwx 1 0 0 7 Jul  9 08:07 8:5 -> ../sda5

/dev/bsg:
total 0
crw------- 1 0 0 252, 0 Jul  9 08:07 2:0:0:0
crw------- 1 0 0 252, 1 Jul  9 08:07 2:0:1:0

/dev/char:
total 0
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 108:0 -> ../ppp
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 10:1 -> ../psaux
lrwxrwxrwx 1 0 0 16 Jul  9 08:07 10:184 -> ../cpu/microcode
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 10:200 -> ../net/tun
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 10:223 -> ../uinput
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 10:227 -> ../mcelog
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 10:229 -> ../fuse
lrwxrwxrwx 1 0 0 11 Jul  9 08:07 10:231 -> ../snapshot
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 10:232 -> ../kvm
lrwxrwxrwx 1 0 0 17 Jul  9 08:07 10:236 -> ../mapper/control
lrwxrwxrwx 1 0 0 15 Jul  9 08:07 10:237 -> ../loop-control
lrwxrwxrwx 1 0 0 11 Jul  9 08:07 10:57 -> ../megadev0
lrwxrwxrwx 1 0 0 21 Jul  9 08:07 10:58 -> ../network_throughput
lrwxrwxrwx 1 0 0 18 Jul  9 08:07 10:59 -> ../network_latency
lrwxrwxrwx 1 0 0 18 Jul  9 08:07 10:60 -> ../cpu_dma_latency
lrwxrwxrwx 1 0 0 11 Jul  9 08:07 10:61 -> ../ecryptfs
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 10:62 -> ../rfkill
lrwxrwxrwx 1 0 0 14 Jul  9 08:07 10:63 -> ../vga_arbiter
lrwxrwxrwx 1 0 0 13 Jul  9 08:07 13:63 -> ../input/mice
lrwxrwxrwx 1 0 0 15 Jul  9 08:07 13:64 -> ../input/event0
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 1:1 -> ../mem
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 1:11 -> ../kmsg
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 1:3 -> ../null
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 1:4 -> ../port
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 1:5 -> ../zero
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 1:7 -> ../full
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 1:8 -> ../random
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 1:9 -> ../urandom
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 21:0 -> ../sg0
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 21:1 -> ../sg1
lrwxrwxrwx 1 0 0 11 Jul  9 08:07 251:1 -> ../vport1p1
lrwxrwxrwx 1 0 0 14 Jul  9 08:07 252:0 -> ../bsg/2:0:0:0
lrwxrwxrwx 1 0 0 14 Jul  9 08:07 252:1 -> ../bsg/2:0:1:0
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 254:0 -> ../rtc0
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:0 -> ../tty0
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:1 -> ../tty1
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:10 -> ../tty10
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:11 -> ../tty11
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:12 -> ../tty12
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:13 -> ../tty13
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:14 -> ../tty14
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:15 -> ../tty15
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:16 -> ../tty16
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:17 -> ../tty17
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:18 -> ../tty18
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:19 -> ../tty19
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:2 -> ../tty2
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:20 -> ../tty20
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:21 -> ../tty21
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:22 -> ../tty22
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:23 -> ../tty23
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:24 -> ../tty24
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:25 -> ../tty25
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:26 -> ../tty26
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:27 -> ../tty27
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:28 -> ../tty28
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:29 -> ../tty29
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:3 -> ../tty3
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:30 -> ../tty30
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:31 -> ../tty31
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:32 -> ../tty32
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:33 -> ../tty33
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:34 -> ../tty34
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:35 -> ../tty35
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:36 -> ../tty36
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:37 -> ../tty37
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:38 -> ../tty38
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:39 -> ../tty39
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:4 -> ../tty4
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:40 -> ../tty40
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:41 -> ../tty41
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:42 -> ../tty42
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:43 -> ../tty43
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:44 -> ../tty44
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:45 -> ../tty45
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:46 -> ../tty46
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:47 -> ../tty47
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:48 -> ../tty48
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:49 -> ../tty49
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:5 -> ../tty5
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:50 -> ../tty50
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:51 -> ../tty51
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:52 -> ../tty52
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:53 -> ../tty53
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:54 -> ../tty54
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:55 -> ../tty55
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:56 -> ../tty56
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:57 -> ../tty57
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:58 -> ../tty58
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:59 -> ../tty59
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:6 -> ../tty6
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:60 -> ../tty60
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:61 -> ../tty61
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:62 -> ../tty62
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:63 -> ../tty63
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:64 -> ../ttyS0
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:65 -> ../ttyS1
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:66 -> ../ttyS2
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:67 -> ../ttyS3
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:68 -> ../ttyS4
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:69 -> ../ttyS5
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:7 -> ../tty7
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:70 -> ../ttyS6
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:71 -> ../ttyS7
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:72 -> ../ttyS8
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 4:73 -> ../ttyS9
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:74 -> ../ttyS10
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:75 -> ../ttyS11
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:76 -> ../ttyS12
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:77 -> ../ttyS13
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:78 -> ../ttyS14
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:79 -> ../ttyS15
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:8 -> ../tty8
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:80 -> ../ttyS16
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:81 -> ../ttyS17
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:82 -> ../ttyS18
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:83 -> ../ttyS19
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:84 -> ../ttyS20
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:85 -> ../ttyS21
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:86 -> ../ttyS22
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:87 -> ../ttyS23
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:88 -> ../ttyS24
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:89 -> ../ttyS25
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 4:9 -> ../tty9
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:90 -> ../ttyS26
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:91 -> ../ttyS27
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:92 -> ../ttyS28
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:93 -> ../ttyS29
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:94 -> ../ttyS30
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 4:95 -> ../ttyS31
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 5:0 -> ../tty
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 5:1 -> ../console
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 5:2 -> ../ptmx
lrwxrwxrwx 1 0 0 12 Jul  9 08:07 5:3 -> ../ttyprintk
lrwxrwxrwx 1 0 0  6 Jul  9 08:07 7:0 -> ../vcs
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 7:1 -> ../vcs1
lrwxrwxrwx 1 0 0  7 Jul  9 08:07 7:128 -> ../vcsa
lrwxrwxrwx 1 0 0  8 Jul  9 08:07 7:129 -> ../vcsa1

/dev/cpu:
total 0
crw------- 1 0 0 10, 184 Jul  9 08:07 microcode

/dev/disk:
total 0
drwxr-xr-x 2 0 0 140 Jul  9 08:07 by-id
drwxr-xr-x 2 0 0 140 Jul  9 08:07 by-path
drwxr-xr-x 2 0 0 100 Jul  9 08:07 by-uuid

/dev/disk/by-id:
total 0
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 scsi-0QEMU_QEMU_HARDDISK_appliance -> ../../sdb
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 scsi-0QEMU_QEMU_HARDDISK_hd0 -> ../../sda
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 scsi-0QEMU_QEMU_HARDDISK_hd0-part1 -> ../../sda1
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 scsi-0QEMU_QEMU_HARDDISK_hd0-part2 -> ../../sda2
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 scsi-0QEMU_QEMU_HARDDISK_hd0-part5 -> ../../sda5

/dev/disk/by-path:
total 0
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 pci-0000:00:02.0-virtio-pci-virtio0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 pci-0000:00:02.0-virtio-pci-virtio0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 pci-0000:00:02.0-virtio-pci-virtio0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 pci-0000:00:02.0-virtio-pci-virtio0-scsi-0:0:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 pci-0000:00:02.0-virtio-pci-virtio0-scsi-0:0:1:0 -> ../../sdb

/dev/disk/by-uuid:
total 0
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 2a04dec6-66a7-4ab2-81ca-0b623f4aa7d8 -> ../../sda1
lrwxrwxrwx 1 0 0  9 Jul  9 08:07 673c8a86-9322-4c9d-ae30-b3303b7e8fff -> ../../sdb
lrwxrwxrwx 1 0 0 10 Jul  9 08:07 9fd1fcdd-cd35-476b-b78f-30b37c9ca759 -> ../../sda5

/dev/input:
total 0
drwxr-xr-x 2 0 0     60 Jul  9 08:07 by-path
crw------- 1 0 0 13, 64 Jul  9 08:07 event0
crw------- 1 0 0 13, 63 Jul  9 08:07 mice

/dev/input/by-path:
total 0
lrwxrwxrwx 1 0 0 9 Jul  9 08:07 platform-i8042-serio-0-event-kbd -> ../event0

/dev/mapper:
total 0
crw------- 1 0 0 10, 236 Jul  9 08:07 control

/dev/net:
total 0
crw-rw-rw- 1 0 0 10, 200 Jul  9 08:07 tun

/dev/snd:
total 0
crw------- 1 0 0 116,  1 Jul  9 08:07 seq
crw------- 1 0 0 116, 33 Jul  9 08:07 timer

/dev/virtio-ports:
total 0
lrwxrwxrwx 1 0 0 11 Jul  9 08:07 org.libguestfs.channel.0 -> ../vport1p1
rootfs / rootfs rw 0 0
proc /proc proc rw,relatime 0 0
/dev/root / ext2 rw,noatime 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
tmpfs /run tmpfs rw,nosuid,relatime,size=97916k,mode=755 0 0
/dev /dev devtmpfs rw,relatime,size=242608k,nr_inodes=60652,mode=755 0 0
  No volume groups found
  No volume groups found
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
Module                  Size  Used by
kvm_intel             143060  0
kvm                   451511  1 kvm_intel
dm_multipath           22873  0
scsi_dh                14882  1 dm_multipath
mac_hid                13205  0
psmouse               102222  0
serio_raw              13462  0
i2c_piix4              22155  0
virtio_scsi            18330  1
virtio_rng             13135  0
ideapad_laptop         18216  0
sparse_keymap          13948  1 ideapad_laptop
sym53c8xx              76731  0
crc8                   12893  0
crc7                   12703  0
crc_ccitt              12707  0
crc32                  12714  0
crc_itu_t              12707  0
libcrc32c              12644  0
megaraid               44120  0
megaraid_sas           91199  0
megaraid_mbox          40158  0
megaraid_mm            18253  1 megaraid_mbox
Wed Jul  9 08:07:49 UTC 2014
clocksource: kvm-clock
uptime: 1.17 0.29

#启动guestfsd

verbose daemon enabled
linux commmand line: panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=linux

#开通一个端口,C类库会通过RPC连接这个端口

trying to open virtio-serial channel '/dev/virtio-ports/org.libguestfs.channel.0'
udevadm settle
libguestfs: recv_from_daemon: received GUESTFS_LAUNCH_FLAG
libguestfs: [02558ms] appliance is up
><fs>

libguestfs手册(1): 架构的相关教程结束。

《libguestfs手册(1): 架构.doc》

下载本文的Word格式文档,以方便收藏与打印。