Does mv on a FAT filesystem actually rename or does it copy and delete?
Ken D'Ambrosio
ken at jots.org
Sat Feb 3 15:14:07 UTC 2018
On 2018-02-03 10:09, Chris Green wrote:
> On Sat, Feb 03, 2018 at 09:14:39AM -0500, Little Girl wrote:
>> Hey there,
>>
>> Chris Green wrote:
>>
>> > I want to rename some picture files on a mounted digital camera
>> > filesystem. It is a VFAT filesystem.
>> >
>> > If I rename one of the files using 'mv <xxxx.yyy>' will the file
>> > *actually* be renamed by changing the directory entry only or will
>> > mv copy the file to one with the new name and then delete the old
>> > one?
>>
>> This page might be useful:
>>
>> https://unix.stackexchange.com/questions/149795/move-preserves-ownership-of-source-files-not-allowing-writes
>>
>
> It doesn't really address my issue which is whether mv will work the
> same on FAT/VFAT as it does on 'native' Linux filesystems.
I already answered that a few hours ago:
Definitive answer: I created a loopback FAT32 filesystem, mounted it,
and did a "strace mv file file2":
[...]
rename("file", "file2") = 0
Likewise, from a directory "mv":
rename("foo", "foodir") = 0
Same thing. It's rename().
-Ken
More information about the ubuntu-users
mailing list