Operating System - HP-UX
1753716 Members
4869 Online
108799 Solutions
New Discussion

question about cp -f command

 

question about cp -f command

Hi,
When I overwrite an existing file using cp -f, will the new file (or a part of it if they are different in size) be written in the same physical place (on the disk)?

Thanks.
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: question about cp -f command

That depends on the filesystem and disk being used.

On SSD disks, the wear leveling algorithm built into the disk's flash memory controller makes overwriting the same physical location very unlikely. On regular spinning disks using a traditional filesystem, the answer is more like "maybe, but not explicitly guaranteed".

On something more complex, like a NFS filesystem on a NetApp WAFL (Write Anywhere File Layout), you'll probably have to be a storage system guru to know for sure.

MK
MK