duplicate CF card using dd
Hello everybody,
I have a CF card with NetBSD installed on it that I need to duplicate. I have a linux box with one external USB CF card reader that I'm using to put the image on the hard drive using dd. Then I put that image on the new CF card. The problem is when I boot from the new CF card the NetBSD bootloader starts, but then the computer reboots. It cycles like this 4-5 times then the computer tells me there's no bootable disk available. Here's my dd commands: From CF card to hard drive: Code:
dd if=/dev/sdc of=cf_card Code:
dd if=cf_card of=/dev/sdc Thanks! |
Are you sure that the name of the device is /dev/sdc both the first time you insert a card and the second time? I mean, I suspect that when you copy from the first card to the hard disk, the card device name is /dev/sdc. Maybe when you insert the second card, its name becomes /dev/sdd
Can you verify this? |
See if you can mount the cf_card file using a loop device. If it has a partition on it, you could try adding an offset of 63*512 bytes for the first partition. This is just to verify that the filesystem on the file is OK.
Code:
sudo /sbin/losetup -fs cf_card -o $((63*512)) Perhaps the data wasn't entirely flushed to the card before you ejected it. After creating the copy, try mounting it and then running "sync". Then run "eject". Don't remove or reboot until you know that the filesystem is OK. Also look at the device used for the card using "sudo file -s /dev/sdc" Use "sudo /sbin/fdisk -l" and "udevinfo -q env -n /dev/sdc" to double check that the device nodes haven't changed. Since it is a clone, the filesystem on the new cf card will have the same UUID number. I'm not familiar enough with BSD to know what kind of filesystem is on the card, but I'm sure it is something that Linux understands. Eject and reinsert the card and double check that it is bootable, "sudo file -s /dev/sdc" and that the partition is mountable. |
Thank you for your replies!
Quote:
@jschiwal: Mounted image using loop device and verified the filesystem is ok. file cf_card resulted in: cf_card: x86 boot sector; partition 1: ID=0xa9, active, starthead 1, startsector 63, 8027649 sectors sudo file -s /dev/loop0: /dev/loop0: Unix Fast File system [v1] (little-endian), last mounted on /, last written at Thu Oct 30 12:06:58 2008, clean flag 255, number of blocks 1940904, number of data blocks 1910655, number of cylinder groups 21, block size 16384, fragment size 2048, minimum percentage of free blocks 5, rotational delay 0ms, disk rotational speed 60rps, TIME optimization I don't have time right now to do the other things you suggested, but I'll try them and let you know in the next few days. Thank you guys again for your replies. |
I used /dev/sdc1 for the device. /dev/sdc won't even mount. The devices listed are /dev/sdc, /dev/sdc1, /dev/sdc5 and /dev/sdc6. The fdisk and udevinfo commands on both cards have identical output. But,
on the source card: Code:
linux-j368:/mnt # file -s /dev/sdc1 Code:
linux-j368:/mnt # file -s /dev/sdc1 |
problem to clone cf
I have the exact problem. Did you solve it?
regards alex |
Yes! I finally did! About 5 min ago.
I ended up using two IDE to CompactFlash adapters to do the transfer directly. I just used dd to copy the image from the source card to the destination card (both unmounted of course). |
I did the same thing, but no success!? I want to copy from cf 128Mb to cf 4Gb. Data on 4Gb is ok, but the OS won't boot.
regards Alex |
I used two identical cf cards, same size and all. You could try creating a partition on the 4 gb cf card and just copy the image to that partition.
this post might be helpful: http://www.linuxquestions.org/questi...ommand-362506/ |
All times are GMT -5. The time now is 11:34 PM. |