Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Swap on iSCSI -- wrong information in wiki
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
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 942
Location: Queensland

PostPosted: Thu Aug 13, 2020 12:06 pm    Post subject: Swap on iSCSI -- wrong information in wiki Reply with quote

Hello, I've followed the instructions at https://wiki.gentoo.org/wiki/ISCSI/Initiator and they all work except for the last step

iscsiadm -m node -T iqn.2004-04.com.<targethost>:<targetname> [-p <ip[:port]>] -o update -n node.startup -v automatic

which is supposed to make the connection persistent (I think). It doesn't work. On reboot, the connection is lost and has to be re-established with

iscsiadm -m node -T iqn.2004-04.com.<targethost>:<targetname> [-p <ip[:port]>] -l

What's the correct way of making the connection persist?
_________________
Michael Mounteney


Last edited by mounty1 on Fri Aug 14, 2020 2:37 am; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3950

PostPosted: Thu Aug 13, 2020 4:43 pm    Post subject: Reply with quote

Hi maybe enabling "iscsid"?
Code:

rc-update add iscsid default

Failing that maybe you can use a cronjob...
The iscsi volume should look like a block device in your client machine.
Something like
Code:

/dev/sdxx

In that disk you should create a partition format it as swap and create an entry like this in /etc/fstab
Code:

/dev/sdxx   none   swap    defaults,_netdev 0 0       

Also remember to have REISUB enabled in your client machine because sometimes it may hang @shutdown if not properly loged out.
If not syncronized still then maybe comment out the fstab entry and create a script to connect to the target and to activate the swap @boot
Something like
Code:

while ! iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login
do sleep 1
done
swapon /dev/sdxx


and run it via cron.
:D
Back to top
View user's profile Send private message
mounty1
l33t
l33t


Joined: 06 Jul 2006
Posts: 942
Location: Queensland

PostPosted: Thu Aug 13, 2020 7:53 pm    Post subject: Reply with quote

alamahant wrote:
Hi maybe enabling "iscsid"?
Code:

rc-update add iscsid default
Already ran
Code:
systemctl enable iscsid
and it's running.
alamahant wrote:
Failing that maybe you can use a cronjob...

I want to know why it's failing, not bodge a workaround.
alamahant wrote:
The iscsi volume should look like a block device in your client machine.[...]
and run it via cron.
:D

Yep, thanks, I'm already doing all that, except that I reference the partition by UUID. The block device is not created on startup.
_________________
Michael Mounteney
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