LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-07-2012, 10:53 PM   #1
4n6
LQ Newbie
 
Registered: Dec 2012
Posts: 10

Rep: Reputation: Disabled
syntax is everything... dd wrote to the main drive not the usb...


Hello,
I am a little out of touch since it has been over 10 years since I played with UNIX, so I am very rusty on the commands… What I am trying to do is to install a copy of DEFT onto an usb drive. I thought I had the syntax correct but, while I was in the Ubuntu 11 side of my win7/Linux machine, I discovered how lucky I was to have a backup image of my hard drive since I ended up wiping the drive and installing DEFT onto the main drive and missing the USB stick… here is what I THOUGHT was the correct command:
dd if=DeftPen_v710-usb_4gb.dd of=/dev/sdb ; sync
this gave the permission error… so I tried:
sudo dd if=DeftPen_v710-usb_4gb.dd of=/dev/sdb ; sync
and it appeared to work… until I rebooted and discovered that I missed my pen dirve…
so, my questions are these:
1. What command will tell me my drive names?
2. How do I use the dd command to write to an unmounted drive? And what did I type wrong?
3. Ubuntu normally auto mounts new drives, how do I un mount it once it is plugged in? (I normally use the storage manager)
Thanks,
b
 
Old 12-08-2012, 01:01 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,096

Rep: Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979Reputation: 979
Congratulations on the backup - not many have such before they come asking for help.
Absolutely essential when screwing around with the system. Looks like you'll get plenty of pertinent practice at least ....

You had the correct syntax - you just picked the incorrect target (drive).
You may not be asking what you think you are asking, and even if you are you may not be asking the correct question(s). I'll try to be as flexible as possible with the answers.
1). This is not trivial from CLI. Operating systems present (and mount) partitions not devices (generally) - this applies to both Windoze and Linux. When you plug in the drive you should get notified, if not try "dmesg | tail -n 20" (no quotes - on any of my example commands). That should allow you to guess the drive - these days it'll be something like /dev/sd? (one character a/b/c ... ignore digits at end). "ls /dev/disk/" will tell you your drives, but will give no indication of whether they are in use.
2). The command was basically correct - as you indicated you hit the wrong device. The device may be named differently in different distros (Fedora may call it /dev/sda for example). So it's tough to give absolute answers. "dd" is both powerful and stupid - it'll do as you tell it to. No questions asked - online or offline, makes no difference.
3). Ubuntu mounts partitions. Use "df -hT" to see mounted partitions (correlate with the dmesg output), then use "umount /media/<whatever>" on all the entries that correspond to the device of interest. This time there will be a character (as above) plus a number for the partition(s) - I'm guessing on /media/... as I don't have a Ubuntu handy.
Given what you are doing, it is possible there won't be a partition on the USB at all, but that's a whole different can of worms.
From a GUI you should be able to right-click each partition to unmount it. I rarely use one for such.

Last edited by syg00; 12-08-2012 at 01:16 AM. Reason: s /head/tail/
 
2 members found this post helpful.
Old 12-09-2012, 11:04 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,206

Rep: Reputation: 229Reputation: 229Reputation: 229
For an additional thought to the questions:

Quote:
1. What command will tell me my drive names?
Do in terminal <without quotes> -- " fdisk -l " or " parted -l " (all small letter ' L ' not number 1 ) or "cat /proc/mounts"

Quote:
2. How do I use the dd command to write to an unmounted drive? And what did I type wrong?
Simply dd if=/source/of_something of=/taget/drive

"if" means --Input File
"of" means --Output File

and read "man dd" for its manual in the terminal.

Quote:
3. Ubuntu normally auto mounts new drives, how do I un mount it once it is plugged in? (I normally use the storage manager)
1. From the GUI (desktop utility application) right click the Desk Mounter button; or from the Desktop right-click the mounted icon, click Unmount.

2. From the terminal: "sudo umount /dev/sd..." or use the mount point for the syntax "sudo umount /media/sd..."

There is no need to use DEFT. Just a terminal and the "dd" command.

Hope that helps.

Good luck.

Last edited by malekmustaq; 12-09-2012 at 11:07 AM.
 
1 members found this post helpful.
Old 12-10-2012, 07:15 PM   #4
4n6
LQ Newbie
 
Registered: Dec 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Okay i finally got it, with a little help, but i got it working... and hopefully i wont have to re-install the images.

Thanks!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I formatted my main drive? How can I recover it? gbmonster Linux - Software 13 10-31-2009 11:37 AM
formatting of main drive blackadder86 Linux - Newbie 3 12-20-2007 08:35 PM
Ubuntu on USB drive, XP on main drive. Grub 21 error steste Linux - Newbie 1 12-09-2007 03:10 PM
:< Why doesn't it know of my main cd-rom drive?! Svip Slackware 12 06-04-2006 05:42 PM
Syntax USB-400 Wireles USB (SuSE 9.0 / Mandrake 10) shassouneh Linux - Wireless Networking 17 04-23-2004 02:25 AM


All times are GMT -5. The time now is 05:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration