Forum
FS not resizing. - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: CuBox-i / Hummingboard (/forum-66.html)
+--- Forum: Installation (/forum-70.html)
+--- Thread: FS not resizing. (/thread-3521.html)

Pages: 1 2


FS not resizing. - IriDium - 10th Apr, 2016 08:36 PM

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?


RE: FS not resizing. - Nachteule - 10th Apr, 2016 10:00 PM

(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 Huh

You can do it while fs is mounted Smile

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


RE: FS not resizing. - IriDium - 10th Apr, 2016 11:10 PM

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


RE: FS not resizing. - Nachteule - 10th Apr, 2016 11:24 PM

(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


RE: FS not resizing. - IriDium - 11th Apr, 2016 12:54 AM

More than likely - a later backup image worked as expected.


FS not resizing. - jakenl - 14th May, 2019 07:46 AM

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



RE: FS not resizing. - Nachteule - 14th May, 2019 10:47 PM

(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.


RE: FS not resizing. - jakenl - 15th May, 2019 04:03 AM

(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.


RE: FS not resizing. - Nachteule - 15th May, 2019 04:22 AM

(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 Huh 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?


FS not resizing. - jakenl - 15th May, 2019 06:25 AM

Yes I checked, the hash sign is still in front of it. The text is the same as described 2 posts back


RE: FS not resizing. - Nachteule - 15th May, 2019 07:22 AM

(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


RE: FS not resizing. - jakenl - 16th May, 2019 04:12 AM

(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                                          
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       1.2G  943M   41M  96% /
devtmpfs        370M  4.0K  370M   1% /dev
none             75M  1.4M   74M   2% /run
/dev/sda2       1.2G  943M   41M  96% /lib/modules
/dev/sda2       1.2G  943M   41M  96% /home
/dev/sda2       1.2G  943M   41M  96% /xbmc-backup
/dev/sda1       100M   27M   74M  27% /boot
none            4.0K     0  4.0K   0% /sys/fs/cgroup
/dev/sdb1        58G   28G   31G  48% /media/64GB_ULTRAF
/dev/sdc1       116G   90G   27G  78% /media/128gb_ultra



RE: FS not resizing. - Nachteule - 16th May, 2019 04:20 AM

So we have the first error:

You're booting from sd-card (/dev/mmcblk0p1) but when system is up this partition is not mounted to /boot. /dev/sda1 is mounted instead. This is wrong and will produce serious issues in case of installing/updateing packages!

Please correct this in /etc/fstab and try again


RE: FS not resizing. - Nachteule - 16th May, 2019 04:36 AM

Btw, if you want to use boot partition from your external usb device, you could prepare an sd-card as documented in this article

I tried this a couple of months ago with an Pi2, and it's working great


RE: FS not resizing. - jakenl - 16th May, 2019 07:12 AM

(16th May, 2019 04:36 AM)Nachteule Wrote:  Btw, if you want to use boot partition from your external usb device, you could prepare an sd-card as documented in this article

I tried this a couple of months ago with an Pi2, and it's working great
I had to repeat the process above 2 times, went back to a backup of this SD-card in between, but at the eind it works as expected: only bootcode.bin on a FAT formatted card and it boots further from USB. Great!
With df -h I checked available file size and my full 32Gb is now accessible. Main issue solved. By running sudo fdisk -l I also found a SWAP file mounted on /dev/sda3, so that seems good too now!
(16th May, 2019 04:20 AM)Nachteule Wrote:  So we have the first error:
Very well possible, good that you found a reason! (although I only followed the backup to USB procedure from xbian-config at the time)
Quote:You're booting from sd-card (/dev/mmcblk0p1) but when system is up this partition is not mounted to /boot. /dev/sda1 is mounted instead. This is wrong and will produce serious issues in case of installing/updateing packages!

Please correct this in /etc/fstab and try again
Please help me with my /etc/fstab content. I see for instance 2 identical lines with an UUID. With your help I might streamline my fstab as well and have a proper functioning system left.
Code:
#
# Configured /etc/fstab for XBian system
#
/dev/root                       /home                   xbian   subvol=home/@,noatime,nobootwa$
/dev/root                       /lib/modules            xbian   subvol=modules/@,noatime,noboo$
/dev/root                       /                       xbian   noatime,nobootwait,rw         $
UUID=4D28-F2B5                  /boot                   xbian   noatime,rw,private            $
UUID=4D28-F2B5                  /boot                   xbian   noatime,rw,private            $
none                            /run/user               tmpfs   noauto                        $
none                            /run/shm                tmpfs   noauto                        $
none                            /run/lock               tmpfs   noauto                        $
/dev/root                       /xbmc-backup            xbian   subvol=data/@,noatime,rw      $

sudo blkid:
Code:
xbian@xbian ~ $ sudo blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="XBIANBOOT" UUID="CAFE-3855" TYPE="vfat" PARTUUID="a83c8155-01"
/dev/sda1: SEC_TYPE="msdos" LABEL="xbianboot" UUID="4D28-F2B5" TYPE="vfat" PARTUUID="f01f2a15-01"
/dev/sda2: LABEL="xbian-copy" UUID="031acc7d-62dc-4222-b984-d6b038d6addd" UUID_SUB="2d9af58a-fd25-4139-86d2-10d1659ac0df" TYPE="btrfs" PARTUUID="f01f2a15-02"
/dev/sdb1: LABEL="64GB_ULTRAF" UUID="4F84-BB12" TYPE="vfat"
/dev/sdc1: LABEL="128gb_ultra" UUID="36BD-90D2" TYPE="exfat" PARTUUID="25cad010-01"
/dev/sda3: UUID="a732b379-8327-424e-bc4e-988a866b70ec" TYPE="swap" PARTUUID="f01f2a15-03"
/dev/zram0: UUID="559b16f7-6c5f-4aea-80e7-c5ba11065304" TYPE="swap"
/dev/mmcblk0: PTUUID="a83c8155" PTTYPE="dos"