NOTE: This is from a very early release - XBMC13.2 Dec 2014.
The system was backup up using xbian-config to an image. Due to an error, the backup was restored to the SD card and the system booted.
However, the FS does not resize and thinks it is only 2G whereas the card is 4G.
Is there anyway to force the resize or can I do it on a live BTRFS system?
(10th Apr, 2016 08:36 PM)IriDium Wrote: [ -> ]Is there anyway to force the resize or can I do it on a live BTRFS system?
Forcing resize: don't know
You can do it while fs is mounted
1) check partition size
sudo fdisk -l /dev/mmcblk0
if size is already max then continue with step 5
2) remove swap part if exists (should be partition 3)
sudo swapoff -a
and then run sudo fdisk /dev/mmcblk0 and remove swap part
don't exit fdisk
3) enlarge root partition (should be partition 2) and add new swap partition
start fdisk if not already running
The trick is removing the existing one and create a new one with
exactly the same start block and max size minus 250M for swap part
Add swap partition, use rest of disk for this
save changes to disk and exit (command w)
4) reload partition table into kernel
run sudo partprobe
if partprobe complains anything, you have to reboot before step 5
step 5) resize root fs and add swap
resize root fs
sudo btrfs filesystem resize max /
sudo swapoff -a
sudo mkswap /dev/mmcblk0p3
sudo swapon -a
Unfortunately that didn't work. fdisk was throwing up errors about the disk and wouldn't let me delete the partition.
Trying an alternative image back and see if that is any better
(10th Apr, 2016 11:10 PM)IriDium Wrote: [ -> ]Unfortunately that didn't work. fdisk was throwing up errors about the disk and wouldn't let me delete the partition.
So this was the reason for resizing failed
More than likely - a later backup image worked as expected.
I moved my SD-card to the USB stick on a RPI 2b device. This works fine. However, the root partiion doesn't want to resize to the size of the USB stick. xbian-config doesn't support the resize, since it is supposed to resize by itself.
How can I make it resize?
(I checked some old forum topics, and I checked my /boot/config.txt The following lines look different than in those forums:
Code:
# see /etc/default/xbian-initramfs
#initramfs initramfs.gz followkernel
(14th May, 2019 07:46 AM)jakenl Wrote: [ -> ]I moved my SD-card to the USB stick on a RPI 2b device. This works fine. However, the root partiion doesn't want to resize to the size of the USB stick. xbian-config doesn't support the resize, since it is supposed to resize by itself.
How can I make it resize?
(I checked some old forum topics, and I checked my /boot/config.txt The following lines look different than in those forums:
Code:
# see /etc/default/xbian-initramfs
#initramfs initramfs.gz followkernel
You have to enable initramfs in Kodi's XBian-config gui, category System, remove swap partition manually (if exist, see above) and reboot.
(14th May, 2019 10:47 PM)Nachteule Wrote: [ -> ] (14th May, 2019 07:46 AM)jakenl Wrote: [ -> ]I moved my SD-card to the USB stick on a RPI 2b device. This works fine. However, the root partiion doesn't want to resize to the size of the USB stick. xbian-config doesn't support the resize, since it is supposed to resize by itself.
How can I make it resize?
(I checked some old forum topics, and I checked my /boot/config.txt The following lines look different than in those forums:
Code:
# see /etc/default/xbian-initramfs
#initramfs initramfs.gz followkernel
You have to enable initramfs in Kodi's XBian-config gui, category System, remove swap partition manually (if exist, see above) and reboot.
With the fdisk command I checked the USB-stick that holds my OS:
Code:
@xbian ~ $ sudo fdisk -l /dev/sda
[sudo] password for xbian:
Disk /dev/sda: 28.7 GiB, 30752000000 bytes, 60062500 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: 0xf01f2a15
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M b W95 FAT32
/dev/sda2 206848 2609151 2402304 1.1G 83 Linux
It seems like this disk doesn't hold a swap partition.
Then I checked the Xbian GUI:
Xbian - System - (sub topic System) - 'Use of initramfs' = required
I put it on 'always' and rebooted. This doesn't do the trick.
(15th May, 2019 04:03 AM)jakenl Wrote: [ -> ]With the fdisk command I checked the USB-stick that holds my OS:
Code:
@xbian ~ $ sudo fdisk -l /dev/sda
[sudo] password for xbian:
Disk /dev/sda: 28.7 GiB, 30752000000 bytes, 60062500 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: 0xf01f2a15
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M b W95 FAT32
/dev/sda2 206848 2609151 2402304 1.1G 83 Linux
It seems like this disk doesn't hold a swap partition.
Then I checked the Xbian GUI:
Xbian - System - (sub topic System) - 'Use of initramfs' = required
I put it on 'always' and rebooted. This doesn't do the trick.
Hmmm, but it should
There are cmdline parameters to disable resize partition and creating of swap, but I don't believe that you have set them
Have you checked if initramfs is enabled in /boot/config.txt now?
Yes I checked, the hash sign is still in front of it. The text is the same as described 2 posts back
(15th May, 2019 06:25 AM)jakenl Wrote: [ -> ]Yes I checked, the hash sign is still in front of it. The text is the same as described 2 posts back
Ah, that's what I assumed
Did you save the setting you changed? It's not enough to change setting, you have to go to next/previous setting in XBian-config GUI before you'll be asked if you want to save setting or not.
Another question:
Are you booting without sd-card? If not, maybe wrong /boot partition is mounted
(15th May, 2019 07:22 AM)Nachteule Wrote: [ -> ] (15th May, 2019 06:25 AM)jakenl Wrote: [ -> ]Yes I checked, the hash sign is still in front of it. The text is the same as described 2 posts back
Ah, that's what I assumed
Did you save the setting you changed? It's not enough to change setting, you have to go to next/previous setting in XBian-config GUI before you'll be asked if you want to save setting or not.
Another question:
Are you booting without sd-card? If not, maybe wrong /boot partition is mounted
I forgot the next/previous thing and after a reboot, the # sign was gone indeed. However, the partition was not resized.
Code:
# see /etc/default/xbian-initramfs
initramfs initramfs.gz followkernel
It is a RPI 2b, therefore it needs a SD-card to boot from.
Extract from the fdisk command: fdisk -l:
Code:
Disk /dev/mmcblk0: 1.9 GiB, 2013265920 bytes, 3932160 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: 0xa83c8155
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 141311 139264 68M b W95 FAT32
/dev/mmcblk0p2 141312 1647487 1506176 735.4M 83 Linux
Disk /dev/sda: 28.7 GiB, 30752000000 bytes, 60062500 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: 0xf01f2a15
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M b W95 FAT32
/dev/sda2 206848 2609151 2402304 1.1G 83 Linux
and
Code:
xbian@xbian ~ $ df -h