mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
Count hard links when sizing virtual disks
cptofs does not preserve hard links, so each hard link needs to be accounted for separately when sizing virtual disks
This commit is contained in:
parent
0bb31825c5
commit
17555cad79
1 changed files with 1 additions and 1 deletions
|
@ -470,7 +470,7 @@ let format' = format; in let
|
|||
additionalSpace=$(( $(numfmt --from=iec '${additionalSpace}') + reservedSpace ))
|
||||
|
||||
# Compute required space in filesystem blocks
|
||||
diskUsage=$(find . ! -type d -print0 | du --files0-from=- --apparent-size --block-size "${blockSize}" | cut -f1 | sum_lines)
|
||||
diskUsage=$(find . ! -type d -print0 | du --files0-from=- --apparent-size --count-links --block-size "${blockSize}" | cut -f1 | sum_lines)
|
||||
# Each inode takes space!
|
||||
numInodes=$(find . | wc -l)
|
||||
# Convert to bytes, inodes take two blocks each!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue