Don't convert partuuids for empty src_partition element #149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When converting to partuuids, if there is an empty element in
${src_partition[@]}
, then/etc/fstab
will have/dev/
replaced withPARTUUID=
without actually changing the device name to a PARTUUID.I don't have the exact logs when this happened to me, but it looked something like this:
and I ended up with a broken fstab:
I had previously run
sudo rpi-clone -l sda
so perhaps that is why there was an empty element insrc_partition
, I'm not sure.Changes
Check that
${src_partition[p]}
is not empty before editing/etc/fstab
.Then, the command I used will instead exit with an error, which is much safer: