I have a file system for a device I am programming that I would like to make an exact copy of. Ideally I would like this copy to be identical to the folder that it was copied from. I have tried using cp -r
cp -a
and rsync -azvP
to try to achieve this. Each one though results in a folder with different size (using du -s
) and ultimately,even though my device runs off of the original folder, it won't run off of the one that I copied.
- What is getting left out that the commands I have used aren't accounting for?
- Is it possible to keep everything identical when copying a file system/folder? If so how would I go about doing that?
P.S. I posted a similar questions on StackOverflow but quickly realized I had asked it on the wrong exchange
Edit: This may not be helpful but no matter which method I use the copied directory always causes the machine in question to Kernel Panic with the following output.
VFS: Unable to mount root fs via NFS, trying floppy. VFS: Cannot open root device "nfs" or unknown-block(2,0) Please append a correct "root=" boot option; here are the available partitions: 1f00
64 mtdblock0 (driver?) 1f02 64 mtdblock2 (driver?) 1f04 2432 mtdblock4 (driver?) 1f05 128 mtdblock5 (driver?) 1f06 4352 mtdblock6 (driver?) 1f07 204928 mtdblock7 (driver?) 1f08 50304 mtdblock8 (driver?) 0800
8388608 sda driver: sd Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
du
output is not an indicator that the contents aren't the same.rsync -a
orcp -a
do exact copies of directories, but you're trying to copy a bootable disk, there are a couple of things more you need to do to complete that.dd if=/some/location of=/some/other/location bs=4M
to read and write data as is.