GNU bug report logs - #57232
[installer] ENTER in guided partitioner destroys partition table

Previous Next

Package: guix;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Mon, 15 Aug 2022 23:13:01 UTC

Severity: important

Done: Mathieu Othacehe <mathieu <at> meije.mail-host-address-is-not-set>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57232 in the body.
You can then email your comments to 57232 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#57232; Package guix. (Mon, 15 Aug 2022 23:13:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 15 Aug 2022 23:13:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Bug reports for GNU Guix <bug-guix <at> gnu.org>
Subject: [installer] ENTER in guided partitioner destroys partition table
Date: Tue, 16 Aug 2022 01:05:29 +0200
[Message part 1 (text/plain, inline)]
Hi all,

Whilst testing the graphical installer, I selected ‘guided 
partitioning’ and pressed ENTER on the main drive (sda) to see 
what that does.

What that does is immediately and without confirmation wipe the 
on-disc partition table.  And its back-up.

Testdisk is great,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#57232; Package guix. (Tue, 16 Aug 2022 08:53:01 GMT) Full text and rfc822 format available.

Message #8 received at 57232 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 57232 <at> debbugs.gnu.org
Subject: Re: bug#57232: [installer] ENTER in guided partitioner destroys
 partition table
Date: Tue, 16 Aug 2022 10:51:43 +0200
[Message part 1 (text/plain, inline)]
Hey Tobias,

> What that does is immediately and without confirmation wipe the on-disc
> partition table.  And its back-up.

Oops, glad you were able to recover, I was also bitten in the past. The
attached patch adds an extra confirmation page before wiping everything,
WDYT?

Mathieu
[0001-installer-partition-Add-a-confirmation-page-before-f.patch (text/x-patch, inline)]
From 4a9c1fb1fe7f9a65b2b7d1f9e4419b1d28a8082e Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe <at> gnu.org>
Date: Tue, 16 Aug 2022 10:49:07 +0200
Subject: [PATCH 1/1] installer: partition: Add a confirmation page before
 formatting.

Fixes: <https://issues.guix.gnu.org/57232>.

* gnu/installer/newt/partition.scm (run-label-confirmation-page): New
procedure.
(run-label-page): Call the above procedure before proceeding.
---
 gnu/installer/newt/partition.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm
index e7a97810ac..f11a644f92 100644
--- a/gnu/installer/newt/partition.scm
+++ b/gnu/installer/newt/partition.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018, 2019 Mathieu Othacehe <m.othacehe <at> gmail.com>
+;;; Copyright © 2018, 2019, 2022 Mathieu Othacehe <m.othacehe <at> gmail.com>
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;;
@@ -92,6 +92,15 @@ (define (device-items)
          (device (car result)))
     device))
 
+(define (run-label-confirmation-page callback)
+  (lambda (item)
+    (and (run-confirmation-page
+          (format #f (G_ "This will create a new ~a partition table, \
+all data on disk will be lost, are you sure you want to proceed?") item)
+          (G_ "Format disk?")
+          #:exit-button-procedure callback)
+         item)))
+
 (define (run-label-page button-text button-callback)
   "Run a page asking the user to select a partition table label."
   ;; Force the GPT label if UEFI is supported.
@@ -103,6 +112,8 @@ (define (run-label-page button-text button-callback)
        #:title (G_ "Partition table")
        #:listbox-items '("msdos" "gpt")
        #:listbox-item->text identity
+       #:listbox-callback-procedure
+       (run-label-confirmation-page button-callback)
        #:button-text button-text
        #:button-callback-procedure button-callback)))
 
-- 
2.37.1


Information forwarded to bug-guix <at> gnu.org:
bug#57232; Package guix. (Tue, 16 Aug 2022 17:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 57232 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 57232 <at> debbugs.gnu.org
Subject: Re: bug#57232: [installer] ENTER in guided partitioner destroys
 partition table
Date: Tue, 16 Aug 2022 18:55:05 +0200
[Message part 1 (text/plain, inline)]
Hi Mathieu!

Mathieu Othacehe 写道:
>> What that does is immediately and without confirmation wipe the 
>> on-disc
>> partition table.  And its back-up.
>
> Oops, glad you were able to recover, I was also bitten in the 
> past.

My mistake for insisting on a bare metal test without a throwaway 
machine handy :-)

> The attached patch adds an extra confirmation page before wiping
> everything, WDYT?

Code looks all right.  I'll try it out.  Thanks!

The help text for users reads, in part:

 “You can change a disk's partition table by selecting it and 
 pressing ENTER.”

Er, I was… expecting that to mean it would pop up a pretty window 
or something.  Is this really a feature?  Should it be?

I have to be honest: I was extremely let down by the installer UX, 
*because* I read a lot of the code and can see how much effort 
went into it.  I hate pointing out that the partitioner is at once 
less useful and more dangerous than (system "fdisk").

:-/,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#57232; Package guix. (Tue, 16 Aug 2022 21:43:02 GMT) Full text and rfc822 format available.

Message #14 received at 57232 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 57232 <at> debbugs.gnu.org
Subject: Re: bug#57232: [installer] ENTER in guided partitioner destroys
 partition table
Date: Tue, 16 Aug 2022 23:42:00 +0200
Hey,

>  “You can change a disk's partition table by selecting it and   pressing
> ENTER.”
>
> Er, I was… expecting that to mean it would pop up a pretty window or
> something.  Is this really a feature?  Should it be?

I'm not sure what's the point here.

> I have to be honest: I was extremely let down by the installer UX, *because* I
> read a lot of the code and can see how much effort went into it.  I hate
> pointing out that the partitioner is at once less useful and more dangerous
> than (system "fdisk").

Many people have contributed to the installer over the years. Your
remark is both harsh and unconstructive. I don't think that the fact
that you, Tobias, are extremely let down matters much to the project.

Calling "fdisk" or "parted" directly would not provide the
auto-partitioning feature, and would be less convenient when it comes to
encryption and partition mount points selection.

It's no secret that the partitioning code can be improved like many
other Guix areas. If you feel like you can refine it, in term of
stability and general UX, we would be glad to get your support.

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#57232; Package guix. (Wed, 17 Aug 2022 00:44:01 GMT) Full text and rfc822 format available.

Message #17 received at 57232 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 57232 <at> debbugs.gnu.org
Subject: Re: bug#57232: [installer] ENTER in guided partitioner destroys
 partition table
Date: Wed, 17 Aug 2022 01:40:42 +0200
[Message part 1 (text/plain, inline)]
Hi Mathieu,

Mathieu Othacehe 写道:
>> Er, I was… expecting that to mean it would pop up a pretty 
>> window or
>> something.  Is this really a feature?  Should it be?
>
> I'm not sure what's the point here.

I'm not sure whose point you're referring to, so I'll clarify 
mine.

Currently, pressing ENTER on a whole disc device wipes its 
partition table, or at  least did so for me (MBR).  That's an 
unexpected way ‘to change a disk's partition table’ even if it's 
technically true.

It wasn't clear to me whether it was intentional, or a bug, or 
perhaps a bit of both.  Hence my question.  I agree that we should 
warn before writing anything, but that's somewhat orthogonal.

I had rewritten the dialogue before encountering this issue, but 
it doesn't seem like I understand the intention behind the design 
very well.  I'll drop the UI-related patches and leave that effort 
to someone who does.

> we would be glad to get your support.

That wasn't the impression I got in response to some mild 
criticism, but thanks.  I'll keep working on it when I get that 
spare machine :-)

(I do consider the installer important to the project, even if I 
never claimed to be its target audience.)

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 05 Sep 2022 13:08:02 GMT) Full text and rfc822 format available.

Added indication that bug 57232 blocks53214 Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 05 Sep 2022 13:09:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 57232 <at> debbugs.gnu.org and Tobias Geerinckx-Rice <me <at> tobias.gr> Request was from Mathieu Othacehe <mathieu <at> meije.mail-host-address-is-not-set> to control <at> debbugs.gnu.org. (Thu, 13 Oct 2022 08:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#57232; Package guix. (Thu, 13 Oct 2022 08:52:03 GMT) Full text and rfc822 format available.

Message #26 received at 57232-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 57232-done <at> debbugs.gnu.org
Subject: Re: bug#57232: [installer] ENTER in guided partitioner destroys
 partition table
Date: Thu, 13 Oct 2022 10:50:53 +0200
Hey,

> Fixes: <https://issues.guix.gnu.org/57232>.
>
> * gnu/installer/newt/partition.scm (run-label-confirmation-page): New
> procedure.
> (run-label-page): Call the above procedure before proceeding.

I pushed a slightly edited version of this patch.

Thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Nov 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.