Nautiuls "File Operations" dialog does not handle hard links well when calculating size or copying

Bug #644403 reported by Zach Shepherd
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
nautilus (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: nautilus

The attached screenshot shows the reported total file size of 993.7GB (it has sense climbed past 1500GB). The output of df (below) reports the full size of the "1 TB" drive as 917 GB.

$ df -h
Filesystem Size Used Avail Use% Mounted on
<snip>
/dev/sdb1 917G 505G 413G 56% /media/<snip>

The file system contains a large number of hard links, which I imagine is the cause of the size inaccuracy.

ProblemType: Bug
Architecture: amd64
Date: Tue Sep 21 10:21:52 2010
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: nautilus 1:2.28.1-0ubuntu3
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-22.60-generic
SourcePackage: nautilus
Uname: Linux 2.6.31-22-generic x86_64

Revision history for this message
Zach Shepherd (eightball1989) wrote :
Revision history for this message
Zach Shepherd (eightball1989) wrote :

It's now at 64,911,474 files (16024.4 GB) and still climbing. If there's any information I can provide about the directory structure or contents that would be helpful, just let me know.

Revision history for this message
Wolfgang Kufner (wolfgangkufner) wrote :

Nautilus seems to treat each hardlink as a separate file. Both on calculating size and on copying.
I just tried to copy a directory full of hardlinks and it makes separate files (KDE's dolphin file manager also does this). So, in a way it is consistent - if you were to copy a folder full of hardlinks with nautilus you would need that much space on the destination.

consequences:
huge size explosion if a folder with many hardlinks (e.g. the backup folder generated by the backup program "back in time") is copied
loss of some information: with find -samefile you can find the other names pointing to the same data (inode); that information is gone in the copy nautilus makes;

All this is problematic. Nautilus tries to keep things simple. That's why it does not offer a way to make hardlinks. But if things are already complicated - if hardlinks are already present - just ignoring them can lead to problems of its own.

I do not know how to handle this comprehensively, but it might be a good idea for nautilus to at least display a warning.
That warning might also be used to tell the user that commands like cp -a can preserve hardlinks.

summary: - Nautiuls "File Operations" dialog does not handle hard links correctly
- when calculating size
+ Nautiuls "File Operations" dialog does not handle hard links well when
+ calculating size or copying
Changed in nautilus (Ubuntu):
status: New → Confirmed
Changed in nautilus (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.