geerlingguy / rpi-clone

A shell script to clone a booted disk on a Raspberry Pi.
https://rpi-clone.jeffgeerling.com/
BSD 3-Clause "New" or "Revised" License
172 stars 10 forks source link

Removing support for non-PARTUUID systems #23

Open matthijskooijman opened 2 months ago

matthijskooijman commented 2 months ago

I mentioned this in #21, but I think this might actually deserve independent discussion, hence this issue.

Rpi-gen currently supports systems that use direct device names (e.g. /dev/mmcblk0p1) to reference partitions in cmdline.txt and fstab. This supports consists of two parts:

  1. The --edit-fstab edit that tells rpi-clone about the new device name and makes it replace reference to the old device name with reference to the new device name (and some code to do this automatically when cloning back to an SD card for some reason that is unclear to me).
  2. The --convert-fstab-to-partuuid option, that replaces direct references to the device partitions with PARTUUID references, which are more stable and easier to manage.

However, raspbian started using PARTUUIDs in 2017, so I expect these options are likely not used and not really needed anymore. Also other possibly supported systems such as Ubuntu and Armbian use UUIDs (filesystem UUIDS instead of PARTUUIDs, which need some small changes to support, but these are at least not raw device names).

So would suggest considering to remove these features, which would significantly simplify the some parts of the code which helps with readability and make future changes easier. Would that be something you would accept a PR for?

Two reasons people might still use these options are if they are running a real old (>6 years) system, or when they are adding extra partitions manually to fstab. In the former case, people are likely already running rpi-clone and can just stick to their current version. In the latter case, people can just manually add/convert to PARTUUIDs instead of raw device names (so this is a matter of documentation, and maybe a runtime check/warning to point people at the documentation).

Note that in #21 I only talked about --convert-fstab-to-partuuid, but looking through the code more, I realized that the same holds for --edit-fstab.