How to resize /flash using ssh

  • I currently run OpenELEC 5.0.8 and cannot update to LibreELEC as the /flash partition is too small (170MB). I tried a fresh install, but my Xtreamer Ultra 2 HTPC will not boot from USB. The only option I see is to ssh into the OpenELEC shell, and resize the /flash partition from command line. After that I plan to copy the update .tar into the /storage/.update folder and hope the OpenELEC will update itself to LibreELEC.

    My plan:

    - unmount the /storage

    - remove the /storage partition

    - resize the /flash partition to 1G using builtin parted command

    - create a new empty storage partition

    - create a new filesystem for /storage

    - create a directory /storage/.update

    - copy the LibreELEC update into /storage/.update

    - reboot and pray

    1) Should this even work? If is drop the /storage file system will the Linux OS still be functional?

    2) To increase /flash, i first need to decrease the /storage. How do I unmount it. I stopped the Kodi process, but it is still complaining

    umount -f /storage

    umount: can't forcibly umount /storage: Device or resource busy

  • You cannot resize partitions when booted from the OS so you need to boot from USB - Ubuntu with gparted is easiest unless you're familiar with doing things from the command line. Or do the backup / clean install / selective restore process Klojum is hinting at. Ultra2 (which I used as the family daily-driver for a long time) can boot from USB but it needs "legacy mode" or something to be set in the BIOS first before it will see the USB device as bootable; and even then the BIOS is flakey so it can take a few attempts. I've done the same resize a couple of years back.

  • chewitt, Klojum thanx for your help. So booting from USB is my only option. I am trying for a few days now with no success. Will play with BIOS settings a bit more and let us see.

  • Tried it a few more times and it worked !!!. I run American Megatrends AMI BIOS, Aptio V2.13. The trick that worked for me is to set:

    - Legacy USB support to Enabled

    - USB device power up delay to 5s

    - USB the be seen as Hard Disk (USB, Mass Storage Devices - Hard Disk)

    - Boot order needs to be set in two places; Main menu of Boot options where you set the order of devices: USB, Hard Disk . But since we have set the USB to be recognized as Hard Disk, you also need to set the order in which Hard Disks are booted. There is a line below, something like HDD Boot order. Here you have to set the USB Hard disk to have priority over built in SATA disk.

    Took me a week, but finally I managed to upgrade to latest LibreELEC.

    Thank you.:D