[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Safer ways to write an ISO onto USB stick [was Re: Repair partition after dd]



On 7/14/21 3:47 AM, Thomas Schmitt wrote:
Hi,

Brian wrote:
It would be nice to avoid having to have root privileges in order
to do 'cp <ISO> /dev/sdX' with a USB stick. A udev rule under
/etc/udev/rules.d/ could be a solution:

   SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="floppy"

This could have prevented the mishap, indeed, provided that /dev/sda is
an internal SATA disk.

But i think that the criterion of being "removable" does not sufficiently
characterize a valid target for dd-ing an installation ISO, although
being an internal disk is a strong indication for being not the right one.

It is rather about the current content of the USB stick or memory card
which should be considered.
Best is to make an unambiguous relation between the physical stick in the
user's hand and the target device file.

My proposal for a mitigation of the currently dangerous situation is to
see on
   https://wiki.debian.org/XorrisoDdTarget


Have a nice day :)

Thomas


I think we've all made painful mistakes with /dev/sd* device nodes. Beyond identifying disks, partitions, filesystems, etc., with dmesg(1), lsusb(1), parted(8), e2label(8), I have developed the habit of using /dev/disk/by-id/* device nodes whenever possible.


David


Reply to: