Bug #14755

Tails Installer treats drives differently depending on when they are plugged

Added by anonym 2017-10-02 09:39:21 . Updated 2017-11-15 11:33:55 .

Status:
Resolved
Priority:
High
Assignee:
Category:
Installation
Target version:
Start date:
2017-10-02
Due date:
% Done:

100%

Feature Branch:
tails:bugfix/14755-installer-consistent-drive-plugging-state
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Installer
Deliverable for:

Description

E.g. it matters if the drive is plugged before or after Tails installer is started.

It was reported on Reddit that if the drive was plugged before starting Tails Installer, installation failed with:

Partitioning device /dev/sdc1

GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error creating file system: Command-line `parted --script "/dev/sdc1" mktable gpt' exited with a non-zero exit status 1: Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Tails installation failed!

udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error creating file system: Command-line `parted --script "/dev/sdc1" mktable gpt' exited with a non-zero exit status 1: Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes.

(0)

It was resolved when they “[started] Utilities -> Disks, reformatted the drive, unplugged it, started the Tails installer, then plugged it back in”.

This is a regression introduced in Tails Installer 4.4.19 and Tails 3.2~rc1. It certainly sounds like an inconsistency on how the installer is initialized vs how it reacts to changes (of plugging/unplugging drives).


Files

output.txt (22091 B) cypherpunks, 2017-10-18 12:41:15

Subtasks


History

#1 Updated by anonym 2017-10-02 09:40:49

  • Priority changed from Normal to Elevated
  • Parent task set to Feature #9005

Reparenting to Feature #9005 since it must be a regression introduced in that work. Also raising priority vs the other children of Feature #9005, since this is an actual regression affecting users out there.

#2 Updated by cypherpunks 2017-10-18 12:41:16

I reproduced the bug. So what I did:
1. Booting a 16 GB JetFlash Transcend usb-stick with final Tales on it.
2. First plug in my second usb-stick (32 GB JetFlash Transcend, “W95 FAT32 (LBA) formatted”, no data on it).
3. Afterward execute “tails-installer —verbose” from the command line.
4. GUI: Keep the standard checkbox “clone the current Tails” and keep standard drop-down choice for 32 GB JetFlash usb-stick.
5. GUI: Press install and confirm the target usb-stick.
6. Installation fails with an error “Error creating file system”.

I put the log as attachement (three of my pc’s further devices are anonymized as “XXX1” up to “XXX3”). Note I also managed to clone Tails if I first started the Tails installer and then plugged in the second usb-stick.

#3 Updated by sg611 2017-10-26 23:00:31

The solution I found and someone else said worked for them was to delete the partition and then run the installer.
https://www.reddit.com/r/tails/comments/735fss/error_creating_file_system_when_installing_tails/doumgmj/

#4 Updated by sg611 2017-10-26 23:01:15

I meant to say delete all partitions on the target flash drive that you are preparing to install Tails onto.

#5 Updated by cypherpunks 2017-11-01 16:13:56

I experienced the same error message when trying to use Tails Installer to clone Tails from an intermediary DVD to a USB stick on an older iMac running 10.10. A quick Google search turned up bnuo’s Reddit post. AbandonedMantis’ proposed solution worked for me.

An easy solution is to flip the order of the instructions so that it would read:

1. Choose Applications > Tails > Tails Installer to start Tails Installer.

2. Plug the USB stick in the computer.

#6 Updated by intrigeri 2017-11-06 15:58:35

  • Assignee changed from anonym to kurono

kurono, do you want to take a look?

#7 Updated by intrigeri 2017-11-06 17:18:25

  • Priority changed from Elevated to High

At the foundations team / help desk meeting today this was classified as high priority: it seems to be the cause for ~60% of the reports received by help desk these days.

#8 Updated by anonym 2017-11-07 13:53:21

  • Assignee changed from kurono to anonym

I’ll give this one a try.

#9 Updated by goupille 2017-11-09 13:34:56

Someone reported that formatting the USB stick didn’t fix the issue. Instead, this user had to delete the partition (and do the unplug/plug thing) to work around the issue.

#10 Updated by intrigeri 2017-11-09 13:44:04

> Someone reported that formatting the USB stick didn’t fix the issue. Instead, thins user had to delete the partition (and do the unplug/plug thing) to work around the issue.

I suspect they formatted the partition (i.e. filesystem) and not the USB stick: “formatting” a USB stick creates a new, empty partition table, so there’s no way one can “delete the partition” after having formatted the USB stick.

#11 Updated by anonym 2017-11-10 11:08:45

  • Status changed from Confirmed to In Progress
  • Assignee changed from anonym to intrigeri
  • % Done changed from 0 to 50
  • QA Check set to Ready for QA
  • Feature Branch set to installer:bugfix/14755-consistent-drive-plugging-state

#12 Updated by intrigeri 2017-11-10 11:17:44

kurono, you’re the force_reinstall master here. Do you think you could have a look at anonym’s branch (ideally, once yours has been merged and anonym has resolved conflicts) e.g. tonight or tomorrow morning? If not, no big deal, I won’t block on this anyway.

#13 Updated by kurono 2017-11-10 11:31:02

intrigeri wrote:
> kurono, you’re the force_reinstall master here. Do you think you could have a look at anonym’s branch (ideally, once yours has been merged and anonym has resolved conflicts) e.g. tonight or tomorrow morning? If not, no big deal, I won’t block on this anyway.

ok, I will take a look.

#14 Updated by intrigeri 2017-11-10 11:37:09

  • Feature Branch changed from installer:bugfix/14755-consistent-drive-plugging-state to installer:bugfix/14755-consistent-drive-plugging-state, bugfix/14755-installer-consistent-drive-plugging-state

#15 Updated by intrigeri 2017-11-10 11:37:32

kurono wrote:
> ok, I will take a look.

Excellent :) I’ll ping you here once it’s time.

#16 Updated by intrigeri 2017-11-10 12:01:03

  • Assignee changed from intrigeri to anonym
  • QA Check changed from Ready for QA to Dev Needed

See Feature #14720#note-10.

#17 Updated by anonym 2017-11-10 17:42:52

  • Assignee changed from anonym to intrigeri
  • QA Check changed from Dev Needed to Ready for QA
  • Feature Branch changed from installer:bugfix/14755-consistent-drive-plugging-state, bugfix/14755-installer-consistent-drive-plugging-state to tails:bugfix/14755-installer-consistent-drive-plugging-state

I’ve optimistically built and prepared Tails Installer 5.0.2 in hope it’s good enough for Tails 3.3. This release solves:

It does not solve Feature #14720 due to Feature #14720#note-11, so Tails Installer 5.0.2 simply skips one of kurono’s commits.

Any way, a Tails build with Tails Installer 5.0.2 passes:

  • features/usb_install.feature
  • features/usb_upgrade.feature
  • features/persistence.feature

which now includes two new scenarios:

  • Installing Tails to a used USB drive (regression test for this ticket, Bug #14755)
  • Re-installing Tails over an existing USB installation with a persistent partition

so I’m hopeful!

#18 Updated by intrigeri 2017-11-11 09:50:25

Code review passes. I’ve verified that the newly added regression test for this bug fails when run on a 3.2 ISO. I’ll do a little bit of exploratory testing on Tails and Debian before merging.

#19 Updated by intrigeri 2017-11-11 10:47:49

  • Status changed from In Progress to Fix committed
  • % Done changed from 50 to 100

Applied in changeset commit:ddc95fba2cd76f10ee38a09682700ab059ba291a.

#20 Updated by intrigeri 2017-11-11 10:50:06

  • Assignee deleted (intrigeri)
  • QA Check changed from Ready for QA to Pass

I’ve trusted anonym’s test suite run and tested quite some use cases on Debian. Worked fine, the resulting sticks boot fine on a ThinkPad X200 and a MacBook Pro 8,1. Congrats!

#21 Updated by anonym 2017-11-15 11:33:55

  • Status changed from Fix committed to Resolved