Bug 542644 - guestfish sets filesystem mount time in the "future", guest reports inconsistency at next boot
Summary: guestfish sets filesystem mount time in the "future", guest reports inconsist...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-30 13:00 UTC by Praveen Arimbrathodiyil
Modified: 2013-06-17 04:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-20 09:00:58 UTC
Embargoed:


Attachments (Terms of Use)
guest vm booting into maintenance mode (13.73 KB, image/png)
2009-11-30 13:00 UTC, Praveen Arimbrathodiyil
no flags Details
fsck inside guest vm (12.93 KB, image/png)
2009-11-30 13:01 UTC, Praveen Arimbrathodiyil
no flags Details

Description Praveen Arimbrathodiyil 2009-11-30 13:00:06 UTC
Created attachment 374741 [details]
guest vm booting into maintenance mode

Description of problem:
vm boots into maintenance shell after accessing files from guest disk image (debian gnu/linux sid). It is very much possible that it be an issue with time zones.

Verified date -u is same in both guest and host.

Version-Release number of selected component (if applicable):


How reproducible:

always (reproduced twice).

Steps to Reproduce:
1. mount any disk image
2. mount a partition, download some files
3. exit from shell (umount before exiting does not make any difference)
  
Actual results:
guest vm boots into maintenance mode because the disk is corrupted (only superblock last mount time is in future)

Expected results:

vm runs normally

Additional info:

Comment 1 Praveen Arimbrathodiyil 2009-11-30 13:01:03 UTC
Created attachment 374743 [details]
fsck inside guest vm

only last mount time needs to be corrected.

Comment 2 Richard W.M. Jones 2009-11-30 13:23:03 UTC
(In reply to comment #0)
> 1. mount any disk image
> 2. mount a partition, download some files
> 3. exit from shell (umount before exiting does not make any difference)

This is in guestfish or guestmount?  Can you show the exact
sequence of commands that you used?  Did you use the --ro option?

Comment 3 Richard W.M. Jones 2009-11-30 13:23:47 UTC
Also, was the guest running at the time?
It's unsafe to use libguestfs commands on a running guest,
unless you use the --ro option.

Comment 4 Praveen Arimbrathodiyil 2009-11-30 13:27:13 UTC
the guest was not running

- j4v4m4n

Comment 5 Praveen Arimbrathodiyil 2009-11-30 13:32:53 UTC
guestfish -a debian-gnu-linux.img
mount /dev/sda1 /
download /home/pravi/Desktop/some-file.png some-file.png
umount /
exit

boot guest vm

qemu-system-x86_64 debian-gnu-linux.img

I get the message like in the screenshot

Comment 6 Richard W.M. Jones 2009-11-30 13:44:22 UTC
I'm inclined to think this is an edge case in
util-linux-ng or e2fsprogs.

See this recent Debian bug report:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=543375

The problem in the ^^ report is that the timezone
wasn't being set before the fsck starts.  Our case is
slightly different: the appliance clock will always be
on UTC, and so in most cases it will always be different
from the guest's clock when it next boots, so for one
whole hemisphere of the earth they'll always get this
problem after booting.

I'm wondering what the purpose of the error is anyway.
Why does it matter if the superblock last mount/write
time is in the future?

(CC to Eric Sandeen).

Comment 7 Richard W.M. Jones 2009-11-30 13:46:11 UTC
Eric, any ideas about comment 6?

Comment 8 Richard W.M. Jones 2009-11-30 13:51:27 UTC
Here's another bug that seems related: bug 522969.

Comment 9 Praveen Arimbrathodiyil 2009-11-30 16:38:28 UTC
As per
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=543375#275

cat >> /etc/e2fsck.conf
[options]
buggy_init_scripts=1
^D

in guest/debian ignores the last mount time in future error.

Comment 10 Eric Sandeen 2009-11-30 23:15:01 UTC
Yeah, TBH I don't know why it drops to a full fsck for this; for what it's worth, upstream now accepts up to a 24h discrepancy w/o causing this:

http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=ba5131f6d48eded504e84c2a8ffc8131df8a512e

Just to be sure I'm not confused; this is e2fsprogs within the debian image that's finding this error?  I guess if so it's not a Red Hat e2fsprogs bug, right?

The workaround in comment #9 should be reasonable in that case.

-Eric

Comment 11 Praveen Arimbrathodiyil 2009-12-01 07:24:42 UTC
Eric,

Yes. The guest is debian gnu/linux and this error is caused by its e2fsprogs. It is not a Red Hat e2fsprogs bug. As mentioned in comment #9, it goes away after adding this option (buggy_init_scripts=1).

But it would be ideal for libguestfs not to update last mount time. It can cause problems with other guest os. 

- Praveen

Comment 12 Praveen Arimbrathodiyil 2009-12-01 07:25:52 UTC
other guest os = windows/non-gnu-linux

Comment 13 cornel panceac 2010-02-10 08:00:54 UTC
i was hitted by this bug on (real) fedora 12, after setting the wrong date in bios: 05/02/2010 instead of 02/05/2010. imho it should just get over it and boot normally.

Comment 14 Richard W.M. Jones 2010-04-19 20:30:47 UTC
We think the following patch should fix this:
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=508f1ee87e816bf6b6fc8e629ccbb2d61a971169

Comment 15 Richard W.M. Jones 2010-04-20 09:00:58 UTC
Fixed in version 1.2.2.

Comment 16 cornel panceac 2010-04-20 09:09:50 UTC
thank you very much.


Note You need to log in before you can comment on or make changes to this bug.