Bug 542644 - guestfish sets filesystem mount time in the "future", guest reports inconsistency at next boot
guestfish sets filesystem mount time in the "future", guest reports inconsist...
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
Depends On:
  Show dependency treegraph
Reported: 2009-11-30 08:00 EST by Praveen Arimbrathodiyil
Modified: 2013-06-17 00:07 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-04-20 05:00:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Praveen Arimbrathodiyil 2009-11-30 08:00:06 EST
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 08:01:03 EST
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 08:23:03 EST
(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 08:23:47 EST
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 08:27:13 EST
the guest was not running

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

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 08:44:22 EST
I'm inclined to think this is an edge case in
util-linux-ng or e2fsprogs.

See this recent Debian bug report:


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 08:46:11 EST
Eric, any ideas about comment 6?
Comment 8 Richard W.M. Jones 2009-11-30 08:51:27 EST
Here's another bug that seems related: bug 522969.
Comment 9 Praveen Arimbrathodiyil 2009-11-30 11:38:28 EST
As per

cat >> /etc/e2fsck.conf

in guest/debian ignores the last mount time in future error.
Comment 10 Eric Sandeen 2009-11-30 18:15:01 EST
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:


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.

Comment 11 Praveen Arimbrathodiyil 2009-12-01 02:24:42 EST

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 02:25:52 EST
other guest os = windows/non-gnu-linux
Comment 13 cornel panceac 2010-02-10 03:00:54 EST
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 16:30:47 EDT
We think the following patch should fix this:
Comment 15 Richard W.M. Jones 2010-04-20 05:00:58 EDT
Fixed in version 1.2.2.
Comment 16 cornel panceac 2010-04-20 05:09:50 EDT
thank you very much.

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