D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Safe DDing

 

On 27/01/2019 10:16, Tom via list wrote:
> I've just spent two days rebuilding my laptop after inadvertently dd ing 
> a microsd image onto the main drive - I think in bash I managed to 
> accidentally somehow unedit the command and launch it ( I hate touchpads!)
> 
> I was wondering if anyone has got an app that can realise this is a 
> stupid thing to do and stop you?

Pretty much any GUI frontend to DD *won't* let you do this - Etcher for 
example. It simply won't display /dev/sdX as a valid target unless you 
specifically enable "unsafe" mode to allow overwriting system drives.

Blacklisting command subsets (like "rm -rf /") doesn't really work but 
what you can do is alias dd or similarly dangerous commands to "sleep 
15; dd" to introduce a forced delay. I used to do this but I use dd a 
lot but if I'm honest, I'm not entirely sure that arbitrary delay ever 
did anything but slightly annoy me. Would it have been enough for tired 
eyes to make one last scan of a rogue dd command and ctrl+c it just 
before execution? Who knows?

But two days to rebuild your laptop? You need better backups, not 
blacklisted dd commands...

Cheers
-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq