** Attachment added: "testdata script"
https://bugs.launchpad.net/ubuntu/+source/fuseiso/+bug/2109749/+attachment/5875077/+files/create_testdata.sh
** Description changed:
`du` and `stat` are reporting different sizes on a disk image with 2048
sectors, which are reported as the block size rather than 512.
- create_testdata.sh
- ```bash
- #!/bin/bash
- set -euo pipefail
-
- # Create test data directory
- TESTDIR="testdata"
- rm -rf "$TESTDIR"
- mkdir "$TESTDIR"
-
- # small.txt: simple static content
- echo "hello world" > "$TESTDIR/small.txt"
-
- # medium.bin: 1 MiB of zeroes
- truncate -s 1M "$TESTDIR/medium.bin"
-
- # unaligned.txt: 6387 bytes (not block-aligned)
- truncate -s 6387 "$TESTDIR/unaligned.txt"
-
- # Create ISO using genisoimage
- ISOFILE="test.iso"
- rm -f "$ISOFILE"
- genisoimage -o "$ISOFILE" -R -J "$TESTDIR"
-
- echo "✅ ISO created: $ISOFILE"
- ```
-
- test.sh
- ```bash
- #!/bin/bash
- set -euo pipefail
-
- method="$1"
- iso="$2"
- mountdir="${iso}.${method}"
-
- mkdir -p "$mountdir"
-
- case "$method" in
- sysmount) sudo mount -o loop,ro "$iso" "$mountdir" ;;
- fuseiso) fuseiso "$iso" "$mountdir" ;;
- patched) ./fuseiso "$iso" "$mountdir" ;;
- *) exit 1 ;;
- esac
-
- pushd "$mountdir" > /dev/null
- du -h *
- stat *
- popd
- sleep 0.5 # meh
-
- sudo umount "$mountdir"
- rmdir "$mountdir"
- ```
+ Attached a one-liner patch, create_testdata.sh and test.sh
results:
```
- (💻) gaz@blade:~/src/tmp/fuseiso$ ./create_testdata.sh
+ (💻) gaz@blade:~/src/tmp/fuseiso$ ./create_testdata.sh
I: -input-charset not specified, using utf-8 (detected in locale settings)
Total translation table size: 0
Total rockridge attributes bytes: 417
Total directory bytes: 626
Path table size(bytes): 10
Max brk space used 0
698 extents written (1 MB)
✅ ISO created: test.iso
-
(💻) gaz@blade:~/src/tmp/fuseiso$ for method in sysmount fuseiso patched;
do ./test.sh $method test.iso > $method.log; done
-
(💻) gaz@blade:~/src/tmp/fuseiso$ diff sysmount.log fuseiso.log
1,3c1,3
< 1.0M medium.bin
< 512 small.txt
< 6.5K unaligned.txt
---
> 256K medium.bin
> 0 small.txt
> 1.5K unaligned.txt
5,6c5,6
< Size: 1048576 Blocks: 2048 IO Block: 2048 regular file
< Device: 7,30 Inode: 1799 Links: 1
---
> Size: 1048576 Blocks: 512 IO Block: 2048 regular file
> Device: 0,142 Inode: 4 Links: 1
13,14c13,14
< Size: 12 Blocks: 1 IO Block: 2048 regular file
< Device: 7,30 Inode: 1803 Links: 1
---
> Size: 12 Blocks: 0 IO Block: 2048 regular file
> Device: 0,142 Inode: 5 Links: 1
21,22c21,22
< Size: 6387 Blocks: 13 IO Block: 2048 regular file
< Device: 7,30 Inode: 1807 Links: 1
---
> Size: 6387 Blocks: 3 IO Block: 2048 regular file
> Device: 0,142 Inode: 6 Links: 1
-
- (💻) gaz@blade:~/src/tmp/fuseiso$ diff sysmount.log patched.log
+ (💻) gaz@blade:~/src/tmp/fuseiso$ diff sysmount.log patched.log
6c6
< Device: 7,30 Inode: 1799 Links: 1
---
> Device: 0,142 Inode: 4 Links: 1
14c14
< Device: 7,30 Inode: 1803 Links: 1
---
> Device: 0,142 Inode: 5 Links: 1
22c22
< Device: 7,30 Inode: 1807 Links: 1
---
> Device: 0,142 Inode: 6 Links: 1
```
ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: fuseiso 20070708-3.2build3
ProcVersionSignature: Ubuntu 6.11.0-21.21~24.04.1-generic 6.11.11
Uname: Linux 6.11.0-21-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.28.1-0ubuntu3.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Wed Apr 30 14:38:03 2025
InstallationDate: Installed on 2024-11-16 (165 days ago)
InstallationMedia: Ubuntu 24.04.1 LTS "Noble Numbat" - Release amd64
(20240827.1)
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: fuseiso
UpgradeStatus: No upgrade log present (probably fresh install)
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2109749
Title:
du reports wrong file sizes on fuseiso mount - with fix
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fuseiso/+bug/2109749/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs