grub2 confusion

JB jb.1234abcd at gmail.com
Fri Oct 7 07:38:47 UTC 2011


Eric Blake <eblake <at> redhat.com> writes:

> ... 
> > cp -f ${grub_cfg}.new ${grub_cfg} ; rm -f ${grub_cfg}.new
> >
> > Better?
> 
> No.  cp is not atomic.  rename(2) (via mv(1), if both files are on the 
> same device) is.  Any solution that does not use rename(2) is flawed, 
> because an ill-timed power-outage will leave the file in an inconsistent 
> state.

Well, the only solution is a new option for mv(1), right ?
mv --follow-symlink ... 

JB




More information about the test mailing list