Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17354925ybl; Thu, 2 Jan 2020 03:55:53 -0800 (PST) X-Google-Smtp-Source: APXvYqw9m/wC9BOP5gXZsAFLETG3Ja2vzkgq8HbVt2nXP/KfJCmIq1QLEyrcMNOepkgUSqKbfDfd X-Received: by 2002:a9d:6511:: with SMTP id i17mr62409219otl.264.1577966153507; Thu, 02 Jan 2020 03:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577966153; cv=none; d=google.com; s=arc-20160816; b=HrvPMeXqI/U/eB7zDh9LU74pKvvgeBSRKco3ppKh4I/mtx7LLXiENqLh2Q4nQQkEIw dLeTX/Vv8YGFv6mkwvJtmsehA44CxsJyyEXiPcAGin2VPMjWwpS+8Wv5fxiCZJ1HGIIu SeZ50/ja7/WKJ8aeF46BzWXK5YIpNcudTYB/c+wB5dn408sCDRS4hWXtofmrWeCrMxcl wIX/LqsPECGgw1rD3XtCkHm7p+A6XncIHWmD/QCW7WpESIdXA37rhKf6lsfTu2Xe1ugk 6nWA854uxQSl6Ra56JK176gv2zGj9YVB6psp+0s5gjlV7N9W/mA+B2BFL5s2sHJL/aX8 FlWg== 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=2CXjiD6I6yu4Kt+bNv5ua4qYRJXTqkhhK9Mk3VAAT5o=; b=wxJGNCz7GypCN/TS3GHhMfRRjvpgprKozZIkYtFofQt8FBZojB7lD+lL12Pc8ZRYTX 4WbuVjLtQnf/VRfRcrCFfjmv+FWyIuUdIzTsXOQolFku0grdSTRPN+rLfKhhQXuVveMl OMoxbnfFMZgwBFX0hDw2FBzmArahbcRu/TCHfMhdQjnd6hxNBabw8ei4ZyDZehBtU4s5 8Ygl3vzTOOOjLWrSgDkh8N80/AMAEOGvarbKt54fyx5RBwwPEYhWN7o1YZN7v1wkmDER 27/tTLXr5PwmHZHPjWtziFdZFeMa4zEqPonMOIDymCRDPpr8jgdqb6aBhMvjHrWe6Ke8 Fbsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SWA0CVMo; 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 k7si26139580otb.90.2020.01.02.03.55.33; Thu, 02 Jan 2020 03:55:53 -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=SWA0CVMo; 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 S1728222AbgABLzQ (ORCPT + 99 others); Thu, 2 Jan 2020 06:55:16 -0500 Received: from mail-io1-f54.google.com ([209.85.166.54]:33906 "EHLO mail-io1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728205AbgABLzP (ORCPT ); Thu, 2 Jan 2020 06:55:15 -0500 Received: by mail-io1-f54.google.com with SMTP id z193so38036293iof.1; Thu, 02 Jan 2020 03:55:15 -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=2CXjiD6I6yu4Kt+bNv5ua4qYRJXTqkhhK9Mk3VAAT5o=; b=SWA0CVMogxKPxm++1rmBHfuZa55b+UVfciSwp8DsCtA3j5SN3mqto1KwV0V5hQPq/G yXsSlbivzwTAMOsVfAJTh44YmduFyn1GsF9GTNFBP8cSSYzmi46w9EeIOJJT1ok3CgYV lPs9VjXcDQvh1bQsUDa0tza0QL3ebsDcwq73H4DANns17EV1H7iixalQmLBcsV9mJkKS r0nHKnCHxmzJSGE98Hx8Z3EmmVjyxfytJeQCvUx0K0QjpMES0V8EWTttXiE8nzWDr5l8 XgNKjrRSC9QSycmOxfp1cC9m3bh7G0Cgm+Nc3dScpsnxrXabDz1WzHvi/q1xlXaCSW35 65ng== 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=2CXjiD6I6yu4Kt+bNv5ua4qYRJXTqkhhK9Mk3VAAT5o=; b=Kv12h6w/exzQ/VVtCfqiP8KKElZz4M3g669yHSIGJ4DFs88Mh5XPD2l+ZHWDZvjkV0 Cs0+nU/dsDQDjBploxqMGEFpg9eXDTmlGEFDXtl7Alj3SPyfaiLGhmFmZKbvqSz3J+Qk pksvisSbH4OESKRRAhh6N1BsyekzjoIwkJre8FdmbxHlVCeTfV4RCQSi3Lc7UKMnYRJB ujIb5BLsTXgVRBjtMRIFfKnyNG3pAdb4TDAXf7cgOEwc1sOH1wSMVwCIqmNFG7eocDRz h0eDa00Cgl3pGZPyGjaLgIWn0eWY5k3J7FKU1X/Pbr44rPqmC+7FQP2Au/VKmZiqYyUQ EZ9A== X-Gm-Message-State: APjAAAX26aX/FeXz97unmJVLo4kZbyyfJwPUUmTcFoZIBS9jQSzWxXdJ Yr0/Ur0vFWLykfATbcJucuhFAV8KOGA/Rkov52c= X-Received: by 2002:a02:b385:: with SMTP id p5mr62780350jan.43.1577966114673; Thu, 02 Jan 2020 03:55:14 -0800 (PST) MIME-Version: 1.0 References: <20200101141748.GA191637@mit.edu> <20200102110817.ahqaqidw3ztw3kax@10.255.255.10> In-Reply-To: <20200102110817.ahqaqidw3ztw3kax@10.255.255.10> From: Mikhail Gavrilov Date: Thu, 2 Jan 2020 16:55:32 +0500 Message-ID: Subject: Re: [bugreport] "hwclock -w" reset time instead of setting the right time To: Karel Zak Cc: util-linux@vger.kernel.org, Linux List Kernel Mailing , 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 On Thu, 2 Jan 2020 at 16:08, Karel Zak wrote: > > Can you try "hwclock -w -v" to get more details? > > For example on my workstation: > > # ./hwclock -w -v > hwclock from util-linux 2.35-rc1-20-63f8 > System Time: 1577963091.683987 > Trying to open: /dev/rtc0 > Using the rtc interface to the clock. > Last drift adjustment done at 1531914946 seconds after 1969 > Last calibration done at 1531914946 seconds after 1969 > Hardware clock is on UTC time > Assuming hardware clock is kept in UTC time. > RTC type: 'rtc_cmos' > Using delay: 0.500000 seconds > missed it - 1577963091.684767 is too far past 1577963091.500000 (0.184767 > 0.001000) > 1577963092.500000 is close enough to 1577963092.500000 (0.000000 < 0.002000) > Set RTC to 1577963092 (1577963091 + 1; refsystime = 1577963091.000000) > Setting Hardware Clock to 11:04:52 = 1577963092 seconds since 1969 > ioctl(RTC_SET_TIME) was successful. > Not adjusting drift factor because the --update-drift option was not used. > New /etc/adjtime data: > 0.000000 1577963091 0.000000 > 1577963091 > UTC > # hwclock -w -v hwclock from util-linux 2.35-rc1-20-63f8 System Time: 1577964536.796672 Trying to open: /dev/rtc0 Using the rtc interface to the clock. Last drift adjustment done at 1577950892 seconds after 1969 Last calibration done at 1577950892 seconds after 1969 Hardware clock is on UTC time Assuming hardware clock is kept in UTC time. RTC type: 'rtc_cmos' Using delay: 0.500000 seconds missed it - 1577964536.797135 is too far past 1577964536.500000 (0.297135 > 0.001000) 1577964537.500000 is close enough to 1577964537.500000 (0.000000 < 0.002000) Set RTC to 1577964537 (1577964536 + 1; refsystime = 1577964536.000000) Setting Hardware Clock to 11:28:57 = 1577964537 seconds since 1969 ioctl(RTC_SET_TIME) was successful. Not adjusting drift factor because the --update-drift option was not used. New /etc/adjtime data: 0.000000 1577964536 0.000000 1577964536 UTC Demonstration: https://youtu.be/Yx27IH2opEc -- Best Regards, Mike Gavrilov.