Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17188250ybl; Thu, 2 Jan 2020 00:08:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxOtdtkr58k2oymps3rdvSa+z4chTMaKI5E4XAymUM3SnDQF7WHqAPxSLHS6nARwU35cYY9 X-Received: by 2002:a05:6830:1555:: with SMTP id l21mr84785401otp.41.1577952509006; Thu, 02 Jan 2020 00:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577952508; cv=none; d=google.com; s=arc-20160816; b=zkLmciiCCBHbfbWVZsq91wElxn/miBQXIxb3COYH7MtAAbzvmyQ35TGFpUyldEwQP1 tWWepM2BV3ay/KPqcReHzHix2CgcJh2GoikrNFJkco8wRNPmzCLF830b6HtHp7P+CRlG QsGGZ4K6Z+MXh/zCtpN9R0b0Lh+RzuLhpsVEH1rMCgFGSvUHEvU1p+yeNPfDCDd/YPci 141ILZuB7V73hvH/FUwTlIvKc04SuO7H/u/8j6NEIqLJ2W7awwUh/4TZGyuu1Wku8+ji GF6YABONWjfiIMoV1+esOZVCOzjWPlFsZC2RKEvp1oME/x97lUtRI4Zw0RuDrpN5aWb6 fMnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FVWIK2jrMiZ2hqvmNKsLEYjxusYcMZUIWglnH8mawmI=; b=kK34+EGBqpByHD3mQA9J321ZIOsKVwvCUW7feu4RqhgdRMpwJwaPUXE9A895KNUesy UsGbPij2n0ecg8dtVoq9ftRIM5AbTKI3iamyrG+XLkg9q3SbPbqz2jpnYGIsjZKHfhhA 9/3AaHif0kDorubjcTYJBX/6/w8TwHYxPNfVgkBlKm+iH6ykqR50qNpiNgLLrx2/dZxX at0gyw5lY5h9DaJm/dK/sxH5xIUAnQGhy7vR70Drt+6gf1PCSQ0hOx5Dm1r4pHa0R0VL gEurGgNXuOV0cgprRv9Wr3I9QJfcq3wYG5BpB2akXO7ytaORZewf98NFp3MRHqAQYBpI PouA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j53lP8fY; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si27135110otl.153.2020.01.02.00.08.08; Thu, 02 Jan 2020 00:08:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j53lP8fY; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbgABIIH (ORCPT + 99 others); Thu, 2 Jan 2020 03:08:07 -0500 Received: from mail-il1-f181.google.com ([209.85.166.181]:39116 "EHLO mail-il1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727714AbgABIIG (ORCPT ); Thu, 2 Jan 2020 03:08:06 -0500 Received: by mail-il1-f181.google.com with SMTP id x5so33509795ila.6; Thu, 02 Jan 2020 00:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FVWIK2jrMiZ2hqvmNKsLEYjxusYcMZUIWglnH8mawmI=; b=j53lP8fYSXf6aYyvL8iSrfUXk6I+ezIkYkyE0UIKOolUYwvKxBBc/Rqdzfo3eC7k4z dSuefjzRjvD/K7sZb7YKtEf6e/9dmKwHE55Di0u5iX2Pg7AGUVNIWZZgNGDfTFI7daX9 Rw3EgfnZ84GYByb1kas9jxv9TTmvu0AOY/3sQrZUTFBhY4TFJbQrnakyhOZtcowv5N2M f+M/G0/bA1WVEakSPkizvSu6tA5emb0MKnCZujsOjSoJ1rDSXTVYXct5triPeu58tP/R WqXgrcfPwzSNddWwk+4ZWIqruHXx+hYJeSO46I/qbq5Li7dk8t4MsucmbDMfEGQ0aYTz XJUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FVWIK2jrMiZ2hqvmNKsLEYjxusYcMZUIWglnH8mawmI=; b=earc/IoVMa/aXm5IbXfsrfRpUE4SI8aY/RxXNiAjjs6Omqkor+f++XjtjNxWUN4G30 72SdjPkrfUVof/6TXlB/sqvWKwrshOf3450ESz2FZcXkFCODQ5/4biIk8MHd1HG0G3ZC DdU7CaHvq+cIXP6JUMxC9yECFeVBJv41HFE8QY6bCyjv94Y3yeu+ux3sNsWtCGBm12LN GFnw7iSg8E3G0wuwwN/6MGhryPf2grJtQX1ZY1kbeaYkJGu830T10d8i/XI9y+n/u+YZ cdX0602rUr7CveD65Q9q/j3KdoO6cw4FzeG9D8BIuUFCCAAhSz7tZZqXTzlFGhDb/Up9 iEng== X-Gm-Message-State: APjAAAVfwYB+vuuY2Wq9ULuF1reZ5VunLZG/twfDxp7wSv/LqBsSLoLv DVNC3o0VIA0J7Zz5PFnWNvsSEwRJm2FLjUuvbEZA4jh3rMc= X-Received: by 2002:a92:3984:: with SMTP id h4mr65496279ilf.36.1577952485668; Thu, 02 Jan 2020 00:08:05 -0800 (PST) MIME-Version: 1.0 References: <20200101141748.GA191637@mit.edu> In-Reply-To: From: Mikhail Gavrilov Date: Thu, 2 Jan 2020 13:08:41 +0500 Message-ID: Subject: [bugreport] "hwclock -w" reset time instead of setting the right time To: util-linux@vger.kernel.org, Linux List Kernel Mailing Cc: linux-ext4@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org "hwclock -w" reset time instead of setting the right time on M/B "ROG Strix X570-I Gaming" Demonstration: https://youtu.be/QRB7ZLiEfrc Some DE like GNOME has automatic time synchronization option and there is a feeling that hardware time reset after each Linux boot. -- Best Regards, Mike Gavrilov. On Thu, 2 Jan 2020 at 04:19, Mikhail Gavrilov wrote: > > On Wed, 1 Jan 2020 at 19:17, Theodore Y. Ts'o wrote: > > > > The problem is casued by the fact that the mount time is incorrect, > > which indicates that the system time was incorrect at the time when > > the file system was mounted and when it fsck was run. Since the last > > write time was in the future, this triggered "time is insane" check. > > > > This is inconsistent with your report that started happening when you > > switched to a new motherboard. That's because the real time clock is > > not reporting the correct time when the system is booted. Later on, > > in the boot cycle, after the root file system is checked and remounted > > read-write, the system time is getting set from an internet time > > server. This then causes the last write time to be ahead of the last > > mount time, and "in the future" with respect to the real time clock. > > > > Normally, the hardware clock's time gets set to match system time when > > it is set from network time, or when the system is getting shut down > > cleanly, but your init scripts aren't doing this properly --- or you > > normally shut down your system by just flipping the power switch, and > > not letting the shutdown sequence run correctly. The other possibilty > > is the real time clock on your system is just completly busted > > (although normally when that happens, the last mount time would be in > > the 1970's.) > > > > Running "/sbin/hwclock -w" as root may fix things; as is figuring out > > why this isn't run automatically by your boot scripts. Another > > workaround is to add to /etc/e2fsck.conf the following: > > > > [options] > > broken_system_lock = true > > > > This will disable e2fsck's time checks. > > > > Thank you very much for the tip, I would never have guessed that the > cause of this issue in hwclock. > I started to watch hwclock through the motherboard BIOS and found that > hwclock resets every time after booting Linux. > Demonstration: https://youtu.be/TBrLNFbBaPo > Apparently for this reason, "hwclock -w" did not help me, workaround > with "broken_system_clock = true" is working, but I would like to fix > the root of the cause. > Who can help with this? >