Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502376 - sys-apps/util-linux-2.22.2: issue with mount and btrfs subvolumes
Summary: sys-apps/util-linux-2.22.2: issue with mount and btrfs subvolumes
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-25 04:41 UTC by Dylan
Modified: 2023-07-13 08:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dylan 2014-02-25 04:41:03 UTC
localmount does not take into account a btrfs subvol when attempting to mount at boot, saying that a partition is already mounted or the target directory is busy.

Reproducible: Always

Steps to Reproduce:
1. format disk to btrfs
2. mount disk and create two subvols, gentoo and home
3. btrfs su set-default (id of gentoo subvol) /
4. umount, remount disk, mkdir home, mount the home subvol
5. install gentoo into gentoo subvol
6. put these lines in /etc/fstab:
/dev/sdb / btrfs noatime 0 0
/dev/sdb /home btrfs defaults,noatime,subvol=home 0 0
7. boot into new gentoo setup. 
Actual Results:  
On booting into the new gentoo setup, localmount will not mount /home, saying:
mount: /dev/sdb is already mounted or /home busy
       /dev/sdb is already mounted on /

But mounting /home manually with 'mount /home' after booting works fine.

Expected Results:  
Expecting localmount to mount /home without complaining.

btrfs su li / :
ID 257 gen 1578 top level 5 path home
ID 258 gen 1625 top level 5 path gentoo
ID 267 gen 1165 top level 5 path snapshots/GentoobareSystem21022014

fstab:
/dev/sdb	/	btrfs	noatime		0 0
/dev/sdb	/home	btrfs	defaults,noatime,subvol=home	0 0

mounts after unsucessful boot:
rootfs on / type rootfs (rw)
/dev/sdb on / type btrfs (rw,noatime,noacl,space_cache)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,size=610456k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=762677,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
shm on /tmp type tmpfs (rw,nosuid,nodev,noexec,relatime)

mounts after mounting /home manually, same as above except with:
/dev/sdb on /home type btrfs (rw,noatime,subvol=home)


Portage 2.2.7 (default/linux/amd64/13.0/no-multilib, gcc-4.7.3, glibc-2.17, 3.13.3-gentoo x86_64)
=================================================================
System uname: Linux-3.13.3-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9505_@_2.83GHz-with-gentoo-2.2
KiB Mem:     6104536 total,   5990668 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Tue, 25 Feb 2014 02:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=core2 -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=core2 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="X acpi alsa amd64 apng ass bzip2 cli consolekit corefonts cpudetection cups dbus dri exif gdbm joystick jpeg minimal mmx mmxext modules nonfsv4 nptl opengl openmp pdf png policykit readline session smp sse sse2 sse3 ssl ssse3 svg thunar tiff truetype udev vaapi win64 x264 zlib" ABI_X86="64" ALSA_CARDS="hda-intel" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby18" SANE_BACKENDS="epson2 net" USERLAND="GNU" VIDEO_CARDS="radeon modesetting"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Dylan 2014-02-25 06:55:12 UTC
Solution presented here does not solve.
http://comments.gmane.org/gmane.comp.file-systems.btrfs/17517
Comment 2 William Hubbs gentoo-dev 2014-02-25 17:51:28 UTC
@base-system:
This looks to me more like an issue with util-linux than OpenRc. Can you
please advise me on this? Is there something I can do within OpenRc, or
is it an issue with mount?
Comment 3 Dylan 2014-02-25 19:53:27 UTC
From reading the source (mount.c in util-linux-2.22.2), I can confirm it seems there's an EBUSY error in mount(8) that seems to be triggered by mount(2). 
I added a line to mount.c:
                warnx(_("%s is already mounted or %s busy"), src, tgt);
+               warnx(_("mount options: %s"),mnt_context_get_options(cxt));

and this does show that the subvol=(etc) is being passed along.
Comment 4 William Hubbs gentoo-dev 2014-07-09 13:51:14 UTC
This was originally assigned to OpenRC as an issue in localmount.
However, as shown in the bug, it was confirmed to be an issue with mount.

A newer version of util-linux is being stabilized, so you might want to
check and see if this is still an issue.

Thanks,

William