Page 1 of 1

the dd command

Posted: Mon Mar 30, 2015 3:44 pm
by Newmint17
I would be very grateful for help with the syntax of the dd command.

I have downloaded Linux Mint 17.1 Xfce to a USB stick and I now want to make the USB bootable. It is the exact syntax that is defeating me.

When I insert the USB it is shown on my home screen as 'USB Stick'. Clicking on the icon brings up another screen showing location /media/gam/USB Stick and the contents as linuxmint-17.1-xfce-32bit.iso.

My USB drive is, I believe, at /dev/sdb.

I know I should start the process by unmounting the drive:- umount /dev/sdb
but what is the exact syntax for the first part of the dd command?

dd if=/?? of=/dev/sdb

As things stand, I seem to be defeated by the space in 'USB Stick' - or is this a red herring?

Re: the dd command

Posted: Mon Mar 30, 2015 11:20 pm
by gold_finger
Just quick addition to above instructions.

Note that the "dd" command will not show any progress bar or anything while it is working. You'll just see a flashing cursor. When it's done, the regular terminal prompt will appear. (It may or may not give a message that it's completed -- I can't remember.) Don't interrupt the process once it starts. Just let it go until complete -- may take a few minutes, or up to 10-15 minutes.

Re: the dd command

Posted: Mon Mar 30, 2015 11:31 pm
by wayne128
To avoid pulling out USB flash too early due to no feedback on dd command, what I usually do is add a sync command , like this real stuff I did:
[wayne@trios][~]$ su
Password:
root@trios:/home/wayne# dd if=debian-jessie-DI-rc2-i386-DVD-1.iso of=/dev/sdb bs=4M; sync

Re: the dd command

Posted: Tue Mar 31, 2015 3:56 am
by I Know Nothing
Newmint17 wrote:As things stand, I seem to be defeated by the space in 'USB Stick' - or is this a red herring?
I believe using DD you need to put USB\ Stick so if I've understood what you're trying to do correctly (and I've typed it correctly) the whole command should be
dd if=/media/gam/USB\ Stick/linuxmint-17.1-xfce-32bit.iso of=/dev/sdb

Confusingly for newcomers to linux different places seem to require treating spaces in different ways. If you're editing your fstab config file for example you need to use \040 to indicate a space. Far easier not to use spaces in naming files and drive partitions in the first place.

Re: the dd command

Posted: Tue Mar 31, 2015 7:02 am
by gold_finger
I Know Nothing wrote:I believe using DD you need to put USB\ Stick so if I've understood what you're trying to do correctly (and I've typed it correctly) the whole command should be
dd if=/media/gam/USB\ Stick/linuxmint-17.1-xfce-32bit.iso of=/dev/sdb
Your point about spaces in file names causing problems in terminal commands if not commented out is valid, however it doesn't apply in this situation.

The key here is this (from gmilo2):
gmilo2 wrote:Put the .iso file itself onto your Desktop, not the USB drive.
The ISO file itself can not reside on the USB stick that the dd command is writing to, which is why gmilo2 told OP to move the file to the desktop. Then, as OP already knows, the USB has to be unmount before running the dd command. Once unmounted, the USB is no longer mounted under /media or /media/username and the dd command uses its device name (/dev/sdb in this example). So, gmilo2's code is correct as written, or OP could also add the sync to the end of it as pointed out by wayne128 to ensure it's writing is complete before removing the stick.

Re: the dd command

Posted: Tue Mar 31, 2015 7:20 am
by I Know Nothing
gold_finger wrote:Your point about spaces in file names causing problems in terminal commands if not commented out is valid, however it doesn't apply in this situation.
I was thinking there were 2 USB sticks involved and he was copying from one to the other but maybe not.

Re: the dd command

Posted: Tue Mar 31, 2015 2:21 pm
by Newmint17
Thank you for your excellent help and advice, as a result of which I have successfully used the dd command and had a first look at Mint 17.1 Xfce.

The Forum comes up trumps, again!