Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: hardlinks are counted as individual files #923

Open
thingsiplay opened this issue Apr 7, 2024 · 1 comment
Open

bug: hardlinks are counted as individual files #923

thingsiplay opened this issue Apr 7, 2024 · 1 comment
Labels
errors Something isn't working

Comments

@thingsiplay
Copy link

System Information

  • The version of eza being used (eza --version)
$ eza --version
eza - A modern, maintained replacement for ls
v0.18.9 [+git]
https://github.com/eza-community/eza
  • The command-line arguments you are using
-l --total-size --no-permissions --no-user ./trampoline
  • Your operating system and hardware platform

If it’s a crash, please include the full text of the crash that gets printed to the screen. If you’re seeing unexpected behaviour, a screenshot of the issue will help a lot.

$ fastfetch --logo none --gpu-format '{2} [{6}] {3}' --gpu-force-vulkan
OS: EndeavourOS x86_64
Kernel: 6.8.4-zen1-1-zen
Uptime: 9 hours, 34 mins
Packages: 1562 (pacman), 14 (flatpak)
Shell: bash 5.2.26
Display (AG271QG): 2560x1440 @ 120Hz
DE: KDE Plasma 6.0.3
WM: KWin (Wayland)
WM Theme: Breeze
Theme: Breeze (Dark) [QT], Breeze-Dark [GTK2], Breeze [GTK3/4]
Icons: breeze-dark [QT], breeze-dark [GTK2/3/4]
Font: NotoSans Nerd Font (12pt) [QT], NotoSans Nerd Font (12pt) [GTK2/3/4]
Cursor: breeze (24px)
Terminal: konsole 24.2.1
Terminal Font: JetBrainsMono Nerd Font Mono (11pt)
CPU: AMD Ryzen 7 7700X (16) @ 5,57 GHz
GPU 1: AMD Radeon RX 7600 (RADV NAVI33) [Discrete] Mesa 24.0.4-arch1.2
GPU 2: AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO) [Integrated] Mesa 24.0.4-arch1.2
Memory: 5,05 GiB / 30,50 GiB (17%)
Swap: 12,00 MiB / 512,00 MiB (2%)
Disk (/): 456,55 GiB / 1,79 TiB (25%) - ext4
Disk (/media/Emulation): 4,72 TiB / 5,41 TiB (87%) - ext4
Disk (/media/My): 1,76 TiB / 3,58 TiB (49%) - ext4
Disk (/media/Work): 442,32 GiB / 915,82 GiB (48%) - ext4
Local IP (eno1): 192.168.1.242/24 *
Locale: en_US.UTF-8

The problem

Today I noticed a discrepancy in the output of total folder sizes, compared to other programs. eza had way too high numbers for some folders. As comparison I looked at the filemanager Dolphin (properties with right mouse click) and with commandline tool:

du --human-readable --apparent-size --all --max-depth 1 ./trampoline

with and without --si option. The 1000 vs 1024 base of bit counting is not the issue here. After some digging into my files and folders and comparing stuff, I found out that for hardlink files eza counts them individually. But that is wrong, because those files exist only once on the drive and require the space only once. ls can show the number of hardlinks each file has:

$ \ls -l
total 9404
-rwxr-xr-x 2 tuncay tuncay 4810688  5. Apr 10:47 build-script-main
-rwxr-xr-x 2 tuncay tuncay 4810688  5. Apr 10:47 build_script_main-947fc87152b779c9
-rw-r--r-- 1 tuncay tuncay    2298  5. Apr 10:47 build_script_main-947fc87152b779c9.d

The 2 is the number of hardlinks for the same file.

@thingsiplay thingsiplay added the errors Something isn't working label Apr 7, 2024
@Kol9yN
Copy link

Kol9yN commented May 20, 2024

Approved, here LS example, err file is main, err_hl is hardlink to err, but it daznt show properly

HardLink-Broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants