Raspberry Pi resize SD Backup - HDDRawCopy1 - raspberry-pi

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..

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.

STM32 - ESP8266 download file

i'm using STM32 as my microprocessor along with I2C EEPROM for storage and ESP8266 for Wifi
How can i download an update binary for the bootloader to flash using ESP8266 although the firmware file will be larger than STM32 Ram so i can't load the file from the ESP8266 in one chunk ?
I suppose that you want to update the stm32 firmware.
In this case allow to upload a new binary for the stm32 to the web, store it in the esp8266 file system (it must be bigger than stm32 flash size).
After that, enable flash memory writing, set an small protocol for update stm32 from serial comm from esp8266 the file to stm32 flash.
Remember that all functions that are used to update the stm32 flash must be in RAM.
I'm doing a project for stm32f4 and esp8266 and I will do exactly this.
OPTION 2:
If your program binary size is under 50% of stm32 flash size, then use the above half of the stm32 flash memory to store the new program, after reset, check if there is something there, and if it is then update (this is what i'm doing actually in stm32, very secure method to update since only stm32 cpu is used for update and it is very fast).
I suppose that you have two firmwares on the STM32 flash. First one is boot loader and the second one is your application. Your boot loader gets new firmware over serial interface of the ESP8266; so you can use flow control pins to halt communication until you write the data into flash memory.
I use that combination, stm32 and esp32/esp8266, for now i have not used firmware upgrade from esp (my stm32 supports it but I have not needed it for now).
The easier way is to set a serial protocol between both cpus. I'm using half of the stm32 memory for code and half for updating. What I do actually is using the communication protocolo is copy the file to the upper half of the flash memory. After when i reset the code i check if there is a firmware ready to be updated, then I copy from top half of flash to bottom half.
With this system, you can check if all is ok and the update process with take few ms. After you have this system tested (using for example a PC) you can try to do it from your esp, but it is just as easy as repeat the process.
My tip about the esp8266 is to download the file to a spiffs. If you are not using spiffs, use it, create a drive a little bigger than your memory.. for example if your stm32 firmware binary is around 60kb, and your target cpu is 256, use around 160kb for it.
There is another way, it is download the html file in chunks and then send them to the top half of the cpu, it is not very complex. I would requests chunks with the same size of the block size of your comunnication process (in my case i'm using 256b or 512b, i dont remember at this moment).
Anyways if you have enough spiffs size download the file, update the stm32 cpu, delete the file and send a reboot.
Dont forget to add a crc for data transmision between stm32 and esp8266
Btw you dont need to download it to ram , since update is used rarely and you have limitations like number of times that you can update a flash memory, so, it is not a problem to save it to flash in the esp8266 neither the stm32
Best regards

"Minimal Image" of Raspberry Pi SD Card

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!

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.

Create AVD with Eclipse: Memory Options, Internal Storage, SD Card

I am creating a new AVD within Eclipse, Android dev. tools 21.0, and it would be great to have some explanation on
"Memory Options" (RAM and VM Heap), "Internal Storage" , and "SD card".
(I am sorry but since I am a new user I am not allowed to post a snapshot image)
I would need:
- the meaning
- the unit of measure (for RAM and VM heap are not displayed)
- criteria to choose the values
Thanks
First to clear up some possible confusion, Eclipse doesn't exactly have its own AVD creation mechanism. It has a plug-in which calls the Android Vitrual Device Manager. The AVD Manager can also be accessed from the command line using "android avd", and comes as part of the Android SDK (so this question isn't specific to Eclipse users).
As for the definitions:
Internal storage
Built-in, non-removable file storage capacity. The operating system and most apps will be installed here. When you see a device advertised with 8GB or 16GB, this is what that number refers to.
The AVD Manager allows you to select Gigabyte or Megabyte.
The choice is up to your needs and the amount of space you have on your hard drive, but you'll probably want a bare minimum of 200MB. 2GB will probably be more than enough. If you run out of space you can always add more or move files to the SD card.
SD card
Similar to Internal storage, but refers to the storage an Android device would have access to on a removable memory card (the same kind of card digital cameras use). This is the place for storing user files, including documents, music and video, but some applications are built to be stored here.
The AVD Manager allows you to select Gigabyte, Megabyte, or Kilobyte.
Again, this uses space on your computer's hard drive, but this value is completely optional. You can safely leave this blank until you need to test how your app uses external storage.
Memory Option- RAM
Available working memory, used by the operating system and any running applications. This directly affects how many apps can be loaded at the same time.
The AVD Manager expects a value in MB.
This uses your computer's RAM, which is a limited resource so you don't want to use too much. I'd say the current range to play with is 256MB to 2024MB, so your sweet spot is likely either 512 or 1024.
Memory Option- VM Heap
This is a more advanced topic which is way out of scope of a beginner question. For simplicity's sake I'll just say that where RAM is related to the sum of running apps, Heap is related to an memory available to each individual app.
The AVD Manager expects a value in MB here as well.
For a reasonable value, refer to this question which lists real-world values: Android heap size on different phones/devices and OS versions
For much more information on memory, refer to the Android Developer site (http://developer.android.com/training/articles/memory.html)