lneuhaus / pyrpl

pyrpl turns your RedPitaya into a powerful DSP device, especially suitable as a lockbox in quantum optics experiments.
http://lneuhaus.github.io/pyrpl/
MIT License
139 stars 109 forks source link

Point on SD cards #254

Closed SamuelDeleglise closed 7 years ago

SamuelDeleglise commented 7 years ago

I have been struggling all the afternoon with SD cards. The aim was to make a backup .img file of the system v0.92 , because it cannot become corrupted unlike the subsequent ubuntu-based systems.

Problem: it is impossible to find an img file of such an old system on the web (or at least I didn't find one yet), but we have some 32 GB bootable SD cards with the system on it.

I could successfully make an image of one of these cards using win32imager (on leon/software/redpitaya/image for sd cards/sheon_os0.92.img), but it is more than 30 GB of void... --> it can be flashed on a 32 GB SD card, and then the system works fine --> Unfortunately, it cannot be flashed onto a smaller SD card.

I tried two things to reduce the file size :

This sounds like a silly problem, basically, whenever you copy the system onto a card, there is no way to use this as a copy to be flashed on a smaller card, or at least, not with the rudimentary win32diskimager that we are using... I will try to look a bit more through the internet for a reasonable sized image of the v92 system.

SamuelDeleglise commented 7 years ago

I finally figured out how to flash the bootable sd card from the files...

The procedure is the following:

  1. I open my ubuntu virtualbox on my laptop with integrated SD card reader.
  2. To make sure the SD card will be visible in the virtualbox, I go to configuration/usb and enable the sd card reader (which appears there on my windows system)
  3. I open the ubuntu virtual machine and install gparted and dosfstools with the command "sudo apt-get install XXX"
  4. I insert the sd card in the reader and launch gparted (sudo gparted /dev/sdb) on the corresponding device (/dev/sdb in this case but can be found with "dmesg | tail")
  5. In the gparted interface, delete all existing partitions, create a partition map if there is not already one, then create 1 fat32 partition with the maximum space available. To execute these operations, it is necessary to unmount the corresponding partitions (can be done within gparted)
  6. Once formatted, right click to set the flag "boot" to that partition !!!!!
  7. Close gparted, remount the sd card (by simply unplugging/replugging it), and copy all files at the root of the sd card (normally mounted somewhere in /media/xxxx)

---> Eject the card, that should be fine.

Now that I coud apply this procedure on a 4 GB SD card, I have been able to make a 4 GB image of it (which hopefully includes the right boot flag) using win32diskImager (in /leon/omq/software/redpitaya/image for sd card/redpitaya_v0.92.img) In principle, it is only necessary to do a win32diskimager write operation using this file on any sd card that is larger or equal to 4GB

SamuelDeleglise commented 7 years ago

---> I created a section in the wiki