Monday, November 3, 2014

How to edit an Image using guestfish?

[root@s4-50 ready_for]# guestfish --rw -a tinyCentosRouter.qcow2

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

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

><fs> run
><fs> list-filesystems
/dev/sda1: ext4
/dev/VolGroup/lv_root: ext4
/dev/VolGroup/lv_swap: swap
><fs> mount /dev/VolGroup/lv_root /
><fs> ls /
.autofsck
.autorelabel
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
sbin
selinux
srv
sys
tmp
usr
var
><fs> vi /etc/sysctl.conf
><fs> umount /
><fs> exit

another option is to ru this command:
# guestmount -a template_a.qcow2 -w -m /dev/sda1 /mnt/image/



No comments:

Post a Comment