3

So I've made a btrfs filesystem that spans across one logical drive (md1) and a USB drive. its all raid 0. so that:

sata\
      md1--\
sata/        \  
               btrfs called "Storage"
usb---------/

I've put a line in fstab using UUID=

UUID=2cf6d402-7279-4bdd-b0f8-6931c5db9fe1 /media/<user>/Storage auto x-gvfs-show 0 0

When I mount it via command line ie sudo mount -a everything mounts normally and the only mount point is /media/user/Storage

However, if I reboot it mounts twice for some reason. I get one at /m/u/Storage and another at /m/u/Storage1.

I've noticed this has something to do with the label because before it used to mount at /m/u/btrfs and /mnt/Storage, only the latter of which was in my /etc/fstab.

has me scratching my head. PS, ubuntu mini iso installation with mate-desktop-minimal, 18.04 lts. normal kernel fresh install all packages up to date. I'm making a nas

EDIT: I've commented out the fstab and rebooted. The filesystem still mounts at /media/user/Storage. Is this normal BTRFS behavior in ubuntu? And can it be switched off? I wouldn't mind this if I could change its mountpoint; I don't want it in the user directory.

4
  • Are you logged in with some graphical desktop? Perhaps that's mounting the filesystem. Try booting into a text mode only environment and then logging in as root and checking the mounts then.
    – wurtel
    Commented Jan 30, 2019 at 15:33
  • i am using a gui, mate. is there a way i can make mate not mount btrfs at boot? Commented Mar 9, 2019 at 11:07
  • 1
    I don't think that this second mount has anything to do with BTRFS. It's probably an auto-mounter (udisks2?) that mounts your USB drive.
    – Kusalananda
    Commented Mar 9, 2019 at 11:26
  • ok so i need to figure out how to exclude a specific device from udisks2. i can manage that i think. thanks Commented Mar 10, 2019 at 0:01

1 Answer 1

0

A little late, but I just encountered similar behaviour which was not only annoying but also seemed to be causing disk i/o to slow to a crawl on my btrfs raid10 external drive. The interaction between btrfs and automount is not great; I would also see mounts accumulate up to Storage10 the device never disconnected, but the system would keep remounting it (I have a hypothesis at the end of this answer).

Anyway, I solved this by disabling automount. This only applies to desktop environments, ubuntu server does not automount drives so this is not an issue on server where there is no gnome or nautilus running.

To disable automount in ubuntu 22.04 Desktop you can run:

dconf write /org/gnome/desktop/media-handling/automount false
dconf write /org/gnome/desktop/media-handling/automount-open false

The second line seems to be optional but the general recommendation from other pages seems to be to disable both (and I generally agree it looks silly to see the automount-open feature enabled when automount is disabled).

This is an all-or-nothing setting so it also disables automount for normal usb drives and sd cards that are not btrfs raid and would not have this issue. Not a huge deal for me, it's a single click in nautilus to mount any visible drive. But if someone knows a better or more targeted solution I would be curious to learn.

I believe this has something to do with how btrfs handles raid. With btrfs when you raid 2 devices you can mount either one to your host and btrfs will automagically handle the raid across all devices under the covers. I think this confuses the automount logic which sees an unused device and keeps trying to mount it. That is just a guess though. Either way, disabling auto mount for btrfs raid saved me a major headache.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .