Writing to an USB stick on Fedora 19

Bruno Wolff III bruno at wolff.to
Mon Dec 2 14:41:17 UTC 2013


On Mon, Dec 02, 2013 at 14:11:13 +0100,
   Florian Weimer <fweimer at redhat.com> wrote:
>What's the correct way to write an image to a USB stick?  I don't 
>write to it while any file systems are mounted.  Mounting happens 
>automatically when I plug in the stick, and if I click "Eject" in the 
>GNOME notification, the /dev/sdb block device assigned to the stick 
>is still present, but dead—the open system call fails with ENOMEDIUM.

I usually do things at the shell. You should be able to use umount to 
unmount the device and then you can safely overwrite the device using 
/dev/sdb.

You can use dd to copy over images. (If you do this you probably won't 
be able to write other stuff to the file system, depending on the image. 
If you want to do that there are tools for doing that.) You probably 
want to use a block size larger than the default. (I am not sure if the 
writes end up being combined at a lower level, but if not, writing USB 
devices 512 bytes at a time is very inefficient because of the erase 
block size in these devices is typically in the 128KiB range.)


More information about the users mailing list