[kwlug-disc] Presentation: replacing a laptop's hard disk

Khalid Baheyeldin kb at 2bits.com
Wed Sep 16 17:25:58 EDT 2015


And I answered his question.

To clarify:

cp -a copies as you quoted from the manual. But the source file would
have its access time updated to now, rather than when the file was
last really accessed. Think of a file that you did not read for 4
years. Now it says it was read today.

cpio -a avoids that by resetting the last access time of the files it copies.

In the case of replacing an ailing hard disk, this is not a big deal,
since it will be junked.

Also, many systems now run with noatime as a filesystem level option,
meaning the last access time is not updated.

The other reason for cpio is copying special files and files with
funny characters in their names.

On Wed, Sep 16, 2015 at 5:05 PM, B.S. <bs27975 at yahoo.ca> wrote:
> Right, but his question was not why 'cpio -a' but how does 'cp -a' not take you to the same place?
>
> (Per man cp "preserve  the  specified  attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all")
>
> ----- Original Message -----
>> From: Khalid Baheyeldin <kb at 2bits.com>
>> To: KWLUG discussion <kwlug-disc at kwlug.org>
>> Cc:
>> Sent: Wednesday, September 16, 2015 4:59 PM
>> Subject: Re: [kwlug-disc] Presentation: replacing a laptop's hard disk
>>
>> On Wed, Sep 16, 2015 at 4:54 PM, B.S. <bs27975 at yahoo.ca> wrote:
>>>>  Also, cpio -a resets
>>>
>>>  He said cp, not cpio.
>>
>> I know.
>>
>> What I am saying is that with cpio and its -a option, you leave the
>> file system is the state it was in (access times not update).
>
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>



-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple,
and wrong." -- H.L. Mencken





More information about the kwlug-disc mailing list