![]() Thank you.Īs for eject: while it’s totally safe to remove the stick after dd command has finished and all data written to the device (using conv=fdatasync or separate sync) I’ve made it a habit to eject as well, since it removes the device nodes and re-mounting the device is possible only after unplugging and replugging the stick. I will edit the original post to reflect this. Using it eliminates the need for a separate sync command. You are right about conv=fdatasync, of course. I’ve been using dd option: conv=fdatasync instead of doing a separate sync command, and I always neglected to run eject, did you ever see instances where sync was not sufficient? Have you tried conv=fdatasync? Remove the disk safely: $ sudo eject -v /dev/sdc The “o\nn\np\n1\n\n\nw” stanza explained (\n after each individual option stands for line feed): echo o # Create a new empty DOS partition tableĮcho # Last sector (Accept default: varies)įormat stick as VFAT (32-bit fat) and give it label WINDISK: $ sudo mkfs.fat -F32 -v -I -n "WINSTICK " /dev/sdc1 All in one go, again in order to avoid navigating the fdisk menus: $ echo -e "o\nn\np\n1\n\n\nw" | sudo fdisk /dev/sdc ![]() Wipe off file system and/or partition table signatures from the device (to ensure fdisk in next step works without issues): $ sudo wipefs -all /dev/sdcĬreate a fresh, new partition table, one new partition (primary) and write the changes to disk. Make sure drive is not mounted: $ sudo umount /dev/sdc* Check drive assignment with dmesg (right after plugging the stick in) or with sudo fdisk -l. REPARTITION AND FORMAT USB STICK FOR DATA USE I like the command line, so here are instructions for working in the terminal. There are also apps made just for this purpose. If you prefer using GUI tools, you can do this in GParted or Disks. When you want to return the stick to regular data saving use, you need to reformat it. So if you are using a 4 GB stick for a 1.2 GB ISO, you won’t have 2.8 GB at the ready for storing your holiday snaps. It “dumps” the source disk to your target disk as is, bit-by-bit. You can now unplug the stick.ĭd stands for Disk Dump, which describes it perfectly. Sudo eject - unmounts the partitions (if mounted) and detaches the drive. Status=progress - shows a progress bar so you know something is happening (I’ve noticed it’s not always working)Ĭonv=fdatasync - flush buffers to disk, making sure everything is written to the USB disk (does same as a separate “sudo sync” command would do, as pointed out by in this post further down this thread) Of - output file target device (figured out in step 1).īs - bytes to read and write at a time (10M was suggested, I use 1M, default is 512, I believe) If - input file name of the ISO file with full path ![]() Issue the needed commands (dd and its friends)all in one go, individual commands separated by a semicolon: $ sudo dd if=/home/username/Downloads/example.iso of=/dev/sdc bs=1M status=progress conv=fdatasync sudo eject /dev/sdc Make sure the USB stick is unmounted (ignore the possible error messages for individual partitions): $ umount /dev/sdc* In this example output you can see which means it’s /dev/sdc. ![]() ![]() Look for line “Attached … removable disk” close to the end of the listing. Check dmesg output to find out the device assignment (or check with sudo fdisk -l). Do not trust “it’s always been /dev/sdc”.ĬREATING A BOOTABLE USB STICK FROM AN ISO FILE USING dd IN TERMINAL
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |