billw2 / rpi-clone

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

When naming a volume, need to check for spaces / escape #72

Open klapauciusisgreat opened 5 years ago

klapauciusisgreat commented 5 years ago

I ran into a problem when formating a new sdcard with -f, and it took me a few minutes to figure it out.

I entered a volume name (e.g. "Pihole 32" (without quotes) and that was passed directly to the mkfs command line, causing problems since part of the volume name was used to name the device, making mkfs fail..

I suggest to either escape spaces or (as a quick hack) just allowing [a-zA-z0-9] in the title and displaying an meaningful error message.