4

I want to mount the subvolume in a different directory on the @ subvolume... should be possible or did I miss something?

# btrfs subvolume create /foo 
# mkdir -p /mnt/storage1/foo 
# mount -t btrfs -o subvol=foo /dev/sda2 /mnt/storage1/foo 
mount: No such file or directory

I'm running stock Ubuntu 14.04.2

# btrfs subvol list /
ID 257 gen 1489 top level 5 path @
ID 258 gen 1473 top level 5 path @home
ID 2784 gen 1474 top level 257 path foo

fstab:

/dev/sda2 /     btrfs  defaults,subvol=@ 0 1
/dev/sda2 /home btrfs  defaults,subvol=@home 0 0
# that's not working 
/dev/sda2 /mnt/storage/foo btrfs defaults,subvol=foo 0 0 

Edit: Looks like a bug - this works:

mount -t btrfs -o subvolid=2786 /dev/sda2 /mnt/storage1/foo

Maybe it's related to this? http://comments.gmane.org/gmane.comp.file-systems.btrfs/29167

1

Since you did btrfs subvolume create /foo, then presumably the subvolume is actually located at @/foo in the filesystem (since subvolume @ is usually mounted at / by convention). So your mount should instead be:

mount -t btrfs -o subvol=@/foo /dev/sda2 /mnt/storage1/foo

And you fstab should read:

/dev/sda2 /mnt/storage1/foo btrfs defaults,subvol=@/foo 0 0

The btrfs Wiki has more info about subvolume layout, which might be helpful for understanding.

0

Your path in fstab is /mnt/storage/foo when it should be /mnt/storage1/foo

  • It was a spelling mistake, fixed that. – mt_ Apr 10 '15 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.