Hi Joe Schmoe,
Been wondering about this approach. Are you saying one can successfully duplicate a functioning OS and installed applications and any configuration changes by simply copying the appropriate files to a new SD card?
Yes. In Linux, this works. Yey for Linux!
That would be cool; in the Windows world this is impossible (I think) as there are hidden files and registries and histories and other unfathomables. In windows a disk image is the only thing (I think) that can be done.
Righto. Linux is very much "What you see is what you get", unlike Windows.
Could you give me more details, I'm not understanding
1.why /boot needs to be unmounted after the cp -av command
That's to avoid copying the contents of /boot into the new rootfs.
Note: This process is actually cleaner if you aren't copying from a live system. That is, if you can boot from a different system, and then copy files between partitions that aren't currently in use. But it *can* be done live and will almost always work (only in rare, pathological cases does it fail). Other posters on the forum will tell you that copying from live systems is a "no-no", but as I said, it usually works out OK. In this model (the one I am suggesting so far), you will be copying from the current root (/) to your SD card mounted on "sda".
What this all means is that the cleanest way to do it is to have another working boot system on the Pi, and then mount the source card (the one you're copying from) on, say "sda" and the other one (the target) on "sdb".
2. "mkfs" is a way to format the new SD card prior to writing to it??
Right. It is analogous to the DOS/Windows "FORMAT" command.
3. How do you sort out the physical storage devices, sda1 in your example? I'm guessing the original SD card is called sda0??
Basically, you just have to know. It is basic Linux stuff.
If you are copying from a live system, then your source SD card will be mounted as /. When you then put another SD card into an SD card reader and plug that into your Pi, it will (usually) come up as "/dev/sda" (you can check this by looking at the output of "dmesg" and also by looking at the (pseudo-) file "/proc/partitions").
Alternatively, if you've booted from another SD card, and put your original SD card into a reader and (yet another) one - the target - into another SD card reader, then the first one (the source) will (usually) be /dev/sda and the second one will (usually) be /dev/sdb. Within each "device", the partitions are numbered like "/dev/sda1", "/dev/sda2", etc. My personal convention is to create directories under /mnt, called "/mnt/sda1", "/mnt/sda2", etc - and mount the corresponding "/dev" files under the matching "/mnt" directories.
Finally, note that all of this is assuming you are using a command line, not a GUI. GUIs screw everything up by trying to be "helpful" and "auto-mounting" your SD cards and USB "sticks" for you, creating stupidly named directories that leave you chasing your tail. This obvious mis-feature can be turned off by editing some config file and it is highly recommended that you do so - but the exact details of how to do this are beyond the scope of this document. But in any case, this stuff is best done from a command line w/o any GUI running.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)