read-write in LIBGUESTFS 1.20
How can i open a virtual disk in read-write mode ? # guestmount --rw -d winxp -m /dev/sda1 /media/ # rm -f /media/pagefile.sys rm: cannot remove ‘/media/pagefile.sys’: Operation not permitted # cd /media && touch file touch: cannot touch ‘file’: Permission denied # cd && fusermount -u /media I've tried with guestfish also. I have compiled libguestfs with this conf: ./configure \ PYTHON=/usr/bin/python2 \ --prefix=/usr --libdir=/usr/lib \ --mandir=/usr/share/man \ --sysconfdir=/etc \ --disable-probes \ --disable-gobject \ --enable-introspection=no \ --disable-lua \ --disable-erlang \ --disable-php \ --disable-haskell \ --disable-ruby \ --without-java \ --with-default-attach-method=libvirt am i missing something ? -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
On Sun, Dec 16, 2012 at 10:03:44PM +0200, Evaggelos Balaskas wrote:
How can i open a virtual disk in read-write mode ?
# guestmount --rw -d winxp -m /dev/sda1 /media/
# rm -f /media/pagefile.sys rm: cannot remove ‘/media/pagefile.sys’: Operation not permitted
# cd /media && touch file touch: cannot touch ‘file’: Permission denied
# cd && fusermount -u /media
I've tried with guestfish also.
I have compiled libguestfs with this conf:
./configure \ PYTHON=/usr/bin/python2 \ --prefix=/usr --libdir=/usr/lib \ --mandir=/usr/share/man \ --sysconfdir=/etc \ --disable-probes \ --disable-gobject \ --enable-introspection=no \ --disable-lua \ --disable-erlang \ --disable-php \ --disable-haskell \ --disable-ruby \ --without-java \ --with-default-attach-method=libvirt
am i missing something ?
It certainly should work :-( My only thought is that it's an NTFS filesystem which is in an unclean state, and ntfs-3g is refusing to mount it read-write. Can you try it with guestfish, and add the '-x' and/or '-v' options in order to display precisely what libguestfs is doing? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
cant find something useful. i dont want to abuse this list, so here a link for my log http://ebalaskas.gr/img/libguestfs_20121217.ebal.lrz There are three parts PART #1 : ntfsresize --info PART #2 : guestfish --rw -d winxp -x -v PART #3 : guestmount -x -v --rw -d winxp -m /dev/sda1 /media/ -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
On Mon, Dec 17, 2012 at 06:57:17PM +0200, Evaggelos Balaskas wrote:
cant find something useful.
i dont want to abuse this list, so here a link for my log
http://ebalaskas.gr/img/libguestfs_20121217.ebal.lrz
There are three parts
PART #1 : ntfsresize --info PART #2 : guestfish --rw -d winxp -x -v PART #3 : guestmount -x -v --rw -d winxp -m /dev/sda1 /media/
This is certainly an odd failure. But the failure does seem to be from ntfs-3g, and libguestfs is just reporting that back to you. There are no additional messages or kernel logs from ntfs-3g which is not very surprising since ntfs-3g runs as a userspace FUSE process within the libguestfs appliance. I don't know where these logs would go, if indeed they go anywhere. Another thing to try would be to use virt-rescue, ie: virt-rescue -d winxp [...]
<rescue> mount /dev/sda1 /sysroot <rescue> touch /sysroot/foo
Also virt-rescue will let you run other ntfs* tools like ntfsck, ntfsfix, ntfsinfo etc. This thread: http://tuxera.com/forum/viewtopic.php?f=2&t=28776 suggests that ntfs-3g will return the "Permission denied" error for encrypted files: http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/#efsinf... although I don't think that should affect creation of new files. In any case you can find out if a file is encrypted using virt-rescue:
<rescue> getfattr -h -e hex -n system.ntfs_efsinfo /sysroot/filename
Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
I dont believe that there is a change of being an encrypted windows cause i've opened up this raw lvm partition with kpartx and mounted normally under /media I've removed the unnecessary pagefile.sys without any problem. This is a default winxp installation i did about a month ago. that said .... virt-rescue wasnt much help either [root@(none) /]# ls /sysroot/ AUTOEXEC.BAT Documents and Settings MSDOS.SYS Program Files boot.ini CONFIG.SYS IO.SYS NTDETECT.COM WINDOWS ntldr [root@(none) /]# getfattr -h -e hex -n system.ntfs_efsinfo /sysroot/boot.ini /sysroot/boot.ini: system.ntfs_efsinfo: Operation not supported # touch /sysroot/foo touch: cannot touch '/sysroot/foo': Permission denied It's odd and its certainly related to ntfs-3g cause with ext images guestmount works ok. -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
This is another example of virtual qcow2 image # qemu-img info winxp.img image: winxp.img file format: qcow2 virtual size: 5.0G (5368709120 bytes) disk size: 2.8G cluster_size: 65536 # guestmount --rw -a winxp.img -i /media/ or # guestmount --rw -a winxp.img -m /dev/sda1 /media/ # rm -f /media/pagefile.sys rm: cannot remove ‘/media/pagefile.sys’: Read-only file system # fusermount -u /media -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
On Mon, Dec 17, 2012 at 08:39:04PM +0200, Evaggelos Balaskas wrote:
This is another example of virtual qcow2 image
# qemu-img info winxp.img image: winxp.img file format: qcow2 virtual size: 5.0G (5368709120 bytes) disk size: 2.8G cluster_size: 65536
# guestmount --rw -a winxp.img -i /media/ or # guestmount --rw -a winxp.img -m /dev/sda1 /media/
# rm -f /media/pagefile.sys rm: cannot remove ‘/media/pagefile.sys’: Read-only file system
# fusermount -u /media
Is it possible I could get my hands on a (smaller) disk image that demonstrates this problem? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
it's definitely not the image. i am focusing on ntfs-3g in my archlinux box. i'll get back to you when i find (or not) more info -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
question: What is the output of # grep -i ntfs * /usr/lib/guestfs/supermin.d/* -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
On Mon, Dec 17, 2012 at 09:38:43PM +0200, Evaggelos Balaskas wrote:
question: What is the output of
# grep -i ntfs * /usr/lib/guestfs/supermin.d/*
On Fedora this is the output of some similar commands: $ grep -i ntfs /usr/lib*/guestfs/supermin.d/hostfiles /usr/bin/lowntfs-3g /usr/bin/ntfs-3g /usr/bin/ntfs-3g.probe /usr/bin/ntfs-3g.secaudit /usr/bin/ntfs-3g.usermap /usr/bin/ntfscat /usr/bin/ntfsck /usr/bin/ntfscluster /usr/bin/ntfscmp /usr/bin/ntfsdecrypt /usr/bin/ntfsdump_logfile /usr/bin/ntfsfix /usr/bin/ntfsinfo /usr/bin/ntfsls /usr/bin/ntfsmftalloc /usr/bin/ntfsmount /usr/bin/ntfsmove /usr/bin/ntfstruncate /usr/bin/ntfswipe /usr/lib64/libntfs-3g.so.* /usr/sbin/fsck.ntfs /usr/sbin/mkfs.ntfs /usr/sbin/mkntfs /usr/sbin/mount.lowntfs-3g /usr/sbin/mount.ntfs /usr/sbin/mount.ntfs-3g /usr/sbin/mount.ntfs-fuse /usr/sbin/ntfsclone /usr/sbin/ntfscp /usr/sbin/ntfslabel /usr/sbin/ntfsresize /usr/sbin/ntfsundelete /usr/share/hal/fdi/policy/10osvendor/20-ntfs-config-write-policy.fdi $ cpio -it < /usr/lib*/guestfs/supermin.d/base.img | grep -i ntfs usr/share/doc/ntfs-3g-2012.1.15 usr/share/doc/ntfsprogs-2012.1.15 What it should be on ArchLinux is the list of files in the ntfs-3g package, and the ntfsprogs package if that is still separate (upstream projects joined together some time ago). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Another thing you could try: $ guestfish -N fs:ntfs -m /dev/sda1 touch /this-is-a-test This will create an empty NTFS filesystem in a disk image (called 'test1.img'), then touch one file. Since it doesn't involve any existing filesystems or guests it's a good test of whether ntfs-3g is working or broken. You can also run: $ strings -e l test1.img to look at strings in the test image. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
then thats my problem ! dammit for some (unknown to me right know) reason febootstrap at libguestfs complication time didnt add ntfs-3g & ntfsprogs i'll try to re-compile libguestfs -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
i know, i am very close to be banned ! but after recompilation febootstrap-supermin-helper: ext2fs_unlink_inode: EXT2 directory corrupted libguestfs: error: external command failed, see earlier error messages btw # grep -ris ntfs /usr/lib/guestfs/supermin.d has a lot of ntfs output -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
and .... after rebooting, everything is OK i can guestmount in read-write ntfs or ext images without any problem Thanks for all the help - you were educational as always. -- Evaggelos Balaskas - Unix System Engineer http://gr.linkedin.com/in/evaggelosbalaskas
On Mon, Dec 17, 2012 at 10:50:52PM +0200, Evaggelos Balaskas wrote:
i know, i am very close to be banned !
but after recompilation
febootstrap-supermin-helper: ext2fs_unlink_inode: EXT2 directory corrupted libguestfs: error: external command failed, see earlier error messages
This is one of those errors in e2fsprogs which it's hard to tell what is going on without really debugging it. libguestfs prints out the full febootstrap-supermin-helper command line before running it, so you can run the same command under gdb. And/or add febootstrap -vvv option to get lots more debug. Have said that it is probably something to do with the fixed-sized appliance disk running out of space (it's fixed to 4 GB and various things like having lots of unstripped kernel modules can blow through that). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On Mon, Dec 17, 2012 at 08:34:00PM +0200, Evaggelos Balaskas wrote:
It's odd and its certainly related to ntfs-3g cause with ext images guestmount works ok.
Perhaps update ntfs-3g (on the host)? I haven't seen anything like this, but I'll look out it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
participants (2)
-
Evaggelos Balaskas -
Richard W.M. Jones