Mount LVM from Linux Mint in jail

Status
Not open for further replies.

zml71

Cadet
Joined
Jan 10, 2018
Messages
3
Hello I would like to mount lvm volume from linux mint in my jail with ports. I have already made some steps but i need help now.

Code:
root@LVMtest:/ # uname -a
FreeBSD LVMtest 10.3-STABLE FreeBSD 10.3-STABLE #0 r295946+21897e6695f(HEAD): Tue Jul 25 00:03:12 UTC 2017	 root@gauntlet:/freenas-9.10-releng/_BE/objs/freenas-9.10-releng/_BE/os/sys/FreeNAS.amd64  amd64


I try to mount it with so bad result:

Code:
root@LVMtest:/ # fuse-ext2 /dev/linux_lvm/mint-vg-root /cinnamon -o default_permissions
Mounting /dev/linux_lvm/mint-vg-root Read-Only.
Use 'force' or 'rw+' options to enable Read-Write mode
mount_fusefs: /dev/fuse on /cinnamon: Operation not permitted
fuse: failed to mount file system: No such file or directory


so what i check

Modules are there

Code:
root@LVMtest:/ # kldstat
Id Refs Address			Size	 Name
 1   84 0xffffffff80200000 1903000  kernel
 2	1 0xffffffff81de6000 ffd7c	ispfw.ko
 3	1 0xffffffff82021000 10676	geom_mirror.ko
 4	1 0xffffffff82032000 4682	 geom_stripe.ko
 5	1 0xffffffff82037000 ffbd	 geom_raid3.ko
 6	1 0xffffffff82047000 ec6a	 geom_raid5.ko
 7	1 0xffffffff82056000 5752	 geom_gate.ko
 8	1 0xffffffff8205c000 4a2c	 geom_multipath.ko
 9	1 0xffffffff82061000 571a	 fdescfs.ko
10	1 0xffffffff82067000 892	  dtraceall.ko
11   10 0xffffffff82068000 3acf8	dtrace.ko
12	1 0xffffffff820a3000 4660	 dtmalloc.ko
13	1 0xffffffff820a8000 224f	 dtnfscl.ko
14	1 0xffffffff820ab000 63fd	 fbt.ko
15	1 0xffffffff820b2000 5799a	fasttrap.ko
16	1 0xffffffff8210a000 49f0	 lockstat.ko
17	1 0xffffffff8210f000 1620	 sdt.ko
18	1 0xffffffff82111000 d8f2	 systrace.ko
19	1 0xffffffff8211f000 d4b1	 systrace_freebsd32.ko
20	1 0xffffffff8212d000 4dc6	 profile.ko
21	1 0xffffffff82132000 7f73	 ipmi.ko
22	1 0xffffffff8213a000 ec0	  smbus.ko
23	1 0xffffffff8213b000 1a632	hwpmc.ko
24	1 0xffffffff82156000 c28a	 t3_tom.ko
25	2 0xffffffff82163000 42c7	 toecore.ko
26	1 0xffffffff82168000 12afb	t4_tom.ko
27	2 0xffffffff8217b000 2b82	 vboxnetflt.ko
28	2 0xffffffff8217e000 4e416	vboxdrv.ko
29	1 0xffffffff821cd000 41d7	 ng_ether.ko
30	1 0xffffffff821d2000 3fd4	 vboxnetadp.ko
31	1 0xffffffff821d6000 5389	 geom_linux_lvm.ko
32	1 0xffffffff821dc000 de7a	 fuse.ko


LVM IS SEEN IN JAIL

Code:
root@LVMtest:/ # geom linux_lvm list
Geom name: mint-vg
Providers:
1. Name: linux_lvm/mint-vg-swap_1
   Mediasize: 7511998464 (7.0G)
   Sectorsize: 512
   Mode: r0w0e0
2. Name: linux_lvm/mint-vg-root
   Mediasize: 992384909312 (924G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ada1s5
   Mediasize: 999946190848 (931G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 256901120
   Mode: r0w0e0


RIGHTS LOOKS FINE

Code:
root@LVMtest:/ # ls -la /dev/ada1s5
crw-r-----  1 root  operator  0xc4 Dec 28 01:07 /dev/ada1s5
root@LVMtest:/ # ls -la /dev/linux_lvm/
total 1
dr-xr-xr-x   2 root  wheel	  512 Jan 10 01:27 .
dr-xr-xr-x  12 root  wheel	  512 Jan 10 01:27 ..
crw-r-----   1 root  operator  0xdd Dec 28 01:07 mint-vg-root
crw-r-----   1 root  operator  0xdc Dec 28 01:07 mint-vg-swap_1

root@LVMtest:/ # ls -la /dev/fuse
crw-rw----  1 root  operator  0xc5 Dec 28 11:09 /dev/fuse



POSSIBLE PROBLEMS ARE
1. FUSE NOT MARKED AS JAIL FRIENDLY
Code:
root@LVMtest:/ # lsvfs
Filesystem							  Num  Refs  Flags
-------------------------------- ---------- -----  ---------------
procfs						   0x00000002	 4  synthetic, jail
cd9660						   0x000000bd	 0  read-only
ufs							  0x00000035	 0
unionfs						  0x00000041	 0  loopback
devfs							0x00000071	 5  synthetic, jail
msdosfs						  0x00000032	 0
tmpfs							0x00000087	 3  jail
nfs							  0x0000003a	 0  network
zfs							  0x000000de	23  jail, delegated-administration
nullfs						   0x00000029	 7  loopback, jail
fdescfs						  0x00000059	 1  synthetic, jail
fusefs						   0x000000ed	 0  synthetic


2. syctl does not change jail settings, global seting for jail mount is 1... in jail 0

Code:
root@LVMtest:/ # sysctl security.jail.mount_allowed
security.jail.mount_allowed: 0
root@LVMtest:/ # sysctl security.jail.mount_allowed=1
security.jail.mount_allowed: 0
sysctl: security.jail.mount_allowed=1: Operation not permitted


i tried to do it from gui but when i add line about moung jail do not start

Code:
allow.raw_sockets=1,sysvipc_allowed=1,security.jail.mount_allowed=1

or other version
Code:
allow.raw_sockets=1,sysvipc_allowed=1,mount_allowed=1


ANY IDEAS WHAT TO DO :) ??
 
Last edited by a moderator:

zml71

Cadet
Joined
Jan 10, 2018
Messages
3
hmmm so many people read nobody answer... at least just tell me "skip it it is not possible"
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,681
It may be possible, but that doesn't mean lots of people are hacking on things this way.

Most of the users here probably don't have the experience with FreeBSD to do this kind of hacking. I do, but I'd never do that, mostly because it's pointless in this era of easy network connectivity. You've accomplished the things I'd expect you to need to do, I don't remember enough about FUSE to know if it's supposed to be able to do this on FreeBSD, so you're probably headed in the right direction. That light at the end of the tunnel might be success, or a freight train. Don't know which, but good job so far.
 

zml71

Cadet
Joined
Jan 10, 2018
Messages
3
i will probably be forced to buy usb3 to sata for my laptop and mount it under cinamon mint :)
 
Status
Not open for further replies.
Top