the dd command

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Newmint17
Level 1
Level 1
Posts: 45
Joined: Tue Aug 12, 2014 8:29 am

the dd command

Post 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?
User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: the dd command

Post 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.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: the dd command

Post 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
I Know Nothing
Level 1
Level 1
Posts: 41
Joined: Sun Oct 06, 2013 8:44 am

Re: the dd command

Post 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.
User avatar
gold_finger
Level 9
Level 9
Posts: 2885
Joined: Mon Mar 11, 2013 11:39 pm

Re: the dd command

Post 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.
Please add [SOLVED] to your thread if a solution is found. Go to your first post in the thread, hit "Edit" button and add [SOLVED] to the title of the post.

How To Format Your Forum Posts.

Try Linux Beginner Search Engine for Linux questions.
I Know Nothing
Level 1
Level 1
Posts: 41
Joined: Sun Oct 06, 2013 8:44 am

Re: the dd command

Post 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.
Newmint17
Level 1
Level 1
Posts: 45
Joined: Tue Aug 12, 2014 8:29 am

Re: the dd command

Post 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!
Post Reply

Return to “Software & Applications”