hypriot / flash

Command line script to flash SD card images of any kind
MIT License
1.01k stars 173 forks source link

`umount` fails if existing partition has a space in the name #80

Closed ryaninvents closed 8 years ago

ryaninvents commented 8 years ago

This is odd, because the variable is quoted in the umount section:

ryan@washington [09:53:28 PM] [~] 
-> % flash -d /dev/sdc backup.img 
NAME             SIZE TYPE  MOUNTPOINT
sda            238.5G disk  
├─sda1           200M part  /boot/efi
├─sda2         152.6G part  
├─sda3         619.9M part  
├─sda4           3.7G part  
│ └─cryptswap1   3.7G crypt [SWAP]
└─sda5          81.4G part  /
sdc              7.5G disk  
├─sdc1           1.7G part  /media/ryan/Linux Mint 18 MATE 64-bit
└─sdc2           2.3M part  

Is /dev/sdc correct? yes
Unmounting /dev/sdc ...
umount: 64-bit: mountpoint not found

Issue found on 64-bit Linux.

ryaninvents commented 8 years ago

For now, I was able to continue by manually unmounting:

umount /dev/sdc1
umount /dev/sdc2
StefanScherer commented 8 years ago

@r24y Can you test it again by changing $NF to $1 line 209 https://github.com/hypriot/flash/blob/f36dbcc3c1914b1719cecd729f2fd89e5096ae0d/Linux/flash#L209 If this fixes your problem a PR would be very welcome, don't forget to edit the AUTHORS file :-)

ryaninvents commented 8 years ago

Definitely! I'll test it today or tomorrow; my Linux box unexpectedly needed rebuilding.

georgezero commented 8 years ago

I can confirm that changing $NFto $1 on line 209, fixes the issue when the space in the volume name issue.

Thanks for the awesome script.

StefanScherer commented 8 years ago

@georgezero Thanks for confirming. Fixed with https://github.com/hypriot/flash/commit/6828a335ef85aaee62e005affd168c933ab43536