Forum

Full Version: Not possible to expand SD card
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

I've flashed a backup image to a rather big sd card (64gb) and im trying to expand the root partition, but with no luck.

I have followed the other guides but I still cant managed to expand the partition.

In /boot/config.text, I have:
Terminal
initramfs initramfs.gz 0x1500000

In /etc/default/xbian-initramfs, I have:
Terminal
FORCEINITRAM=yes

And
Code:
sudo fdisk -l /dev/mmcblk0
:
Terminal
Disk /dev/mmcblk0: 59.5 GiB, 63864569856 bytes, 124735488 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: 0x1a33a7ca

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 141311 139264 68M b W95 FAT32
/dev/mmcblk0p2 141312 15175679 15034368 7.2G 83 Linux
/dev/mmcblk0p3 15175680 15677439 501760 245M 82 Linux swap / Solaris

Is it not possible to expand /dev/mmcblk0p2?
Hmmm, it should work, but you have already swap partition, that's an indication for root fs expansion has been already done, but probably with the wrong size.

When you start your Pi, do you see the splash message sd card resize..., and/or fs resize... and/or creating swap... ?

You could start that process again if you remove swap partition and reboot again

Before removing swap partition, you have to stop swap first:

Terminal

sudo swapoff -a
(5th Mar, 2018 01:38 AM)Nachteule Wrote: [ -> ]Hmmm, it should work, but you have already swap partition, that's an indication for root fs expansion has been already done, but probably with the wrong size.

When you start your Pi, do you see the splash message sd card resize..., and/or fs resize... and/or creating swap... ?

You could start that process again if you remove swap partition and reboot again

Before removing swap partition, you have to stop swap first:

Terminal

sudo swapoff -a

How do I remove the swap partition? Can I do it without using gparted on another machine e.g.?
(5th Mar, 2018 07:01 PM)joehc Wrote: [ -> ]How do I remove the swap partition? Can I do it without using gparted on another machine e.g.?

Sure, you can do this:

you have to run fdisk and delete partition 3

Terminal

sudo fdisk /dev/mmcblk0

Inside fdisk, you can run command 'p' to display all partitions and 'd' to remove partition (fdisk usually defaults to the last partition, this is the one you have to remove)
Set to solved Smile
I am newcomer on the forum here, but a long time user of xbian.

I'm piggy backing on this thread as I cannot create a new one yet.

I'm looking for the best way to downsize the root partition on the sd card.
I need to be able to clone this 32GB (with my vpn, trnasmission with kill-switch,sickrage,...etc) to a 8gb card.
I also don't know if the automatic expansion is happening automatically only at the first boot and if not how to prevent it from resizing again.

Terminal

xbian@xbian ~ $ sudo fdisk -l /dev/mmcblk0
[sudo] password for xbian:
Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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: 0xde0b7559

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 141311 139264 68M b W95 FAT32
/dev/mmcblk0p2 141312 61832191 61690880 29.4G 83 Linux
/dev/mmcblk0p3 61833216 62333951 500736 244.5M 82 Linux swap / Solaris

any help appreciated. Also I realized you don't have any crypto donation address. (any reason why)
I would happily send you guys money for a 6 pack with bitcoins or even better through lightning network.
(2nd Aug, 2018 11:30 PM)tookdrums Wrote: [ -> ]I am newcomer on the forum here, but a long time user of xbian.

I'm piggy backing on this thread as I cannot create a new one yet.

I'm looking for the best way to downsize the root partition on the sd card.
I need to be able to clone this 32GB (with my vpn, trnasmission with kill-switch,sickrage,...etc) to a 8gb card.
I also don't know if the automatic expansion is happening automatically only at the first boot and if not how to prevent it from resizing again.

The easiest way to shrink your existing installation is to make an image backup.

Start xbian-config, and run menu point 6 (xbian copier), and select file:/the-position-you-want/the-image-file-you.want as destination. This image can be flashed to your 8GB card and boot from that card

Automatic resize is done always, it is part of the init procedure which resides in the initramfs part. You can disable this behavior by adding the noresizesd parameter to the kernel command line, see here

Quote:any help appreciated. Also I realized you don't have any crypto donation address. (any reason why)
I would happily send you guys money for a 6 pack with bitcoins or even better through lightning network.

Sorry, we have PayPal donation only Sad
Reference URL's