Protecting Devices from dd and fdisk Commands
I'm wondering if there is some way to prevent certain certain devices from becoming the output file of the dd command and the target of the fdisk command. I'm currently using the two operations to set up a write a bootloader, kernel, and root filesystem on an SD card, which appears as /dev/sdd. I'm always a little anxious that I'll mix up sdd with sdb, or sda since the letter a and d are close on the keyboard, and I would like to find a way to prevent commands with this format:
dd if=/dev/sd[a-zA-Z0-9]* of=/dev/sd[ab]
or
fdisk /dev/sd[ab]
I'm wondering if there is some way to prevent certain certain devices from becoming the output file of the dd command and the target of the fdisk command. I'm currently using the two operations to set up a write a bootloader, kernel, and root filesystem on an SD card, which appears as /dev/sdd. I'm always a little anxious that I'll mix up sdd with sdb, or sda since the letter a and d are close on the keyboard, and I would like to find a way to prevent commands with this format:
dd if=/dev/sd[a-zA-Z0-9]* of=/dev/sd[ab]
or
fdisk /dev/sd[ab]
No comments:
Post a Comment