[Bug 2060050] [NEW] [3.X] Unreliable rootfs size measurement

Paul Mars 2060050 at bugs.launchpad.net
Tue Apr 2 15:03:06 UTC 2024


Public bug reported:

Before populating the partitions during a classic image build, ubuntu-
image calculates the rootfs size by calling `du -s -B1`. On ZFS, this
might return a compressed size, and thus not the real size of the
directory once written to another FS (in our case for example ext4).


To fix this, I see several solutions:

- recursively walk the rootfs directory with filepath.Walk and sum everything
- use the `--apparent-size` flag of du

** Affects: ubuntu-image
     Importance: Medium
     Assignee: Paul Mars (upils)
         Status: Confirmed

** Changed in: ubuntu-image
       Status: New => Confirmed

** Changed in: ubuntu-image
   Importance: Undecided => Medium

** Changed in: ubuntu-image
     Assignee: (unassigned) => Paul Mars (upils)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to Ubuntu Image.
https://bugs.launchpad.net/bugs/2060050

Title:
  [3.X] Unreliable rootfs size measurement

Status in Ubuntu Image:
  Confirmed

Bug description:
  Before populating the partitions during a classic image build, ubuntu-
  image calculates the rootfs size by calling `du -s -B1`. On ZFS, this
  might return a compressed size, and thus not the real size of the
  directory once written to another FS (in our case for example ext4).

  
  To fix this, I see several solutions:

  - recursively walk the rootfs directory with filepath.Walk and sum everything
  - use the `--apparent-size` flag of du

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-image/+bug/2060050/+subscriptions




More information about the foundations-bugs mailing list