I was trying to perform an update and an error told me that I hadn't enough free space. So I connected to my Raspberry through SSH to ask for disk usage with:

df -h

And I obtained the following result:

Filesystem                Size      Used Available Use% Mounted on
devtmpfs                185.1M     87.5M     97.6M  47% /dev
/dev/mmcblk0p1          124.7M     96.2M     28.6M  77% /flash
/dev/mmcblk0p2          755.9M    739.4M         0 100% /storage
/dev/loop0               87.5M     87.5M         0 100% /
tmpfs                    74.6M         0     74.6M   0% /dev/shm
tmpfs                    10.0M    684.0K      9.3M   7% /var

The thing is my SD card is an 8Gb SD card and the size it displays is more like 1Gb, so my question is why can't I see the whole space?

7 Answers 7


Modified from here, SSH into your Raspberry Pi running OpenELEC and follow these steps.

  1. SSH in as root, by default you’re in /storage; switch to root partition:

    $ cd /
  2. Keep XBMC from restarting:

    $ touch /var/lock/xbmc.disabled
  3. Stop XBMC, so we can unmount /storage:

    $ killall -9 xbmc.bin
    $ umount /storage
  4. Verify mounts:

    $ mount
    $ parted /dev/mmcblk0
  5. In parted, change to sectors display:

    $ unit s
  6. Show partitions, make note of starting sector of your partition:

    $ p
  7. Remove the partition:

    $ rm 2
  8. Re-create it, using same starting sector number and ending in "-1" to use remaining space:

    $ mkpart primary 258048 -1
    $ quit parted
    $ e2fsck -f /dev/mmcblk0p2
    $ resize2fs /dev/mmcblk0p2
    $ mount /dev/mmcblk0p2 /storage
    $ df -h
    $ rm /var/lock/xbmc.disabled
  9. XBMC will start up again on its own.

  • Is this command present on the openelec distribution?
    – darkheir
    Commented Jul 26, 2013 at 17:43
  • Sorry, I always default to Raspbian instructions, bad habit :P. I've re-answered the question and now it should work.
    – syb0rg
    Commented Jul 26, 2013 at 17:48
  • Doesn't work. I can't unmount because connmand is using /storage and it can't be killed
    – Rob
    Commented Dec 29, 2013 at 19:46
  • Doesn't work anymore! See Marcin's answer below.
    – Herman
    Commented Oct 31, 2014 at 21:46

OpenELEC resizes /storage on first boot after creating the SD. I looked for the script that does that. It's https://github.com/OpenELEC/OpenELEC.tv/blob/master/packages/sysutils/busybox/scripts/fs-resize?source=c The first code line checks for /storage/.please_resize_me file.

So... to resize storage to fill the SD you need to:

touch /storage/.please_resize_me

Done that on my OpenELEC 4.0.7 and worked fine.

  • tried it on 5.0.3 and it worked as stated
    – LowvaPrg
    Commented Feb 23, 2015 at 2:24
  • On the second line of the script it says that it can't resize if there exists a folder named kodi, config or cache. I got all 3 of them... So how do I resize now? Commented Jan 3, 2016 at 16:04
  • I tried this and a message flashed up on the screen that said something like "can't resize because system is already initialized", but then strangely, my "Used" column in the system info storage page went down from 6G to 872M but I still couldn't upload. So I just did: raspberrypi.stackexchange.com/a/124640. disk usage stats are still messed up but I can upload again
    – Alex028502
    Commented May 8, 2021 at 7:58

One issue I had (with version 3.1.5) : umount /storage => “umount: can’t umount /storage: Device or resource busy”

fuser -m /storage => pid of the process that was locking the mount I tried to kill it, but everytime a new process blocked the mount. I have to kill + umount in the same time with the pipe (in this order) : umount /storage | kill -9 pid

That’s do the job !

  • Doesnt work, connmand restarts itself automatically before the terminal can run the umount
    – Rob
    Commented Dec 29, 2013 at 19:47

In case anyone has this problem with newest version:
syb0rg answer is great but
$ touch /var/lock/xbmc.disabled
$ killall -9 xbmc.bin

does not work anymore! Use:
$ systemctl stop kodi.service instead!


Openelec 5:

Check what process are blocking the partition /storage to be unmounted

lsof | grep "/storage" (will return the PID of the process)

Check if these processes are in the systemd tree and are controlled by systemd.

systemctl status will show the systemd tree.

In may case I had to stop the following:

systemctl stop cron.service
systemctl stop connman.service
systemctl stop kodi.service

Check with fuser -m /storage if there are still process blocking that directory. In case some PID are returned you can check what process is associated with that PID running ps -ef | grep $PID.

If you see something like -sh it is your ssh session that is in the /storage directory. cd / to go in the root.

Otherwise you can kill that process with kill -9 $PID.

Now you can safely unmount the /storage directory via

umount /storage

Now you can resize the partition (I will report again since some commands are changed)

  1. Ensure which particion /storage belong to

    df -h

In most of the case will be /dev/mmcblk0p2 (which is partition 2)

  1. Open parted for the device /dev/mmcblk0

    parted /dev/mmcblk0

  2. Show partitions (we alredy now which partition we want to resize)


  3. Resize the partition (this case partition 2 till the end)

    resize 2 -1

    quit parted

  4. Resize the file system

    e2fsck -f /dev/mmcblk0p2

    resize2fs /dev/mmcblk0p2

    mount /dev/mmcblk0p2 /storage

    df -h

If you want to resize /flash is a completely different story.

  • 1
    Worked for me, except parted /dev/mmcblk0 was parted and resize 2 -1 needed to be resizepart 2 -1
    – ChrisGheen
    Commented Mar 8, 2017 at 6:53
  • Best anwser so far. Nothing else worked for me except this anwser. Commented Apr 10, 2017 at 18:04

I solved the issue about "unmount storage/" killing in this way:

fuser -m /storage


kill -9 5161 && umount /storage

That's worked for me.


None of the above immediately worked, so I just put the SD card into my ubuntu computer and resized the disk using the disk utility

so far so good

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.