how to copy the contents of sd card to another - sd-card

I have sd card, I installed ubuntu on it in order to use it in beagleboard.
Is there a program to copy the entire contents of the sd card to another one??!!
I basically want to copy the operating system to the other sd card.

As far as I am concerned, you need to "install" it again on another SD card. You can copy certain files but the Os just cannot be "copied" like that. The solution is to take the -iso image of the OS and reinstall it to another SD.
EDITED:
I've been looking deeper and maybe the Win32DiskImager program that is normally used to install image files to SD cards, could also "clone" your SD card. Try to download it, and as soon as you open it you have a "read" option, that would provide you a solution.Cloning the SD card is simple. Just follow these steps:P
Extracted from: http://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524
Follow these steps to clone the SD card:
Get everything set up just the way you want it on your Raspberry Pi, whatever you're using it for. Then shut down the Pi and remove the
SD card. Insert the SD card into your computer.
Start up Win32DiskImager, a program that you probably have from when you first set up your Pi. (If you're on OS X or Linux, you'll
have to use the dd command as described here instead of these steps).
In the "Image File" box, enter the path of your soon-to-be image file. For example, I put mine in C:\Users\Whitson\images\myraspbmc.img
Under the "Device" box, select your SD card.
Click the "Read" button to create the image file from your card.
When it's done creating the image file, you can eject your SD card and put it back in your Raspberry Pi. Keep that IMG file in a safe
place.

Related

Write and read files from SD card flutter

Is there any way to Read and write files from external SD Card with flutter ,like using
getExternalStorageDirectory()
from path_provider package to access local storage(read,write,modify,create..)?
You can use external_path package in pub.dev.
There is another way, which is directly listing all folders before folder named 0. There are mostly three folders in the very root: emulated, (the second and third one I don't remember now).If SD card is also inserted, there is a change in the first index with some id of SD card. But, trying to directly list them throws permission error, so you should use the package provided above.
About, writing (editing, deleting), it's really hard using flutter. By default, the contents are loaded in read-only mode.

How to set up a Raspberry Pi to act as a printer and save printed files?

I need to set up a Raspberry Pi as a printer. When something is printed to the Raspberry it should save the file, so that I can work with it.
The plan is, to use it instead of the printer to save paper.
EDIT:
It will be printed from a cash register - it should replace the printer. And I want to read the file with an application to save the informations into my database.

How do I use a dd-created image, that's bigger than the original disk?

I created a backup of flash card, using: dd bs=4M if=/dev/mmcblk0 of=backup.img
Now, trying to restore that back to the same card with Etcher, I'm told the image is bigger than the card, and I need 300+Mb of more space.
Should I be creating the image a different way? Is there a work-around to restoring the image? If it matters, I'm trying to maintain all of the needed partitions for a RaspberryPi. I'm new at this, so any guidance would be great (including if there's a more appropriate Exchange to ask).
Since my question was focused in particular on a RPi .img file, there is a utility, PiShrink https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
for this very task.

How can I strip down core-image-sato and remove selected apps/packages?

I want to build a stripped version of core-image-sato for Odroid-C2.
Currently, everything related to Openhanded Sato mobile environment gets into the image when I compile/build image using yocto.
I want to remove Leafpad, Shutdown, Media Player, Games/Puzzles etc but I want to keep the matchbox desktop. I don't want to remove entire desktop manager.
Can anyone please suggest a way how can I remove these apps?
I had a look at the following link:
How to strip down my Yocto Linux?
But this is not what I want to achieve.
core-image-sato is an example, just write your own image recipe. The x11-sato image feature is what pulls in all of Sato. Remove that and add packagegroup-core-x11-sato-base to IMAGE_INSTALL to install just the desktop.

How can I shrink an image of an SD card to fit a smaller card?

I've been slowly building a home automation framework (Python and SQL) on a Raspberry Pi. I'm really happy with it and am trying to deploy it on a few other Pi's around the house.
I've used win32diskimager to create a .img archive of the SD card and have (on a few occasions when I stuffed things up) been able to restore to the same card.
The problem is that (illustrative numbers only) my current "8GB" SD card is 7.88GB, but the new SD cards I've purchased are 7.86GB. The image is 7.88, so it refuses to write to the 7.86GB card (even though about half of that image is just blank space).
Can I resize my image? Tried using "truncate" in nix but (for some reason) vital data is stored at the end, or there's a checksum, because lopping off a few hundred mb was enough to corrupt the file and prevent mounting / writing.
Happy to take alternate solutions for SD card cloning too. I have access to OSX / Ubuntu / W8.1, but Windows is preferred because that's where I've got the img at the moment.
Appreciate any tips!
Sam
A bit late but I found a setup that works:
Run the SD card inside a raspberry and use
sudo apt-get install -y gparted
sudo gparted
To edit its partitions. Look for the main partition, unmount it and resize it to the desired size. I haven't confirmed whether it matters but I made sure the relevant data is "on the left" and the unallocated data on the right.
There's a more detailed guide on how to do this here:
https://learn.adafruit.com/resizing-raspberry-pi-boot-partition/edit-partitions
If you can't do this for whatever reason, an alternative is setting up a fresh SD card with a new installation of say Raspbian lite and removing the option to expand into remaining space of the SD card from cmdline.txt (in my case this was the last option in the list) BEFORE running the new installation in a Raspberry pi. Then you can set up the Pi the way you like inside a smaller partition.
Once you have shrunk the needed partitions you can easily make a small image:
In Windows, you can use Win32DiskImager to make the image, while making sure "Read Only Allocated Partitions" is checked, giving you an image that - surprise surprise - omitted the unallocated data.