On Mon, Apr 16, 2018 at 12:28:58PM +0200, Pino Toscano wrote:
> On Monday, 16 April 2018 11:48:08 CEST Richard W.M. Jones wrote:
> > Some filesystems fall back silently to read-only if there are problems
> > such a dirty filesystem and an unrecoverable journal.  Almost all
> > conversions involve writing to the root filesystem, so these will
> > inevitably fail later on with a strange error message.
> > 
> > Test the root filesystem is writable by creating and deleting a
> > temporary file, and if the creation fails then give better
> > diagnostics.
> 
> Another possibility here could be to use the "norecover" mount option.

Unfortunately I don't have an actual test case covering this bug.  But
one problem with the norecover option seems to be that it's only
understood by ntfs-3g and other filesystems give an error:

$ guestfish -N fs -m /dev/sda1:/:norecover
libguestfs: error: mount_options: mount exited with status 32: mount: /sysroot: 
wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or 
helper program, or other error.
guestfish: ‘/dev/sda1’ could not be mounted.
guestfish: Check mount(8) man page to ensure options ‘norecover’
guestfish: are supported by the filesystem that is being mounted.
guestfish: Did you mean to mount one of these filesystems?
guestfish:     /dev/sda1 (ext2)

So that would entail some more complex logic to determine if the
filesystem is ntfs or not.

It's a tricky call.  You could equally argue that the ‘norecover’
option is important for data integrity, or that what we currently do
(‘recover’, the default) allows us to convert guests with less fuss.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to