Copy encrypted compact flash issues with dd in ubuntu
Linux - NewbieThis 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
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.
I tried the sync, and did everything else like i said, but for some reason it still comees back as binary files differ. At this point I'm a bit confused, especially since i know my dd command is correct since i was able to use dd to get the file on to my hard drive. I'm using the exact same process in reverse but for some reason it's not correctly copying to my blank cf card.
Well, unless the blank CF card is exactly the same size... it won't match, as there are more junk blocks of data in the "blank" card (even if the blocks are zeros, just their presence is a difference).
Using dd you can specify bs=<block size> and count=<count> to specify how much data do you want to read/write. So you can copy a given size onto the hard disk and compare it to the old file.
i am still catcing up but heres a few notes so far:
Quote:
Originally Posted by solojayda3rd
Yeah sorry I did type umount in the actual terminal. I just typed unmount on here by mistake.
to troubleshoot issues, instead of typing just use copy-paste (in [code] tags) to ensure you are typing in commands correctly and also to ensure we are not being hindered by spelling mistakes.
i think it would be ideal to run dd while the disk that is being imaged is unmounted to ensure that nothing is being written to it while the imaging procedure is taking place (like trying to shoot a moving target).
its possible (probable) that the encryption algorithm is using the drives uuid to make sure it is only being allowed on that one drive. i think i remember that ms-windows reads serial information about your cpu/motherboard/ram/hd/videocard/soundcard/... and if you try to image a harddrive to another, it will contact microsofts server to check your configuration and refuse to boot after 30 days. thats why some customers had to call microsoft after their motherboard died to plead for a new license key.
To explain. I suggested to boot to live iso and use that to peek into the file you created. See if you did dd the drive correctly. Look into files. Look into any odd partitions. See if any file describes the geometry or unique feature of the cf.
to troubleshoot issues, instead of typing just use copy-paste (in [code] tags) to ensure you are typing in commands correctly and also to ensure we are not being hindered by spelling mistakes.
I'll work on that. I'm using oracle virtual machine to run my ubuntu, and haven't figured out how to copy from it to my windows. It was on my list of things to figure out..I'll try to from here on to just copy and paste.
Jefro, I still haven't figure out exactly how to do what you're saying, not sure if you think i need to since i learned through the diff command that previously i was not copying identical files. But if so, can you describe: Do i need to create a cfcard.iso and then in ubuntu look through it. Or try to mount it like an os in my virtual machine? and also how do i use ubuntu to look through it, in the command prompt? or is all of this supposed to take place in the command prompt? I know it's probably a lot to explain, but i tried to look it up and i can't find anything close to even head in the right direction in accomplishing that.
vincix, yea that was the step i was missing for a while. The last 2 times i've done the dd i did umount the usb. Or at least I did umount dev/sde1 which i think is only a partition but that's what kept mounting automatically. I did try to umount the whole /dev/sde but i got the message that it wasn't mounted in the first place.
pan64, I was reading about the bs and count options, in my case should bs be 512 and count be 256MB? The way i was understanding it is that bs is how many bytes are being read and written at a time, and the count was the size of the copy, or is that wrong? my original card is 256Mb if that helps.
Ok update, I tried the last copy i made, the one that still said "differ" but was made after unmounting the sde1 as mentioned. So i assumed this had a good chance to actually work, but it came up the same when i put the card in the machine i'm trying to run.
So in the meantime I've figured out how to copy and paste my codes so i don't have anymore typos.
I also figured out how to mount the iso file to my ubuntu. I had to save it to my windows, then mount it like a cd in my virtual machine settings. That being said, I can see it, but i don't see any info inside when i click on it. So my next question for jefro, (if I did what you were talking about hopefully correctly) how can i peek inside to see the files? Is that a terminal command thing, or should i be able to do it from ubuntu. I should mentioned the iso is one i made by using dd and using
Code:
if=/home/folder/cfcard of=/home/folder/cfcard.iso
Sorry but that's not copied and pasted since I did that a few days ago, but i'm pretty sure that's what i used. I'm still holding out hope that once my 256mb card arrives i might have better success. Thanks guys so far for all the ideas and suggestions.
you can mount any file (use as image), for example /home/folder/cfcard.iso, but /home/folder/cfcard is ok too (by the way dd if=/home/folder/cfcard of=/home/folder/cfcard.iso is equal to cp /home/folder/cfcard /home/folder/cfcard.iso, a simple copy).
The mount command would be mount <filename> <mount-point>, so for example mount /home/folder/cfcard.iso /tmp/cfcard - you need to mkdir that mount point beforehand. Next, you can cd /tmp/cfcard and you will see the content of the mounted image.
About block size, see: http://www.computerhope.com/unix/dd.htm
I think you need to say something like: dd bs=1024 count=256K, but you can check the size of the result (so run a dd without bs and count to copy from the original onto the disk and with bs and count and you will need to get the same result). That bs and count can be used to afterward to check the content of the second card.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.