On 14-12-2022 22:47, pelzflorian (Florian Pelz) wrote: > fsyncing the database had no effect. (In addition to Ludo’s > 'stop-service', I had done > > > fsync.patch > > diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm > index ef487805f0..13deffef85 100644 > --- a/gnu/installer/final.scm > +++ b/gnu/installer/final.scm > @@ -217,8 +217,16 @@ (define (assert-exit x) > ;; alive. > (stop-service 'guix-daemon) > > - ;; Restore the database and restart it. > + ;; Restore the database. > (copy-file saved-database database-file) > + > + ;; Sync it to the filesystem. > + (let* ((flags O_RDONLY) > + (fd (open database-file flags))) > + (fsync fd) > + (close fd)) > + So, I'm nominally 'on hiatus', but I noticed this mail, and noticed you copied a file (and fsync'ed it), but forgot to fsync the directory it was copied to -- from what I've read (but I don't recall the source), fsyncing the contents of the file isn't enough, you also need to fsync the directory such that the new file entry is in the directory after crashing. Greetings, Maxime.