How do you duplicate a 512 Meg Compact flash to a 1 GB compact flash using dd???
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.
How do you duplicate a 512 Meg Compact flash to a 1 GB compact flash using dd???
Hi All,
I have a 512 Meg compact flash (from a Cisco Router running Cisco Unity Express module) that I need to duplicate it’s content onto a 1GB compact flash.
I am running fedora 10 and I was able to read the 512 compact flash and I can see the files and the systems reports everything correctly – file system is reiserfs.
I used dd to create an image file -
linuxhost#dd if=/dev/sdb1 of=/flash.img
The image size looks correct, size wise etc.
I then remove the 512 Meg compact flash and insert the 1 GB compact flash, the system recognizes the CF and mounts it, I unmount it to begin the restore of the image.
I then use dd to restore the image back to the 1 GB compact flash.
linuxhost#dd if=/flash.img of=/dev/sdb1
The transfer completed and it seemed that all the files have been transferred and the image was restored.
The only problem is that once the image is transferred to the 1 GB compact flash, it has a total space of 512 Meg (less the space used by the files) and I have not been able to restore the image to the 1 GB compact flash where the available space is 1 GB storage capacity on the compact flash. It reports the media as 1 GB but the total storage capacity is seen as 512 Meg.
I played around with the bs=, ibs=, obs=, and count= options but I have not been able to get it to work.
Does anyone know how this can be done and what the correct syntax is for accomplishing using dd?
What does fdisk tell you about the stick? Any unpartitioned space left?
Or did you also copy the partition table of the smaller one across?
If the answer to my 2nd question is "no", just add a partition; failing
that (or it being undesirable, use something like (q)parted to modify
the media.
I don't like dd used for this - as I say everytime this comes up.
dd did what you asked it to - it copied the (entire) filesystem. I don't use reiser, but I presume it comes with a resizing utility. You should be able to run that and have it fill the partition.
Wow thanks for the quick response everyone (and the welcome)...
Hey Tinkster – the answer is I am not sure; when I run the fdisk this is what I see (see below) (I am new to this so bear with me – I am learning ….) I see files but when I print the partition table I do not see a start or end is this normal? When I do a verify of the partition table I see unallocated sectors but I am not sure if that is relevant.
I will try to run the (q)parted or resize_reiser as syg00 suggested. I will need to read up on these utilities and if you don’t mind I will ask again if I have problems….
In the mean time based on the outputs if there are any suggestions I am all ears.
[root@localhost /]# fdisk /dev/sdb1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xcf0a831e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/sdb1: 1024 MB, 1024934400 bytes
32 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 2016 * 512 = 1032192 bytes
Disk identifier: 0xcf0a831e
Device Boot Start End Blocks Id System
Command (m for help): v
2001824 unallocated sectors
That last one is no good - lets see "fdisk -l" (no quotes).
But it would appear you have a one gig partition, and the resize should simply expand to fill 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.