Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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=.
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.
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?
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.
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.
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
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,526
Rep:
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.
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??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.