All of lore.kernel.org
 help / color / mirror / Atom feed
* subvolumes as partitions and mount options
@ 2023-03-27 18:48 Matt Zagrabelny
  2023-03-27 19:25 ` Andrei Borzenkov
  0 siblings, 1 reply; 9+ messages in thread
From: Matt Zagrabelny @ 2023-03-27 18:48 UTC (permalink / raw)
  To: Btrfs BTRFS

Greetings,

I have a root partition btrfs file system.

I need to have /tmp, /var, /var/tmp, /var/log, and other directories
under separate partitions so that certain mount options can be set for
those partitions/directories.

I'm testing out a subvolume mount with the subvolume /subv_content
mounted at /subv_mnt.

For instance, the noexec mount option can be circumvented:
root@ziti:/# findmnt --kernel /subv_mnt
TARGET    SOURCE                                FSTYPE OPTIONS
/subv_mnt /dev/nvme0n1p2[/@rootfs/subv_content] btrfs
rw,nosuid,nodev,noexec,relatime,ssd,space_cache=v2,subvolid=257,subvol=/@rootfs/subv_content

root@ziti:/# echo '#!/usr/bin/bash' > /subv_mnt/foo ; echo 'echo foo'
>> /subv_mnt/foo ; chmod 0755 /subv_mnt/foo
root@ziti:/# /subv_mnt/foo
bash: /subv_mnt/foo: Permission denied
root@ziti:/# /subv_content/foo
foo
root@ziti:/#

Am I missing some mechanism to restrict subvolume with mount options
that cannot be worked around by accessing the files in the subvolume
as opposed to the mount point?

Thanks for any help!

-m

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-29  4:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 18:48 subvolumes as partitions and mount options Matt Zagrabelny
2023-03-27 19:25 ` Andrei Borzenkov
2023-03-27 19:50   ` Matt Zagrabelny
2023-03-27 20:24     ` Graham Cobb
2023-03-27 20:31     ` Matthew Warren
2023-03-27 21:06       ` Matt Zagrabelny
2023-03-28  1:42         ` Matthew Warren
2023-03-28 19:45           ` Matt Zagrabelny
2023-03-29  4:04             ` Andrei Borzenkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.