Jump to content

Problem with BTRFS


Renan

Recommended Posts

Hi,
I have created an image with the following command

/root/build/compile.sh BOARD=orangepi-r1 BRANCH=current RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,gpg,img ROOTFS_TYPE=ext4 EXTRAWIFI=no CARD_DEVICE=/dev/sdb 

 

And it worked fine. Then I changed the filesystem to BTRFS and did

 

/root/build/compile.sh BOARD=orangepi-r1 BRANCH=current RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,gpg,img ROOTFS_TYPE=btrfs EXTRAWIFI=no CARD_DEVICE=/dev/sdb 

 

and got the following errors:

 

    sed: couldn't write 19 items to /etc/sed5LHzVg: No space left on device
    groupadd: /etc/group.2144: No space left on device
    touch: cannot touch '/home/renan/.Xauthority': No such file or directory

 

Am I missing any extra configuration for BTRFS?

Link to comment
Share on other sites

1 hour ago, Renan said:

Am I missing any extra configuration for BTRFS?

 

Have you made all round internet research if there is perhaps some bug in BTRFS with kernel 5.10.y? Try at least some BTRFS image with older kernel (change BRANCH=current to BRANCH=legacy) to narrow the problem down.

 

1 hour ago, Renan said:

and got the following errors:

 

This tells very little. There is output/debug folder for some more data ... did you use recommended host setup? Did you study https://docs.armbian.com/Developer-Guide_Build-Preparation/

Link to comment
Share on other sites

Hi,
I suspected the error I was getting, No space left on the device, had to do with the root file system. A quick check with df -H:

 

root@orangepi-r1:~# df -H
Filesystem      Size  Used Avail Use% Mounted on
udev             92M     0   92M   0% /dev
tmpfs            25M  1.7M   24M   7% /run
/dev/mmcblk0p2  336M  292M     0 100% /
tmpfs           125M     0  125M   0% /dev/shm
tmpfs           5.3M     0  5.3M   0% /run/lock
tmpfs           125M     0  125M   0% /sys/fs/cgroup
tmpfs           125M  4.1k  125M   1% /tmp
/dev/mmcblk0p1  244M   39M  194M  17% /boot
/dev/zram1       51M  771k   47M   2% /var/log
tmpfs            25M     0   25M   0% /run/user/0

 

Then, I proceeded with a new build with

 

/root/build/compile.sh BOARD=orangepi-r1 BRANCH=current RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,gpg,img ROOTFS_TYPE=btrfs EXTRAWIFI=no CARD_DEVICE=/dev/sdb FIXED_IMAGE_SIZE=15000

 

and df -H

 

root@orangepi-r1:~# df -H
Filesystem      Size  Used Avail Use% Mounted on
udev             92M     0   92M   0% /dev
tmpfs            25M  1.7M   24M   7% /run
/dev/mmcblk0p2   16G  240M   15G   2% /
tmpfs           125M     0  125M   0% /dev/shm
tmpfs           5.3M     0  5.3M   0% /run/lock
tmpfs           125M     0  125M   0% /sys/fs/cgroup
tmpfs           125M  4.1k  125M   1% /tmp
/dev/mmcblk0p1  244M   39M  194M  17% /boot
/dev/zram1       51M  791k   47M   2% /var/log
tmpfs            25M     0   25M   0% /run/user/0

 

This time it worked perfectly. 

My take is that rootfs is not being resized during the first boot when building an image with BTFRS filesystem.

Link to comment
Share on other sites

1 hour ago, Renan said:

My take is that rootfs is not being resized during the first boot when building an image with BTFRS filesystem.


Could be broken ... don't know.  Check here:
https://github.com/armbian/build/blob/master/packages/bsp/common/usr/lib/armbian/armbian-resize-filesystem

 

Probably initial image size need to be set higher since resize can fail if image is filled up to 100%.
https://github.com/armbian/build/blob/master/lib/debootstrap.sh#L399-L406

unless you were adding some packages on top?

Link to comment
Share on other sites

After checking, /var/log/armbian-hardware-monitor.log 

I detected btrfs did not exist in my build. I went back to lib/configuration.sh and saw btrfs-progs package was not installed if BUILD_MINIMAL = YES. 

 

if [[ "$BUILD_MINIMAL" != "yes"  ]]; then
    # Essential packages
    PACKAGE_LIST="$PACKAGE_LIST bridge-utils build-essential fbset \
        iw wpasupplicant sudo linux-base crda \
        wireless-regdb unattended-upgrades \
        console-setup unicode-data initramfs-tools \
        ca-certificates expect iptables automake html2text \
        bison flex libwrap0-dev libssl-dev libnl-3-dev libnl-genl-3-dev keyboard-configuration"


    # Non-essential packages
    PACKAGE_LIST_ADDITIONAL="$PACKAGE_LIST_ADDITIONAL alsa-utils btrfs-progs dosfstools iotop stress screen \
        ntfs-3g vim pciutils evtest pv libfuse2 libdigest-sha-perl \
        libproc-processtable-perl aptitude dnsutils f3 haveged hdparm rfkill vlan bash-completion \
        hostapd git ethtool unzip ifenslave libpam-systemd iperf3 \
        software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping qrencode sunxi-tools"
fi

 

I changed then this from

 

PACKAGE_LIST="bc cpufrequtils device-tree-compiler fping fake-hwclock psmisc chrony parted dialog \
        ncurses-term sysfsutils toilet figlet u-boot-tools usbutils openssh-server \
        nocache debconf-utils python3-apt"

 

to

 

PACKAGE_LIST="bc btrfs-progs cpufrequtils device-tree-compiler fping fake-hwclock psmisc chrony parted dialog \
        ncurses-term sysfsutils toilet figlet u-boot-tools usbutils openssh-server \
        nocache debconf-utils python3-apt"

 

And now it works. I suppose btrfs-progs needs to be added to PACKAGE_LIST (or DEBOOTSTRAP_LIST?) only in the case ROOTFS_TYPE=btrfs and irrespectively of BUILD_MINIMAL.

Link to comment
Share on other sites

11 hours ago, Renan said:

And now it works. I suppose btrfs-progs needs to be added to PACKAGE_LIST (or DEBOOTSTRAP_LIST?) only in the case ROOTFS_TYPE=btrfs and irrespectively of BUILD_MINIMAL.


Great find! I didn't notice MINIMAL before ... welcome to send a PR. 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines