Help users when first-boot resizing fails and creates a semi-broken USB stick
In wb:2f375e2573c7480db4048ada3971da97
I see a USB stick that seems installed from a USB image, but whose system partition is still 1.3GB. So for whatever reason, the resizing dance we do on first boot did not happen, or failed.
As expected the kernel is not fully happy with this:
Jul 21 04:50:03 amnesia kernel: GPT:Primary header thinks Alt. header is not at the end of the disk.
Jul 21 04:50:03 amnesia kernel: GPT:2574335 != 120913919
Jul 21 04:50:03 amnesia kernel: GPT:Alternate GPT header not at the end of the disk.
Jul 21 04:50:03 amnesia kernel: GPT:2574335 != 120913919
Jul 21 04:50:03 amnesia kernel: GPT: Use GNU Parted to correct GPT errors.
And creating a Persistent Storage fails:
Jul 21 04:53:28 amnesia tpsd[5116]: INFO:service.py:153: Creating Persistent Storage...
Jul 21 04:53:28 amnesia tpsd[5116]: INFO:device.py:330: [1] Creating partition
Jul 21 04:53:28 amnesia udisksd[3690]: [parted] Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra
118339584 blocks) or continue with the current setting?
Jul 21 04:53:28 amnesia udisksd[3690]: [parted] Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra
118339584 blocks) or continue with the current setting?
Jul 21 04:53:28 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/Persistent
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/.mozilla/firefox/bookmarks
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/var/lib/gdm3/settings/persistent
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/etc/NetworkManager/system-connections
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/var/lib/tca
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/var/cache/apt/archives
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/etc/cups
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/.thunderbird
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/.gnupg
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/.electrum
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/.purple
Jul 21 04:53:29 amnesia tpsd[5116]: INFO:binding.py:496: [1] Executing command mountpoint --quiet --nofollow /run/nosymfollow/home/amnesia/.ssh
Jul 21 04:53:29 amnesia tpsd[5116]: ERROR:object.py:201: [1] udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error creating partition on
/dev/sdb: Failed add partition to device '/dev/sdb' (Unable to satisfy all constraints on the partition.) (0)
Jul 21 04:53:29 amnesia tpsd[5116]: Traceback (most recent call last):
Jul 21 04:53:29 amnesia tpsd[5116]: File "/usr/lib/python3/dist-packages/tps/dbus/object.py", line 178, in handle_method_call_inner
Jul 21 04:53:29 amnesia tpsd[5116]: result = func(*parameters)
Jul 21 04:53:29 amnesia tpsd[5116]: File "/usr/lib/python3/dist-packages/tps/service.py", line 162, in Create
Jul 21 04:53:29 amnesia tpsd[5116]: self.do_create(passphrase)
Jul 21 04:53:29 amnesia tpsd[5116]: File "/usr/lib/python3/dist-packages/tps/service.py", line 172, in do_create
Jul 21 04:53:29 amnesia tpsd[5116]: self._tps_partition = TPSPartition.create(job, passphrase)
Jul 21 04:53:29 amnesia tpsd[5116]: File "/usr/lib/python3/dist-packages/tps/device.py", line 333, in create
Jul 21 04:53:29 amnesia tpsd[5116]: object_path = partition_table.call_create_partition_sync(
Jul 21 04:53:29 amnesia tpsd[5116]: gi.repository.GLib.GError: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error creating partition on
/dev/sdb: Failed add partition to device '/dev/sdb' (Unable to satisfy all constraints on the partition.) (0)
Jul 21 04:53:29 amnesia tails-persistent-storage[8471]: ERROR:window.py:209: failed to create Persistent Storage: GDBus.Error:gi.repository.GLib.Error:
udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error creating partition on /dev/sdb: Failed add partition to device '/dev/sdb' (Unable to
satisfy all constraints on the partition.) (0)
I think not creating a Persistent Storage is the correct behavior here: the user likely won't be able to ever upgrade this USB stick, so storing persistent data on it seems like a bad idea.
But the UX here seems suboptimal: the user does not know their USB stick is in a unsupported, somewhat broken, not-upgradable, state. They'll only notice consequences such as no space for upgrades and not possible to create Persistent Storage.
Ideally we would detect this situation (we can: git grep 17B81DA0-8B1E-4269-9C39-FE5C7B9B58A3
) and help the user fix the situation. How, one may ask? It's probably worth trying to reinstall, worst case switching to another USB stick.
cc @segfault who did the initial implementation of the first-boot resizing, and @sajolida who may have design ideas.
We've received 3 other similar bug reports in the last 2 months: wb:68a2dede603f9dded468134cda9f9d5
, wb:a8fbb0bcbae4c72f6453a1b977745dc0
, wb:1c6b0f89e9eaff2cdb97d93e23b6c69f
. 4 reports in 2 months does not make this high priority, but still, worth at least tracking on GitLab.