*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
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.
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
From hard drive to new CF card:
Code:
dd if=cf_card of=/dev/sdc
I've tried this several times and I'm getting the same results. Shouldn't dd work for my purpose? The original CF card works just fine when booting from it. Is my dd command somehow wrong?
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.
Some cards don't have a partition, and you mount them using the disk device instead. I.E. /dev/sdc instead of /dev/sdc1.
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.
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?
Both of them are /dev/sdc
@jschiwal:
Mounted image using loop device and verified the filesystem is ok.
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.
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
/dev/sdc1: Unix Fast File system [v1] (little-endian), last mounted on /, last written at Thu Oct 30 12:06:58 2008, clean flag 1, 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
on the destination card:
Code:
linux-j368:/mnt # file -s /dev/sdc1
/dev/sdc1: 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
Notice the "clean flag" number, the source card is 1 and the destination card is 255. Does that make a difference?
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.