Timeline for Unable to mount cloned compact flash after using dd to clone bootable compact flash
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 1, 2021 at 1:18 | vote | accept | Frank | ||
| Aug 31, 2021 at 19:20 | comment | added | sudodus | Yes, you cannot copy what does not exist (beyond the end of the source drive). There might be old junk behind that in the USB drive, but since the target drive is smaller than the source, the final cloning will never reach to the old junk. | |
| Aug 31, 2021 at 19:16 | comment | added | Frank | OK. So for example, if I "dd if=/dev/sdf of=image.dd", only the partitioned portion of the USB drive will be copied to image.dd, regardless of the size of the physical USB drive? | |
| Aug 31, 2021 at 19:08 | comment | added | sudodus | Cloning will stop at the end of the smaller drive. And if all the partitions are within the size of the target, and it is an MSDOS partition table, it should work for you. It has worked for me. In this case you should not use partitions as source or target for the cloning. | |
| Aug 31, 2021 at 19:03 | comment | added | Frank | OK, but since the intermediate drive is larger, when I dd wont I run into the same issue, or do I only clone the partition. Like if the intermediate USB is /dev/sdf and I do "dd if=/dev/sdf" won't it copy everything including all the unused space? Should I do "dd if=/dev/sdf1 of=image.dd" then "dd if=image.dd of=/dev/sdb". | |
| Aug 31, 2021 at 18:07 | comment | added | sudodus | No, but you can clone to a new drive, that is big enough, and if you do some advanced editing cloning will maybe work. Try this procedure: Clone to an intermediate drive, for example a USB pendrive or and old hard disk drive that you can overwrite (the previous content of the intermediate drive will disappear). The you can shrink some partition and make sure that all the partitions are within the size of the target card. Finally clone from the intermediate drive to the target card. | |
| Aug 31, 2021 at 17:18 | comment | added | Frank | OK. I've confirmed that the source is 1,024,966,656 bytes and the target is only 964,583,424 bytes. According to the utility "parted --list" the partition table is MSDOS. Is there a way I can clone with DD still? According to the command "ls -alk" on the target drive, only 116K is used for files and directories. | |
| Aug 31, 2021 at 17:10 | comment | added | Frank | Thanks for the help! Now It appears to me that the problem is that the source drive is larger than the target, even though they are both 1GB. DD report "No space left on disk" I didn't realize that that is an error. | |
| Aug 31, 2021 at 6:15 | history | edited | sudodus | CC BY-SA 4.0 | If there is a GUID partition table, GPT, ... |
| Aug 31, 2021 at 6:14 | comment | added | sudodus | @Frank, The method you describe (in the comment above this one) should work when using an MSDOS partition table and when the target drive is 'not one single byte smaller' than the source. If a GUID partition table, GPT, and there are different sizes, you must fix the backup partition table at the end of the drive. This is done automatically, when you use mkusb to clone or extract from the image. Otherwise you can use gdisk to fix it after the cloning. | |
| Aug 31, 2021 at 1:29 | comment | added | Frank | I tried dd if=/dev/sdb of=image then dd if=image of=/dev/sdb but when trying to mount /dev/sdb or /dev/sdb1 I got the same error I mentioned before. | |
| Aug 30, 2021 at 15:42 | history | answered | sudodus | CC BY-SA 4.0 |