SSD not mounted at startup: block mount fails, manually mounting works


I have an SDD available at /dev/sda. It’s shown by block:

# block info
/dev/mmcblk0p1: UUID="5ddcd8b8-13d4-4ed3-ae9b-b4dc28a01478" NAME="UUID_SUB" TYPE="btrfs"
/dev/sda: UUID="a2486c0e-f475-4d10-91bc-716b9e0178e8" NAME="UUID_SUB" TYPE="btrfs"

Mounting by block mount doesn’t work, giving a “no error information” message:

# block mount
block: /dev/mmcblk0p1 is already mounted
block: mounting /dev/sda (btrfs) as /mnt/data failed (-1) - No error information

So, the drive is not mounted at startup (which is especially annoying because other services rely on information on this mount point).

However, it can be mounted manually:

# mount /dev/sda /mnt/data/
# ls -l /mnt/data/
drwxr-xr-x    1 nobody   root           236 Jul 18 23:52 download
drwxr-xr-x    1 tor      tor              4 May  3 00:29 tor

Any idea why manually mounting works, but block mount does not?

From openwrt wiki:
block info cannot detect btrfs (added r43868), xfs , jfs, ntfs, exfat, and some other FS. Use manual scripting to mount them.

My script /etc/init.d/mount_btrfs

#!/bin/sh /etc/rc.common

# /etc/init.d/


start() {
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=261,commit=5 /dev/sda /home
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=317,commit=5 /dev/sda /home/jschw/documents
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=290,commit=5 /dev/sda /home/jschw/downloads
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=318,commit=5 /dev/sda /home/jschw/music
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=319,commit=5 /dev/sda /home/jschw/pictures
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=320,commit=5 /dev/sda /home/jschw/videos
        /usr/bin/mount -t btrfs -o compress=lzo,noatime,autodefrag,subvolid=262,commit=5 /dev/sda /srv/lxc
        /usr/bin/mount -t none -o bind /home/jschw/downloads /srv/smb/downloads
        /usr/bin/mount -t none -o bind /home/jschw/documents /srv/smb/documents
        /usr/bin/mount -t none -o bind /home/jschw/music /srv/smb/music
        /usr/bin/mount -t none -o bind /home/jschw/pictures /srv/smb/pictures
        /usr/bin/mount -t none -o bind /home/jschw/videos /srv/smb/videos

stop() {
        /usr/bin/umount /srv/smb/videos
        /usr/bin/umount /srv/smb/pictures
        /usr/bin/umount /srv/smb/music
        /usr/bin/umount /srv/smb/documents
        /usr/bin/umount /srv/smb/downloads
        /usr/bin/umount /srv/lxc
        /usr/bin/umount /home/jschw/videos
        /usr/bin/umount /home/jschw/pictures
        /usr/bin/umount /home/jschw/music
        /usr/bin/umount /home/jschw/downloads
        /usr/bin/umount /home/jschw/documents
        /usr/bin/umount /home

Thanks for the quick reply!

I have re-formatted the file system to Ext4 and now it works with block mount and at startup.

The mentioned Changeset 43868 is from 2015. Shouldn’t it fix this problem? Also, the Wiki page says “block info cannot detect”, but my block info has detected the btrfs correctly (see original post). Only block mount didn’t work.

I don’t know whether this is “working as intended” and btrfs/xfs/etc. are just not supported for automatical mounting, or whether this is some bug or to-do. Do you think it should be reported somewhere?

Block mount is working for just one btrfs volume. It’s not working for subvolumes on one device. I don’t know if we should report it.