I am fairly new to FreeBSD having made the switch based on a really good experience breathing new life into an Xserve G4 with FreeBSD 10.2. So, I decided to switch out from CentOS Linux to FreeBSD on my dev server.
I was able to get everything up and running with no problem. I followed the instructions in the Handbook to the letter. My problem comes into play during a reboot - my iSCSI mount points fail but it seems to be a timing error. Apparently, iSCSI hasn't created the devices for which I can mount to.
In my /etc/fstab, I have the following:
If I issue the command:
The device mounts and I can access the share with no problem.
When I reboot, the boot sequence stops and I get the error:
All I do is press RETURN to enter the shell, type
Ok...so I have determined that the iSCSI initiator is not creating the device before fstab gets parsed even though I have the "late" option specified.
What I did....
While this works, I am positive this is not the right way to do this. Is there a proper way to get iSCSI devices mounted so that they are persistent across reboots?
I was able to get everything up and running with no problem. I followed the instructions in the Handbook to the letter. My problem comes into play during a reboot - my iSCSI mount points fail but it seems to be a timing error. Apparently, iSCSI hasn't created the devices for which I can mount to.
In my /etc/fstab, I have the following:
Code:
# iSCSI Mounts
/dev/da0p1 /mnt/web ufs rw,late 3 3
If I issue the command:
#mount -a -l
The device mounts and I can access the share with no problem.
When I reboot, the boot sequence stops and I get the error:
Code:
Cant stat /dev/da0p1: No such file or directory
THE FOLLOWING FILE SYSTEM HAD AN UNEXPECTED INCONSISTENCY:
ufs: /dev/da0p1 (/mnt/web)
Unknown error; help!
ERROR: ABORTING BOOT (sending SIGTERM to parent)
Feb 21 09:49:00 init: /bin/sh on /etc/rc terminated abnormally, going to single user mode
Enter full pathname of shell or RETURN for /bin/sh:
All I do is press RETURN to enter the shell, type
exit
press RETURN again and this it continues to boot. I can see that my iscsi device then gets created (it's da0), some services get loaded and I am at the login prompt. When I login and check, all mounts are where they are supposed to be.Ok...so I have determined that the iSCSI initiator is not creating the device before fstab gets parsed even though I have the "late" option specified.
What I did....
- I commented out the line in question in /etc/fstab
- I created a /etc/fstab-iscsi file with that same line
- I then modified my /etc/rc.d/mountlate to wait 5 seconds then mount the file
Code:
mountlate_start()
{
local err latefs
# Mount "late" filesystems.
#
err=0
echo -n 'Sleeping for iSCSI to load'
sleep 5 <------Wait 5 seconds
echo -n 'Mounting late file systems:'
mount -a -L -F /etc/fstab-iscsi <------Mount fstab-iscsi
err=$?
echo '.'
While this works, I am positive this is not the right way to do this. Is there a proper way to get iSCSI devices mounted so that they are persistent across reboots?
Last edited by a moderator: