Forum

Full Version: Resize partition after xbian installation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

My Xbian system (20150218-1) was almost full (4G sd card).
I used xbian cleaner to empty thumbnails dir (had to repair the btrfs partition after to free empty space)
Now I have a new 8G sd card where I put an image of the 4G sd card system.
The system boots but doesn't use all free space of the 8G sd card.

Terminal
xbian@arwen ~ $ sudo fdisk -l

Disk /dev/mmcblk0: 7.5 GiB, 8068792320 bytes, 15759360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x982fedaf

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 71679 69632 34M b W95 FAT32
/dev/mmcblk0p2 141312 7241727 7100416 3.4G 83 Linux
/dev/mmcblk0p3 7241728 7744511 502784 245.5M 82 Linux swap / Solaris

Disk /dev/sda: 3.7 GiB, 4004511744 bytes, 7821312 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x982fedaf

Terminal
xbian@arwen ~ $ sudo btrfs filesystem df /
Data, single: total=3.01GiB, used=2.14GiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=376.00MiB, used=49.66MiB

I red on the forum that xbian autoresize the btrfs partition at boot time, and if it doesn't work, the best is to use Gparted.
So I boot an ubuntu on a mac but Gparted doesn't see free space after the swap partition.
Disk utility is able to see the last 4G but doesn't seem to be able to do something.

Any idea to transfer easily my 4G xbian on the 8G sd card and use all space available ?

Thanks
Pascal
just make a Kodi backup, than fresh install XBian and restore your backup (should work in theory with backup addon)
If I'm right, the backup add-on only backup xbmc settings.
I'm interested in restoring the whole linux system with extra packages and personal settings

thx
Pascal
Did you already try the Resize option in xbian-config?
Settings => System => Resize SD

But better create a full backup image of your current SD card with this little app:
http://sourceforge.net/projects/win32diskimager/
I gave a try to xbian-config, but got this message :
Terminal
This part of code is currently (as of beta1) │
│ obsolete and is disabled. Resize is automatically │
│ provided by initramfs helpers. On this place we │
│ plan to provide easy, simple but fully universal │
│ partition manipulator / copy / resizer to cover │
│ needs of a RPI user.

I have a full backup image made with dd.
I can test everything, I'm able to restore the original,
but not able to extend the mmcblk0p2 partition.
I've didn't check if the optional is still implemented. My bad, sorry.

But if you have a backup and want to try something else I would suggest to just try the official Raspberry config tool. It also has an Resize option and should be available for download:
http://elinux.org/RPi_raspi-config
http://www.raspberrypi.org/forums/viewtopic.php?&t=42836
Will not work for btrfs.
As Xbian resizes the partition with the first start my last idea is to check the available code at github. The needed part seems to be in the initramfs-package:
https://github.com/xbianonpi/xbian-package-initramfs/blob/master/content/etc/xbian-initramfs/cnvres-code.sh

Much code, but perhaps you will find what you are looking for or at least you will get an idea of the process.
Good luck.
Reference URL's