billw2 / rpi-clone

A shell script to clone a booted disk.
BSD 3-Clause "New" or "Revised" License
2.48k stars 327 forks source link

Destination Disk Label with Space #171

Open ISO8807 opened 7 months ago

ISO8807 commented 7 months ago

When running the current version of rpi-clone, I innocently used a space in the destination label:

Optional destination ext type file system label (16 chars max): Backup 231111

This led to some nasty looking errors:

rpi-clone mount: /mnt/clone: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error

Mount failure of /dev/sda2 on /mnt/clone

I then found it was trying to create a filesystem using "-L Backup 231111" which was understandably being parsed incorrectly.

It would be as well to disallow spaces (and certain other characters) in the destination disk label.