Difference between revisions of "Guestfish"

From wikieduonline
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
guestfish - the guest filesystem shell included in <code>[[libguestfs-tools]]</code> package in [[Ubuntu]]/Debian.
+
<code>guestfish</code> - the guest filesystem shell included in <code>[[libguestfs-tools]]</code> package in [[Ubuntu]]/Debian.
 
* https://libguestfs.org/guestfish.1.html
 
* https://libguestfs.org/guestfish.1.html
 +
 +
Commands:
 +
[[list-devices]]
 +
[[list-partitions]]
 +
[[lvs]]
 +
[[pvs]]
 +
[[vfs-type]]
 +
[[file]]
 +
ls, ll, cat, more, download and tar-out
 +
  
  
 
  [[resize2fs-size]] /dev/sda145 16G https://www.ullright.org/ullWiki/show/libguestfs-tools-virtual-machine-image-tools
 
  [[resize2fs-size]] /dev/sda145 16G https://www.ullright.org/ullWiki/show/libguestfs-tools-virtual-machine-image-tools
  
 +
guestfish -a IMAGE.QCOW2
 +
 +
guestfish -a IMAGE.QCOW2 -i
 +
 +
guestfish -a IMAGE.QCOW2
 +
 +
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
 +
><fs>
 +
 +
><fs> run
 +
libguestfs: error: launch: this function can only be called in the config state
 +
><fs>
 +
 +
><fs> list-filesystems
 +
/dev/sda1: ext4
 +
 +
><fs> [[e2fsck]] /dev/sda1
 +
libguestfs: error: e2fsck: e2fsck 1.45.5 (07-Jan-2020)
 +
e2fsck: need terminal for interactive repairs
 +
 +
><fs>  e2fsck /dev/sda2
 +
libguestfs: error: e2fsck: e2fsck 1.45.5 (07-Jan-2020)
 +
/dev/sda2 is mounted.
 +
e2fsck: Cannot continue, aborting.
 +
 +
 +
guestfish -a IMAGE.qcow2  -i
 +
guestfish: no operating system was found on this disk
 +
 +
If using guestfish ‘-i’ option, remove this option and instead
 +
use the commands ‘run’ followed by ‘list-filesystems’.
 +
You can then mount filesystems you want by hand using the
 +
‘mount’ or ‘mount-ro’ command.
 +
 +
If using guestmount ‘-i’, remove this option and choose the
 +
filesystem(s) you want to see by manually adding ‘-m’ option(s).
 +
Use ‘[[virt-filesystems]]’ to see what filesystems are available.
 +
 +
If using other virt tools, this disk image won’t work
 +
with these tools.  Use the guestfish equivalent commands
 +
(see the virt tool manual page).
 +
 +
 +
== Related terms ==
 +
* <code>[[guestmount]]</code>
 +
* <code>[[qemu-nbd]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 07:26, 18 October 2020

guestfish - the guest filesystem shell included in libguestfs-tools package in Ubuntu/Debian.

Commands:

list-devices
list-partitions
lvs
pvs 
vfs-type
file
ls, ll, cat, more, download and tar-out


resize2fs-size /dev/sda145 16G https://www.ullright.org/ullWiki/show/libguestfs-tools-virtual-machine-image-tools
guestfish -a IMAGE.QCOW2
guestfish -a IMAGE.QCOW2 -i
guestfish -a IMAGE.QCOW2

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
><fs>
><fs> run
libguestfs: error: launch: this function can only be called in the config state
><fs>
><fs> list-filesystems
/dev/sda1: ext4
><fs> e2fsck /dev/sda1
libguestfs: error: e2fsck: e2fsck 1.45.5 (07-Jan-2020)
e2fsck: need terminal for interactive repairs
><fs>  e2fsck /dev/sda2
libguestfs: error: e2fsck: e2fsck 1.45.5 (07-Jan-2020)
/dev/sda2 is mounted.
e2fsck: Cannot continue, aborting.


guestfish -a IMAGE.qcow2  -i
guestfish: no operating system was found on this disk

If using guestfish ‘-i’ option, remove this option and instead
use the commands ‘run’ followed by ‘list-filesystems’.
You can then mount filesystems you want by hand using the
‘mount’ or ‘mount-ro’ command.

If using guestmount ‘-i’, remove this option and choose the
filesystem(s) you want to see by manually adding ‘-m’ option(s).
Use ‘virt-filesystems’ to see what filesystems are available.

If using other virt tools, this disk image won’t work
with these tools.  Use the guestfish equivalent commands
(see the virt tool manual page).


Related terms[edit]

See also[edit]

Advertising: