LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-13-2018, 04:37 PM   #31
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled

if - infile
of - outfile

Everything is file in UNIX/Linux, dd works with raw devices, no mounting required. Please check out 'man dd'.
 
Old 01-13-2018, 04:44 PM   #32
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
Sorry, I don't understand your answer. My question was.. Let's say my external drive is called "backup" and is mounted on my desktop, would the code be..

dd if=/dev/disk2 of=backup bs=1M conv=noerror

ie.. how does it know which drive to copy the image to?

Please assume I'm an idiot and need things explaining as cleary as possible.

Thanks. I really appreciate it
 
Old 01-14-2018, 03:17 AM   #33
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
no, you are not an idiot. You just need to learn how it works.
Quote:
ie.. how does it know which drive to copy the image to?
No, dd has no any idea which drive to use, it is the human being who can specify it.
devices can be found under /dev, disks (or lookalikes) can be found under /dev/disks. You need to identify your external disk.
sudo fdisk -l can be used to list all the available disks and partitions. Also you need to know if you want to use a device or only a partition on it, or just a file. dd does not really care about that and will destroy anything on the device you specified as of=.

Last edited by pan64; 01-14-2018 at 03:19 AM.
 
Old 01-14-2018, 04:28 AM   #34
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
.del.
 
Old 01-14-2018, 05:34 AM   #35
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
Ok so I've identified the disks but I'm getting an 'illegal numeric value' error when trying to run the code. See attached screen shot. I want to clone the entire contents of disk3 onto disk2.

Where am I going wrong?
Attached Thumbnails
Click image for larger version

Name:	pic3.jpg
Views:	15
Size:	135.8 KB
ID:	26746  
 
Old 01-14-2018, 05:38 AM   #36
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
of=/dev/something, do not forget /dev.
bs=1M looks incorrect. Which version of dd is it? Which OS is it?
 
Old 01-14-2018, 05:46 AM   #37
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
I've tried this line but still get the illegal numeric value error..

dd if=/dev/disk3 of=/dev/disk2 bs=1M conv=noerror

I'm using Terminal on Mac OS High Sierra. I have no idea which version of dd it is.

I'm afraid I'm clueless on the whole process. I'm literally just following instructions given to me earlier in the thread. If there's another way of achieving this I'm happy to listen.

Is dd something that actually needs to be installed on my machine?
 
Old 01-14-2018, 06:07 AM   #38
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
dd is installed and working (but in general yes, it should be installed).
You can check the version (in general) like: dd --version. You can use bs=1000k or check man page (man dd) what is excepted as block size.
 
Old 01-14-2018, 06:11 AM   #39
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
Sorry, I really appreciate your help but I don't understand what you mean.

Is anyone able to supply a line of code that I can just copy and paste?
 
Old 01-14-2018, 07:34 AM   #40
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
Ok I've worked out what you mean by check man page. The section on bs as follows..

bs=n Set both input and output block size to n bytes, superseding the
ibs and obs operands. If no conversion values other than
noerror, notrunc or sync are specified, then each input block is
copied to the output as a single block without any aggregation
of short blocks.
 
Old 01-14-2018, 07:53 AM   #41
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
Appeared to finally be getting somewhere with this..

sudo dd if=/dev/disk3 of=/dev/disk2 bs=1024 count=1024

But then I got a pop up saying The Disk You Inserted Was Not Readable By The Computer.

I'm assuming this just isn't gonna work?
 
Old 01-14-2018, 09:08 AM   #42
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
probably /dev/disk3 is not valid. or /dev/disk2. I mean this is not the device you wanted to use, but something else, probably nothing. You can check by:
ls -l /dev/disk2 /dev/disk3 probably
 
Old 01-14-2018, 01:04 PM   #43
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
To create an image file of disk3 onto disk2, (you may need to be the root user).
Code:
dd if=/dev/disk3 of=/dev/disk2/disk3.img bs=1M
That should put a roughly 40GB image file onto disk2, however, it won't, because of the file system on that disk, largest file size allowed, I think, is 4GB.

If you use dd to clone disk3 onto disk2, you will end up with a 40GB disk imaged to it.
Code:
dd if=/dev/disk3 of=/dev/disk2 bs=1M
As you are on a Mac, or at least it looks like you are, you may have to use /dev/disk3s1 &/or /dev/disk2s1 - /dev/disk3 is 'ntfs' whilst /dev/disk2 is 'fat'.

Edit: It may be easier to write the disk image file to your hard drive, & then, if you want to put it somewhere else, you will need a file system that supports large (40GB) files.

P.S. I notice in your original post you were looking to create an image of a Linux drive, neither of these two drives has a Linux file system.

Last edited by fatmac; 01-14-2018 at 01:16 PM.
 
Old 01-16-2018, 02:56 PM   #44
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Don't use a block size and use sync at end.

Be sure to read your dd manual for it's use. Your image stated that BS= was a bad command.
 
Old 01-20-2018, 05:00 PM   #45
fizzyfizz
LQ Newbie
 
Registered: Jan 2018
Posts: 28

Original Poster
Rep: Reputation: Disabled
Right.. I've finally managed to clone the drive! (I ended up using a virtualisation of Linux on the Mac) BUT... when I plug the new cloned drive into a new unit, nothing is showing up on my network. The only thing that's different is my original drive was an IDE. My new drive is a SATA. But surely that'd have nothing to do with it??
 
  


Reply



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
[SOLVED] Cloning a dual boot (MacOSX, Linux) drive trentfox Linux - Software 5 06-20-2015 02:32 PM
Linux Boot disk won't start - after cloning the drive in Windows 8 clueless1 Linux - Newbie 1 03-19-2014 09:47 AM
Problem Cloning Linux Drive throck Linux - Newbie 8 01-05-2012 10:18 AM
Cloning dual-boot drive onto a smaller drive. Harju Linux - Newbie 4 05-29-2010 11:40 AM
Need help in cloning drive raddad51x Fedora 1 05-16-2006 01:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration