Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armbian-install: add option to wipe target destination #6828

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Conversation

igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Jun 29, 2024

Description

armbian-installer have troubles if we are installing OS to SSD with previously defined partitions. Adding a recommended option to start with a clean drive - wiping everything - is one way. In this case, our installer starts in predicted way. Also it gives user no option to choose wrong (too small) partition, if there are more of them pre-made.

Jira reference number AR-2393
https://forum.armbian.com/topic/41699-how-to-debugfix-armbian-config-for-kernel-update/#comment-195551

How Has This Been Tested?

  • Made several installs to nvme with several or no partitions

Checklist:

  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@igorpecovnik igorpecovnik requested a review from a team as a code owner June 29, 2024 07:47
@igorpecovnik igorpecovnik added Bugfix Pull request is fixing a bug 08 Milestone: Third quarter release labels Jun 29, 2024
@github-actions github-actions bot added size/small PR with less then 50 lines BSP Board Support Packages labels Jun 29, 2024
@igorpecovnik igorpecovnik added Needs review Seeking for review and removed BSP Board Support Packages labels Jun 29, 2024
@hi-ko
Copy link

hi-ko commented Jun 29, 2024

Although partitioning is not my issue, I've also seen that the installer complained about too small partitions. I had choosen a 100 GB partition but the installer complained that there is only 125 MB left. Finally I found out, that this happens if the partition is still mounted from a previous install attempt (or even from a manual mount).

@ColorfulRhino
Copy link
Collaborator

ColorfulRhino commented Jun 29, 2024

armbian-installer have troubles if we are installing OS to SSD with previously defined partitions

Although I'm way more in favor of developing an actual solution to the problem instead of a workaround, I believe the proposed workaround has several other things that we should not do:

  • We should never make it so easy for the user to delete their whole drive. There should be like three warnings and SOME HUGE LETTERS AND BE CAREFUL YOUR DATA IS LOST
  • We should not use dd to wipe a whole drive just to remove partitions since this will unnecessarily wear down SD cards and SSDs which don't like to be written over and over again.
  • We should not force the user to make a single big partition spanning 100% of their drive since with SSDs you somtimes want to use over-provisioning (meaning leaving like 10% free space unpartitioned on the SSD)
  • We should not force the user to use ext4

I am happy to assist in developing a solution for the actual problem, like making everything work even with previously defined partitions :)

@github-actions github-actions bot added the BSP Board Support Packages label Jun 29, 2024
@igorpecovnik
Copy link
Member Author

igorpecovnik commented Jun 29, 2024

We should never make it so easy for the user to delete their whole drive.

Added another check in the line.

We should not use dd to wipe a whole drive just to remove partitions since this will unnecessarily wear down SD cards and SSDs which don't like to be written over and over again.

We only wipe out partition defs.

We should not force the user to make a single big partition spanning 100% of their drive since with SSDs you somtimes want to use over-provisioning (meaning leaving like 10% free space unpartitioned on the SSD)

Agree, but this would require some work. Expanding this tool or ... introduce some solution like Calamares?

We should not force the user to use ext4

We don't. Formating is done in next step. I have removed formating in the wipe part.

@igorpecovnik
Copy link
Member Author

I had choosen a 100 GB partition but the installer complained that there is only 125 MB left.

Yes, this part we need to look into. With my solution / workaround this can't happen as we do auto partitioning. For most users this is just fine, but I do agree that we need some expansion of functionality. But before we do that, basic functions should work well.

@igorpecovnik
Copy link
Member Author

@ColorfulRhino can we proceed with this. Still better to have this in before developing something better.

Copy link
Collaborator

@ColorfulRhino ColorfulRhino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading from the forum topic, I believe the issue was sometheing else in the end? Like needing to set the boot flag on the correct partition.

I'll see if I can come up with a solution that can check and enable the boot flag on a partition :)

@hi-ko
Copy link

hi-ko commented Jul 3, 2024

short version

having something like parted ${ARMBIAN_PARTITION} set 1 boot on in arbian-install would have avoided my issue discussed in the forum.

long version

I had three issues, described in the forum thread:

  • inconsistent /etc/armbian-release file due to renaming BOARDFAMILY to rockchip64 which broke armbian-config / armbian-install
  • unbootable system after running armbian-config to switch/update the kernel (which then may not fit to the bootloader config)
  • unbootable system after running armbian-install from sdcard to install into a manual wiped partition due to missing boot flag on that partition

supporting multiple partitions should be always seen as best practice since it may be required to replace the armbian partition from time to time (since there is no such thing like a do-release-upgrade for now). Having one or more data partitions, which will guarantee to survive, could be a life saver then.

That does not necessarily mean, that all scenarios should be supported by the armbian-install. Experienced people have no problems in rsyning the sdcard to a custom partition or to wipe an already used partition but they may need to know the steps expected to be done and the knowledge how to configure/check the bootloader. at least for me u-boot is new territory. I will need to dig into u-boot and your scripts.

So my suggestion to start with is:

we should document (I could help on that)

  • the steps to be done manually if not using armbian-install
  • the not supported scenarios by armbian-install

features I would like to have are:

  • run armbian-install with parameters / without dialogue (e.g. armbian-install --bootloader-mtd-flash /dev/nvme0n1p2 /mnt/armbian/boot/)

@igorpecovnik
Copy link
Member Author

features I would like to have are:

I would suggest to open a Jira ticket, so this information above is not lost. Not sure when this will be possible to implement, but chances are bigger if ticket exits. Here are basic instructions how-to: https://www.armbian.com/participate/

we should document (I could help on that)

Add this into this secton:
https://docs.armbian.com/User-Guide_Getting-Started/#how-to-install-to-emmc-sata-nvme-usb

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Jul 4, 2024
@igorpecovnik igorpecovnik merged commit a2f9e1f into main Jul 4, 2024
7 checks passed
@igorpecovnik igorpecovnik deleted the AR-2393 branch July 4, 2024 19:35
@ColorfulRhino
Copy link
Collaborator

ColorfulRhino commented Jul 7, 2024

I would suggest to open a Jira ticket, so this information above is not lost. Not sure when this will be possible to implement, but chances are bigger if ticket exits. Here are basic instructions how-to: https://www.armbian.com/participate/

I have created a new task at #6905 which automatically gets mirrored to https://armbian.atlassian.net/browse/AR-2410 (checked if there was a similar Jira ticket already created but could not find one)

One of the issues with Jira is that newcomers don't have access to create new tasks (at least I didn't have when I tried to the first time). Also on GH I believe more people will see it and we can also introduce the "good first issue" label :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
08 Milestone: Third quarter release BSP Board Support Packages Bugfix Pull request is fixing a bug Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

3 participants