Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounting an iSCSI disk at boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
FatherBusa
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 143
Location: Lincoln, NE

PostPosted: Wed Jul 25, 2012 5:17 pm    Post subject: Mounting an iSCSI disk at boot Reply with quote

After much pain and suffering, I've managed to get iSCSI runnning.

However, I just can't seem to get the disks to automatically mount at boot. I've read lots of different posts on this, and it seems like the right way to do this is fairly distro-specific, and I can't find any discussion of it with Gentoo.

I've tried adding a line to fstab (and played around with _netdev). I've also tried adding mount and umount lines directly to the iscsid init script, but no luck.

Anyone got this working?
_________________
I have found a language that is as fast as C.
Back to top
View user's profile Send private message
mwoodiupui
n00b
n00b


Joined: 13 Oct 2004
Posts: 37
Location: Indianapolis, IN, USA

PostPosted: Mon Oct 15, 2012 6:35 pm    Post subject: Reply with quote

Me, too!

I think it's going to need a mount script of its own. The thing about iSCSI is that starting it is like hotplugging a disk drive (or thousands of 'em). It's not like NFS or CIFS where the medium implies a distinct filesystem type; instead, new devices come into being, containing anything a disk could hold: they may be partitioned, or contain LVM PVs with LVs mapped into them, with each partition or LV containing ext2/3/4, reiserfs, xfs, FAT or NTFS -- you name it. And it could all be sitting on multipath. Yikes!

So, first you get iSCSI started and logged on, then something has to notice this and (possibly) mount the new devices as if they were local disks. Something like 'mount -a -O no_netdev'.

Come to think of it, hotplugging is the way to think about this. We need the right udev rules to trigger a new 'mount -a' when new SCSI devices appear. (Also 'vgchange -ay', etc.)
Back to top
View user's profile Send private message
mwoodiupui
n00b
n00b


Joined: 13 Oct 2004
Posts: 37
Location: Indianapolis, IN, USA

PostPosted: Fri May 10, 2013 1:18 pm    Post subject: This seems to work Reply with quote

I've cobbled together an /etc/init.d/san startup script:
Code:
#! /sbin/runscript
# Copyright 2013 Indiana University
# Mark H. Wood, IUPUI University Library, 03-May-2013

description="Prepare SAN volumes for mounting."

depend()
{
        need    net
        use     multipath lvm
}

start()
{
        ebegin "Prepare SAN volumes for mounting"
        if [ -x /sbin/multipath ]; then
                multipath >/dev/null
        fi

        if [ -x /sbin/vgchange ]; then
                vgchange -a y >/dev/null
        fi

        mount -a -O _netdev -t no${net_fs_list}

        eend $? "Some SAN volumes may be unavailable"
}

#stop()
#{
#       # Nothing to do
#}


It seems to do what I want, if I mark all of the SAN volumes with the _netdev option.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum