summaryrefslogtreecommitdiffstats
path: root/video-tutorials/guestfish-disk-image/script.txt
blob: 998e7a47666dd56d3e10a7182bf03483784a1209 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  ls -lh disk.img

Here I have a four-and-a-half GB disk image file.  What's inside it?

  file disk.img

The "file" command doesn't tell me much.

  guestfish -a disk.img --ro

But using guestfish we can look right inside this disk image.
The "R O" Read Only option must be used if this is a live
virtual machine.

[pause before RUN]

  run

  list-partitions

  lvs

Run the libguestfs back end, then list partitions and logical volumes
found inside this file.

[pause before MOUNT]

  mount /dev/vg_f12x32/lv_root /

To look at a filesystem, tell guestfish to mount it.

  ll /usr

  cat /etc/issue.net

Guestfish can list directories and open files, and
there are dozens of other commands.

  virt-inspector disk.img | more

If you want to do all of this automatically we have another
tool called virt-inspector.  Point this at any disk image and
it will produce a report showing you what's inside it.