Solved iscsi automatic mount at boot

Hi, I've been playing with this for a while now. But can't seem to figur it out.

fstab:
Code:
# Device                Mountpoint      FStype  Options                         Dump    Pass#
/dev/vtbd0p2            /               ufs     rw                              1       1
/dev/vtbd0p3.eli        none            swap    sw,keylen=256                   0       0
/dev/da0p1.eli          /iscsi/test     ufs     rw,late,failok                  0       0
rc.conf
Code:
iscsictl_enable="yes"
iscsictl_flags="-Aa -w10"
iscsid_enable="yes"

But for some reason sometimes iscsi doesn't connect, when it connects it says that it can't find da0p1.eli, .. I guess I need to enable the network interface at/during boot only can't find any documentation on how to to this.
 
I guess I need to enable the network interface at/during boot only can't find any documentation on how to to this.
The order of things is governed by various markers in the rc(8) scripts. You can't change that order without modifying the rc(8) scripts. Look at the output from rcorder /etc/rc.d/* /usr/local/etc/rc.d/*. That will tell you in what order the rc(8) scripts are executed.

I suspect the iSCSI services are started before the mountlate script. So iSCSI starts before the filesystem has been mounted.
 
Euhm but I guess that's a good thing, ... the device needs to be present before it can be mounted so iscsi needs to start before it is mounted?

But thank you for pointing me in the right direction:

Code:
  Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp.
Starting iscsid.
Starting iscsictl.
da0 at iscsi1 bus 0 scbus0 target 0 lun 0
da0: <FreeNAS iSCSI Disk 0123> Fixed Direct Access SPC-5 SCSI device
da0: Serial Number 589cfc0fb13f00
da0: 150.000MB/s transfers
da0: Command Queueing enabled
da0: 20480MB (5242884 4096 byte sectors)
Updating motd:.
Configuring Disk Encryption for da0p1.
Enter passphrase:
GEOM_ELI: Device da0p1.eli created.
GEOM_ELI: Encryption: AES-XTS 256
GEOM_ELI:     Crypto: hardware
Mounting late filesystems:.

Due to rcorder I figured out what to do, I've added to mountlate /etc/rc.d/geli start

Code:
mountlate_start()
{
        local err latefs
        /etc/rc.d/geli start
        # Mount "late" filesystems.
        #
        err=0
        echo -n 'Mounting late filesystems:'
        mount -a -L
        err=$?
        echo '.'
 
Back
Top