"Minimal Image" of Raspberry Pi SD Card - raspberry-pi

I have a small IOT app that I've developed on a Raspberry Pi. I'd like to try running the app of a few other Pi's around my apartment. I can make a disk image of the sd card with dd, but, the original disk is 32gb and mostly empty. Is there a way to make a disk image of just the contents of a drive/sd card? This way i can make copies to smaller (cheaper) sd cards. The original SD card was set up with NOOB.
Ordinarily, I'd deploy with something like ansible, but installing all the libraries used took over 8 hours!

Related

Copy files to Ender 3 SD card via usb WITHOUT Octipi/Octoprint

I have a Raspberry pi that I am using for various other IOT things which is pretty busy, but I want to be able to connect my Ender3 3d printer USB to it so I can just copy files to the SD card. Right now, I'm pulling the card, copying files, replacing the card.
I know I can use Octopi/Octoprint but I'm just wondering if there is a simple way to get the ender3 SDcard to a mount point on the Raspberry pi so I can just remote into the Pi, upload the files and then start the printer. The printer sits on my desk so I can easily start printing using the dial. I'm just trying to avoid having to sneakernet the files to the sd card.
When you open Octoprint you can drag and drop gcode files to it in order to print.
Dropping on the left hand side of the screen stores them on the Pi dropping on the right side stores them on the SD card.
You can also click the upload to SD card button on the left hand side to do the same. Just under the list of files
once those are uploaded you can just use the printer from the front panel easily and print these files. The pi only needs to be connected in order to transfer the files.
Sorry I don't have the reputation to add images to a post to show more clearly.

Raspberry Pi resize SD Backup - HDDRawCopy1

I have been using HDDRawCopy to make backup copies of the SD cards for my Raspberry Pi's. It works well and has saved me several times when I have accidently damaged the SD card.
However, several months ago I restored an 8GB SD card image to a 16GB SD card without realizing it. Now, a lot of water has passed under the bridge (changes, new data, etc and several backups) and I want to go back to one of the recent backups.
Yesterday I discovered that a the more recent backup images think they need to be restored to a 16 GB card and fail if I try to restore to an 8GB card, even though I know it would fit.
Is there any way to take the current 16GB SD card and resize it to fit on an 8GB SD card?
I never used that tool. But I used DD in linux, it actually backes up even the empty space..and that is really hard to solve from the .img.
My suggestion is that you flash the backup onto a 16 gb card, flash the vanilla os that u used on a 8gb one, and then copy the files from one to another in a file explorer (only copy the partition that windows can open, the other one/s needs to remain intact)...in raspbian it shall work..

MicroSD Card versus USB Flash Drive for Raspberry Pi 2

Articles on this topic from 2012 for earlier RPi hardware extolling the virtues of using an external USB flash drive are now dated.
In 2015, using Raspberry Pi 2 hardware, is there still any advantage to moving the root file system and booting from an external USB flash drive instead of just using the default microSD card?
I'm not sure if the raspberry pi bootloader is even capable of booting from USB, but I could be mistaken (there might be a way to set up an SD card to act as an intermediate step in mounting the OS from USB).
Aside from that, I can't imagine you'll notice much of a speed difference between the micro sd and a USB 2 flash drive (as far as I'm aware, the rpi doesn't have usb 3 hardware). Both will have similar life span.
Other considerations: power consumption (I believe SD has an advantage here, especially since a card will have to be used anyway to boot), quality of either device (you can buy really bad SD cards and USB flash drives alike)
I would be interested in seeing some bench marks if you decide to run any tests to see if there's a difference.
My DriveSpeed benchmark measures speed of large and small file writes and reads, plus random writing and reading. RPi 2 results for SD and USB drives are here.
http://www.roylongbottom.org.uk/Raspberry%20Pi%20Benchmarks.htm#anchor21
For booting, you need to establish which performance feature is more important and it is not just large file data transfer speed. Anyway, it mainly depends on the drive hardware performance characteristics. My system SD card can be out performed by SD cards in a USB card reader.

Is it possible to install Raspbian on raspberry PI without keyboard?

So far, what i tried is that
put raspbian image on to SD card.
power up PI with Sd card.
And after booting, a set-up option window popped up which i can't skip without keyboard.
Is there any way to skip this option menu ..?
Thank you
No, there are no buttons or physical input on the Raspberry PI itself, so without plugging some input device in you cannot skip the menu.
You could install Raspbian on a Raspberry PI emulator, do all the setup on your computer, then copy the already-setup disc image to your SD card. Here's a tutorial for setting up QEMU to emulate the Raspberry PI (and it includes installing Raspbian on the emulator): http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
That seems like a lot of work though. You should probably just borrow someone's keyboard.

How to bind SD card to Raspberry Pi

Is there a way to make sure that SD card of Raspberry PI works only with particular device only?
I do not want anyone to use the SD card with any other Raspberry Pi device other than specified.
Is there a way out?
There is no simple way do do this. Of course you can build some trickeries based on Device Informations (fsys and udev) and crypt your disk. But, it is clearly impossible to guarantee system integrity when the storage device is physically reachable: anyone can mount it and some aware/clever guy, using enough time and effort, shall reverse engineering it.
See this guide for Arch linux: https://wiki.archlinux.org/index.php/Disk_Encryption
If you encrypt your filesystem only he have the password can decrypt the sdcard. This prevent unauthorize access for example from the Windows/Linux to the sd card files.
But if you boot from the PC you are in the same problem.
The only thing that comes to mind is to make a script that controls a device that exists only on raspberry is available and if not, automatically encrypt the system.