Skip to content

Instantly share code, notes, and snippets.

@fwarren
Last active December 1, 2021 05:46
Show Gist options
  • Save fwarren/1c0d61762a85e23ba3e3d63e0e9fcb0a to your computer and use it in GitHub Desktop.
Save fwarren/1c0d61762a85e23ba3e3d63e0e9fcb0a to your computer and use it in GitHub Desktop.
Installing LibreElec From Backup

Partition Information

Partition      Files System  Label          Size        Flags
unallocated    unallocated                    4.00 Mib
/dev/sda1      fat16         LiBREELEC      512.00 Mib  boot,lba
/dev/sda2       ext4         STORAGE         28.46 Gib
  • Skip the first 4 mb on the stick
  • the booting partition is fat16 formatted and 512 mb in size (1/2 a gb) and is called LiBREELEC
  • the partiton with the data on it is ext4 formatted, it the rest of the space and called STORAGE

Finding out where the SD Card is at

  • It should be at /dev/sda To verify do these two things
  1. Insert your SD card
  2. Run the following command: dmesg
  3. You should get an output that ends like this
[28141.703701] scsi host1: usb-storage 1-7:1.0
[28142.741121] scsi 1:0:0:0: Direct-Access     Generic- SD/MMC/MS PRO    1.00 PQ: 0 ANSI: 4
[28142.741834] sd 1:0:0:0: Attached scsi generic sg0 type 0
[28143.587570] sd 1:0:0:0: [sda] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
[28143.587888] sd 1:0:0:0: [sda] Write Protect is off
[28143.587892] sd 1:0:0:0: [sda] Mode Sense: 2f 00 00 00
[28143.588201] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[28143.616661]  sda: sda1
[28143.660064] sd 1:0:0:0: [sda] Attached SCSI removable disk

Make sure you are in the correct folder

cd /home/lee/Downloads/LibreElec9Backup

Unmount any partition mounted by the file manager

sudo umount /dev/sda1
sudo umount /dev/sda2

Writing the partition table to the SD Card

If the stick is the same size or bigger this should work:

sudo sfdisk /dev/sda < pi.sfdisk

Write the first partition (takes a short time)

sudo fsarchiver restfs libreelec.fsa id=0,dest=/dev/sda1

Write the second parition (takes a long time)

sudo fsarchiver restfs storage.fsa id=0,dest=/dev/sda2

Remove SD card and use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment