clone/backup sd-card as image?
  • Order of the Butterfly
    Order of the Butterfly
    catohagen
    Posts: 297 from 2003/5/20
    I have a raspberry pi to remote control a my 3D printer, the linux OS is loaded off
    an SD card and was wondering if i can backup this card on morphos?
    so if filesystem gets corrupted later or I mess stuff up, I can just rewrite my backup and have a working boot image again..
  • »24.01.13 - 14:31
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    You can do that out of the box. In fact I do this to feed my RaspberryPi all the time, too.

    Using Ambient:
    ------------------

    Just open a volume like your SYS: partition with Ambient. Type "/" and an path input appears. Enter "RAWDISK:" and press return..

    Now press "8" on your numberic pad or select "all files" from contect menu. You will see "Devices" and "Disks". You want to backup and restore the entire drive and not a single disk (partition), so enter "Devices".

    You may need to enable "show all files again" after this and following steps, as the virtual filesystem has no icons. Now select the device your SD card is pluged in. Should be a cardreader in usbscsi.device. Next step is usually selecting the unit. This value depends on your card reader and the number of deviced plugged in. You can check for the number in the usb log in preferences to be sure getting the right drive. Lets say it is "2", so enter it. If you did right you may see the usb stick being accessed.

    Within this drawer you find a file named "rawdisk" and it should appear in the size of your SD card minus some MB. Now simply grab that file and drop it on the destination drive. Just make sure you use a filesystem able to deal with big files.

    To restore an image simply drag that file back into and overwrite it. There is a savety mechanism, which asks you before writing stuff, so you may reconsider writing.

    Using Shell
    -------------

    If you installed the SDK you can use the shell as well, as due some bug you need curently the CP command and cannot use the standard Copy command.

    Acess is basically the same

    CP RAWDISK:Devices/usbscsi.device/2/rawdisk BACKUPDrive:

    and to restore

    CP BACKUPDrive:rawdisk RAWDISK:Devices/usbscsi.device/2/rawdisk

    Please note that the unit can change depending on prior used usb media, so if your card readers SD slot is unit 4 and you have an USB stick inserted at boot, it may be placed at unit 0, while your SD slot moved to unit 5.

    Additional Information:
    --------------------------

    When you use the tool "FileImageCtrl", which lives in the SYS:Tools drawer, you can even mount the file without using the real SD media. Of course this requires a matching file system.

    RAWDISK: can be quite handy to backup and clone partitions and entire drives.

    FileImageCtrl you can mount these files. In fact the image you created can be used as file disk in e.g. UAE, too (with the proper file system) It even can mount ADFs and all other image files a proper file system exists.

    Since with FileImageCtrl mounted file disks are handled like real harddrives/floppy disks, you can even add, delete and modify files without the need of writing them to a real media. So if you mount a "Workbench.ADF" you can gain some space and add tools to create a bootable utility disk image for your UAE or your real Amiga without the need of having a real disc drive connected to your MorphOS system.

    Geit


    [ Edited by geit 24.01.2013 - 20:28 ]
  • »24.01.13 - 15:22
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    catohagen
    Posts: 297 from 2003/5/20
    thank you, worked perfectly :)
  • »24.01.13 - 15:52
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    catohagen
    Posts: 297 from 2003/5/20
    sfs filesize limit is 4.something GB ? rawdisk copy stopped...have a spare 120gig SSD connected to usb, formatted it as IceFS and trying again, sd-card is 8gb
  • »24.01.13 - 17:13
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    Yeah, SFS is limited. I think its limit is around 2GB file size.

    It should work with ice-fs.

    Geit

    [ Edited by geit 24.01.2013 - 20:24 ]
  • »24.01.13 - 17:38
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Thanks for the detailed explanation Geit. Too often members here assume that the rest of the members reading these forums have the same experience level as they do and therefore do not explain things in such great detail and noobs get lost, or confused. Even someone who is not exactly a noob (like me), forgets how things work, or misses a step here or there, so explanations like yours are very helpful.
    MorphOS - The best Next Gen Amiga choice.
  • »24.01.13 - 18:14
    Profile