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
Apprentice
Apprentice


Joined: 21 Mar 2004
Posts: 166

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?
Back to top
View user's profile Send private message
mwoodiupui
n00b
n00b


Joined: 13 Oct 2004
Posts: 48
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: 48
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
mwoodiupui
n00b
n00b


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

PostPosted: Tue Sep 15, 2015 4:26 pm    Post subject: PING. Is anyone working on mainstreaming iSCSI auto mount? Reply with quote

Near as I can tell, nothing has changed in the intervening years. Unless I missed something?

To whom should I suggest that being able to list iSCSI volumes in fstab for auto mounting would be really desirable and BTW I already have some code to start from?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Wed Sep 16, 2015 6:22 pm    Post subject: Reply with quote

What about
man genkernel wrote:
--[no-]iscsi
Includes or excludes iSCSI support

I'd expect it to do what you want... and a bit more, like allowing root on iSCSI
Back to top
View user's profile Send private message
mwoodiupui
n00b
n00b


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

PostPosted: Fri Sep 18, 2015 8:37 pm    Post subject: Reply with quote

szatox wrote:
What about
man genkernel wrote:
--[no-]iscsi
Includes or excludes iSCSI support

I'd expect it to do what you want... and a bit more, like allowing root on iSCSI


Thanks, my kernels are already built with iSCSI support and it is working. It's the initscripts that are lacking, and it just seems incredible that there wouldn't be any support for mounting iSCSI volumes automatically when userspace is starting, but I can't find any.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Sat Sep 19, 2015 8:16 am    Post subject: Reply with quote

This switch changes init script inside initramfs, it doesn't change kernel options. The whole point was that iSCSI devices behave just like any local disk, once you are connected to them.
Booting from iSCSI (which this switch is supposed to enable) requires that you can mount iSCSI drive before reading fstab.This way once you reach the fstab part, you already have network connection up and initiator running, so I'd expect mount to do it's job regarding iSCSI drives too.
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