Hi fellows,
works perfectly, but problem is that I still need the same md setup after a reboot as well. Unfortunately the system doesn't remember the mdconfig setup. So I found /etc/rc.d/mdconfig and /etc/rc.d/mdconfig2 and I started to add the following into my rc.conf:
After adding this, I tried [cmd=]/etc/rc.d/mdconfig start[/cmd] and [cmd=]/etc/rc.d/mdconfig2 start[/cmd] but nothing helped, md2 wasn't listed by [cmd=]mdconfig -lv[/cmd] After scanning a bit through the rc.d/mdconfig scripts, I figured it may want to have the actual md_n_ device to start so I tried [cmd=]/etc/rc.d/mdconfig start md2[/cmd] and voila:
But I'm unhappy about the script complaining about fsck and about the mount issue. Fact is, that I do not want to fsck neither mount it since it will be an iSCSI share. Still I could ignore this error since md2 is now listed by [cmd=]mdconfig -lv[/cmd] But then I tried rc.d/mdconfig2 and it doesn't seem to complain about fsck:
But
So what am I doing wrong? My aim is to initialize a simple md device right at system boot in order to let eg. iSCSI (istg) benefit of the md device.
Any hints or ideas?
Code:
truncate -s 1G /mnt/VirtualDisk
chmod 0600 /mnt/VirtualDisk
mdconfig -a -t vnode -f /mnt/VirtualDisk
works perfectly, but problem is that I still need the same md setup after a reboot as well. Unfortunately the system doesn't remember the mdconfig setup. So I found /etc/rc.d/mdconfig and /etc/rc.d/mdconfig2 and I started to add the following into my rc.conf:
Code:
rc_debug="YES"
rc_info="YES"
mdconfig_md2="-t vnode -f /mnt/VirtualDisk"
Code:
FreeBSD [~]# mdconfig -lv
md0 swap 512M
md1 vnode 4096M /var/swap
FreeBSD [~]# /etc/rc.d/mdconfig start md2
/etc/rc.d/mdconfig: DEBUG: run_rc_command: start_precmd: [ -n "${_mdconfig_list}" ]
/etc/rc.d/mdconfig: DEBUG: load_kld: geom_md kernel module already loaded.
/etc/rc.d/mdconfig: DEBUG: run_rc_command: doit: mdconfig_start
/etc/rc.d/mdconfig: DEBUG: md2 config: -t vnode -f /mnt/VirtualDisk
/etc/rc.d/mdconfig: DEBUG: md2 type: vnode
/etc/rc.d/mdconfig: DEBUG: md2 dev: /dev/md2
/etc/rc.d/mdconfig: DEBUG: md2 file: /mnt/VirtualDisk
/etc/rc.d/mdconfig: DEBUG: md2 fs: /
/etc/rc.d/mdconfig: DEBUG: md2 newfs flags:
Creating md2 device (vnode).
/etc/rc.d/mdconfig: DEBUG: checkyesno: background_fsck is set to YES.
fsck: Could not determine filesystem type
Fsck failed on /dev/md2, not mounting the filesystem.
FreeBSD [~]# mdconfig -lv
md0 swap 512M
md1 vnode 4096M /var/swap
md2 vnode 1024M /mnt/VirtualDisk
FreeBSD [~]# mdconfig -du 2
Code:
FreeBSD [~]# /etc/rc.d/mdconfig2 start md2
/etc/rc.d/mdconfig2: DEBUG: run_rc_command: start_precmd: [ -n "${_mdconfig2_list}" ]
/etc/rc.d/mdconfig2: DEBUG: load_kld: geom_md kernel module already loaded.
/etc/rc.d/mdconfig2: DEBUG: run_rc_command: doit: mdconfig2_start
/etc/rc.d/mdconfig2: DEBUG: md2 config: -t vnode -f /mnt/VirtualDisk
/etc/rc.d/mdconfig2: DEBUG: md2 type: vnode
/etc/rc.d/mdconfig2: DEBUG: md2 dev: /dev/md2
/etc/rc.d/mdconfig2: DEBUG: md2 file: /mnt/VirtualDisk
/etc/rc.d/mdconfig2: DEBUG: md2 fs: /
/etc/rc.d/mdconfig2: DEBUG: md2 owner:
/etc/rc.d/mdconfig2: DEBUG: md2 perms:
/etc/rc.d/mdconfig2: DEBUG: md2 files:
/etc/rc.d/mdconfig2: DEBUG: md2 populate cmd:
/etc/rc.d/mdconfig2: DEBUG: checkyesno: _mounted is set to no.
mdconfig -lv
doesn't list it - so it's not configured?So what am I doing wrong? My aim is to initialize a simple md device right at system boot in order to let eg. iSCSI (istg) benefit of the md device.
Any hints or ideas?