Re: Cannot set swap priority to "move" swap on another disk.

2018-08-19 Thread Philip Guenther
On Sun, Aug 19, 2018 at 7:20 PM Philip Guenther  wrote:
...

> If that's correct, then there's no supported way to change it: the
> addition of the swap partition from the boot disk is done by the kernel
> before starting init, in swapmount(), which hardcodes a priority of zero.
>

Correction: you can change it with swapctl -c, so you can invoke that from
rc.local to solve your problem.

If you want to _fix_ it, then I would suggest updating swapctl(8) so that
it's -A option, instead of totally skipping selected swap partitions which
are already mounted, instead updates the priority of them if they don't
match what's in the fstab.


Philip Guenther


Re: Cannot set swap priority to "move" swap on another disk.

2018-08-19 Thread Philip Guenther
On Thu, Aug 16, 2018 at 10:42 PM Eric Huiban  wrote:

> With "6.3 release" version, i'm unable to set swap priority with fstab
> using the following :
>
> 2e04cb867188f137.b none swap sw,priority=0
> e7f9094bf357d407.b none swap sw,priority=1
>
> I get the following result :
>
> $ swapctl
> Device  512-blocks UsedAvail Capacity  Priority
> /dev/sd0b 219416400 21941640 0%0
> /dev/sd1b 625249160 62524916 0%0
> Total 844665560 84466556 0%
>
> Using "swapctl -a -p 1 e7f9094bf357d407.b" present the very same result.
> Same for "swapctl -a -p 1 /dev/sd0b".
> Also tried an hypothetic reboot...
>

You don't actually say it, but if read closely the commands you give
suggest that the swap partition whose priority you want to change is the
one on the *boot disk*.

If that's correct, then there's no supported way to change it: the addition
of the swap partition from the boot disk is done by the kernel before
starting init, in swapmount(), which hardcodes a priority of zero.


Philip Guenther


Re: Cannot set swap priority to "move" swap on another disk.

2018-08-17 Thread Eric Huiban

Solene Rapenne wrote:

Eric Huiban  wrote:

Hello,

With "6.3 release" version, i'm unable to set swap priority with fstab
using the following :

2e04cb867188f137.b none swap sw,priority=0
e7f9094bf357d407.b none swap sw,priority=1

I get the following result :

$ swapctl
Device  512-blocks Used    Avail Capacity  Priority
/dev/sd0b 21941640    0 21941640 0%    0
/dev/sd1b 62524916    0 62524916 0%    0
Total 84466556    0 84466556 0%

Using "swapctl -a -p 1 e7f9094bf357d407.b" present the very same result.
Same for "swapctl -a -p 1 /dev/sd0b".
Also tried an hypothetic reboot...

Do you have an idea on what i missed here ?

Regards,
Eric.

Hello,

I tried on amd64 6.3 and on amd64 -current and I have not been able to
reproduce the issue.

What is the result if you remove your 2 swaps with

 # swapctl -d e7f9094bf357d407.b
 # swapctl -d 2e04cb867188f137.b

and that you type

 # swapctl -A

after this, you should see the priorities correctly assigned after
typing "swapctl".



Hello,

I performed what you just suggested :

Tried to remove the two swaps : OK none remaining
Tried to reload the fstab : OK got priorities 0 and 1
Performed "halt -p" : OK computer dead like a stone
Power on...
Check swapctl : two swaps present with both priority at 0.

There's something i do not master within the boot process.

Note : this host has been freshly reinstalled with wiped out SSD.

Eric.



Re: Cannot set swap priority to "move" swap on another disk.

2018-08-17 Thread Solene Rapenne
Eric Huiban  wrote:
> Hello,
> 
> With "6.3 release" version, i'm unable to set swap priority with fstab 
> using the following :
> 
> 2e04cb867188f137.b none swap sw,priority=0
> e7f9094bf357d407.b none swap sw,priority=1
> 
> I get the following result :
> 
> $ swapctl
> Device  512-blocks Used    Avail Capacity  Priority
> /dev/sd0b 21941640    0 21941640 0%    0
> /dev/sd1b 62524916    0 62524916 0%    0
> Total 84466556    0 84466556 0%
> 
> Using "swapctl -a -p 1 e7f9094bf357d407.b" present the very same result.
> Same for "swapctl -a -p 1 /dev/sd0b".
> Also tried an hypothetic reboot...
> 
> Do you have an idea on what i missed here ?
> 
> Regards,
> Eric.

Hello,

I tried on amd64 6.3 and on amd64 -current and I have not been able to
reproduce the issue.

What is the result if you remove your 2 swaps with 

# swapctl -d e7f9094bf357d407.b
# swapctl -d 2e04cb867188f137.b 

and that you type

# swapctl -A

after this, you should see the priorities correctly assigned after
typing "swapctl".



Cannot set swap priority to "move" swap on another disk.

2018-08-17 Thread Eric Huiban

Hello,

With "6.3 release" version, i'm unable to set swap priority with fstab 
using the following :


2e04cb867188f137.b none swap sw,priority=0
e7f9094bf357d407.b none swap sw,priority=1

I get the following result :

$ swapctl
Device  512-blocks Used    Avail Capacity  Priority
/dev/sd0b 21941640    0 21941640 0%    0
/dev/sd1b 62524916    0 62524916 0%    0
Total 84466556    0 84466556 0%

Using "swapctl -a -p 1 e7f9094bf357d407.b" present the very same result.
Same for "swapctl -a -p 1 /dev/sd0b".
Also tried an hypothetic reboot...

Do you have an idea on what i missed here ?

Regards,
Eric.