Re: [gentoo-user] swaps mounted randomly [not out of the woods yet]

2020-03-18 Thread n952162

Well, some new recognitions ...

It turns out that  those /dev/disk subdirectories don't necessarily have
all the disk devices represented:

1. by-id/
2.   by-partuuid/
3.   by-path/
4.   by-uuid/

On my computer, only by-id/ - the subdirectory that's not set up in time
- has  links to /dev/sda?. Furthermore, by-path/ has even fewer of my
drives represented in it.  I haven't a clue what's going on.  Since my
swap file is on /dev/sda1, there's no way I can put it into/etc/fstab
because I can't ensure the underlying filesystem is mounted in time.

Another enigma - although /etc/init.d/localmount says:

description="Mounts disks and swap according to /etc/fstab."

there's also /etc/init.d/swap, which calls swapon.

TODO: does mount -a mount swaps? ... I suspect not - the /description/
is apparently bogus.


On 2020-03-18 19:35, n952162 wrote:


Okay, after many hours of investigation and experimentation, I finally
figured this out.

For many years now, I have written my /etc/fstab using the
/dev/disk/by-id directory, because I think it's easier to keep track
of the names there - it's the only way to do it symbolically.

It's always struck me that nobody else does that and I've wondered
why...  now I know...

It turns out, that, now, on my computer, those names aren't set up
yet.  The "missing" devices caused the localmounts service to fail -
partially or fully, randomly - including for the swaps.

When I go through the nasty process of using blkid(8) and specifying
the *UUID=* device name in fstab, then the problem goes away.



On 2020-03-17 13:37, n952162 wrote:


There's new information on this, and new questions...

I discovered that not only are my swaps not mounted, but the other
filesystems listed in /etc/fstab aren't, either.

These are, apparently, mounted by the localmount RC service.

Its status is *started*.  But if I /restart/ it, then my fstab
filesystems get mounted.

Question: /etc/init.d/localhost says:

description="Mounts disks and swap according to /etc/fstab."

but I can't see where that script mounts swaps.  Is the description
obsolete?

Question 2: how can one see the output from the RC "e-trace"
statements (e.g. ebegin/eend)?

I don't find it in /var/log/*


On 2020-03-04 09:09, n952162 wrote:

Hi,

I have 3 swap devices and files.  At boot, it seems indeterminate
which ones get "mounted" (as swap areas).

Does anyone have an idea why they're not all mounted?

Here are the swap lines from my fstab:

#LABEL=swap        none        swap        sw        0 0

 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1    none
swap    sw,pri=10    0 0

/swap    none    swap    sw,pri=5    0 0

/lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swap    none swap   
sw,pri=1    0 0



Re: [gentoo-user] swaps mounted randomly [RESOLVED]

2020-03-18 Thread Michael
On Wednesday, 18 March 2020 19:02:56 GMT n952162 wrote:
> Incidentally, in order to debug that, I set the /etc/rc.conf *rc_logger*
> variable to YES:
> 
> rc_logger="YES"
> 
> I'm not sure why that's not the default, as it appears to be on ubuntu,
> assuming that similar-seeming functionality really is similar.

Because it fills up log files, potentially unnecessarily.  When you have a 
problem you can always set it on during troubleshooting.

Glad you got it sorted.  I saw you were using /dev/disk/by-id directory 
entries and thought that was an acceptable way to define devices - but didn't 
look into it further.


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] swaps mounted randomly [RESOLVED]

2020-03-18 Thread n952162

Incidentally, in order to debug that, I set the /etc/rc.conf *rc_logger*
variable to YES:

rc_logger="YES"

I'm not sure why that's not the default, as it appears to be on ubuntu,
assuming that similar-seeming functionality really is similar.



On 2020-03-18 19:35, n952162 wrote:


Okay, after many hours of investigation and experimentation, I finally
figured this out.

For many years now, I have written my /etc/fstab using the
/dev/disk/by-id directory, because I think it's easier to keep track
of the names there - it's the only way to do it symbolically.

It's always struck me that nobody else does that and I've wondered
why...  now I know...

It turns out, that, now, on my computer, those names aren't set up
yet.  The "missing" devices caused the localmounts service to fail -
partially or fully, randomly - including for the swaps.

When I go through the nasty process of using blkid(8) and specifying
the *UUID=* device name in fstab, then the problem goes away.



On 2020-03-17 13:37, n952162 wrote:


There's new information on this, and new questions...

I discovered that not only are my swaps not mounted, but the other
filesystems listed in /etc/fstab aren't, either.

These are, apparently, mounted by the localmount RC service.

Its status is *started*.  But if I /restart/ it, then my fstab
filesystems get mounted.

Question: /etc/init.d/localhost says:

description="Mounts disks and swap according to /etc/fstab."

but I can't see where that script mounts swaps.  Is the description
obsolete?

Question 2: how can one see the output from the RC "e-trace"
statements (e.g. ebegin/eend)?

I don't find it in /var/log/*


On 2020-03-04 09:09, n952162 wrote:

Hi,

I have 3 swap devices and files.  At boot, it seems indeterminate
which ones get "mounted" (as swap areas).

Does anyone have an idea why they're not all mounted?

Here are the swap lines from my fstab:

#LABEL=swap        none        swap        sw        0 0

 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1    none
swap    sw,pri=10    0 0

/swap    none    swap    sw,pri=5    0 0

/lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swap    none swap   
sw,pri=1    0 0



Re: [gentoo-user] swaps mounted randomly [RESOLVED]

2020-03-18 Thread n952162

Okay, after many hours of investigation and experimentation, I finally
figured this out.

For many years now, I have written my /etc/fstab using the
/dev/disk/by-id directory, because I think it's easier to keep track of
the names there - it's the only way to do it symbolically.

It's always struck me that nobody else does that and I've wondered
why...  now I know...

It turns out, that, now, on my computer, those names aren't set up yet. 
The "missing" devices caused the localmounts service to fail - partially
or fully, randomly - including for the swaps.

When I go through the nasty process of using blkid(8) and specifying the
*UUID=* device name in fstab, then the problem goes away.



On 2020-03-17 13:37, n952162 wrote:


There's new information on this, and new questions...

I discovered that not only are my swaps not mounted, but the other
filesystems listed in /etc/fstab aren't, either.

These are, apparently, mounted by the localmount RC service.

Its status is *started*.  But if I /restart/ it, then my fstab
filesystems get mounted.

Question: /etc/init.d/localhost says:

description="Mounts disks and swap according to /etc/fstab."

but I can't see where that script mounts swaps.  Is the description
obsolete?

Question 2: how can one see the output from the RC "e-trace"
statements (e.g. ebegin/eend)?

I don't find it in /var/log/*


On 2020-03-04 09:09, n952162 wrote:

Hi,

I have 3 swap devices and files.  At boot, it seems indeterminate
which ones get "mounted" (as swap areas).

Does anyone have an idea why they're not all mounted?

Here are the swap lines from my fstab:

#LABEL=swap        none        swap        sw        0 0

 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1    none
swap    sw,pri=10    0 0

/swap    none    swap    sw,pri=5    0 0

/lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swap    none swap   
sw,pri=1    0 0



Re: [gentoo-user] swaps mounted randomly

2020-03-18 Thread n952162

I tried that and it failed with: openrc-run may not run directly

On 2020-03-17 14:14, Neil Bothwick wrote:

On Tue, 17 Mar 2020 13:37:52 +0100, n952162 wrote:


Question 2: how can one see the output from the RC "e-trace" statements
(e.g. ebegin/eend)?

I don't find it in /var/log/*


How about: openrc-run --verbose /etc/init.d/localmount start

Or use --debug for more info.






Re: [gentoo-user] swaps mounted randomly

2020-03-17 Thread n952162

Okay, I'll give that a try.  But I was really hoping for something
during the boot process.

On 2020-03-17 14:14, Neil Bothwick wrote:

On Tue, 17 Mar 2020 13:37:52 +0100, n952162 wrote:


Question 2: how can one see the output from the RC "e-trace" statements
(e.g. ebegin/eend)?

I don't find it in /var/log/*


How about: openrc-run --verbose /etc/init.d/localmount start

Or use --debug for more info.






Re: [gentoo-user] swaps mounted randomly

2020-03-17 Thread Neil Bothwick
On Tue, 17 Mar 2020 13:37:52 +0100, n952162 wrote:

> Question 2: how can one see the output from the RC "e-trace" statements
> (e.g. ebegin/eend)?
> 
> I don't find it in /var/log/*
> 

How about: openrc-run --verbose /etc/init.d/localmount start

Or use --debug for more info.


-- 
Neil Bothwick

There is so much sand in Northern Africa that if it were spread out it
would completely cover the Sahara Desert.


pgpwE_O6EJGK8.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] swaps mounted randomly

2020-03-17 Thread n952162

There's new information on this, and new questions...

I discovered that not only are my swaps not mounted, but the other
filesystems listed in /etc/fstab aren't, either.

These are, apparently, mounted by the localmount RC service.

Its status is *started*.  But if I /restart/ it, then my fstab
filesystems get mounted.

Question: /etc/init.d/localhost says:

description="Mounts disks and swap according to /etc/fstab."

but I can't see where that script mounts swaps.  Is the description
obsolete?

Question 2: how can one see the output from the RC "e-trace" statements
(e.g. ebegin/eend)?

I don't find it in /var/log/*


On 2020-03-04 09:09, n952162 wrote:

Hi,

I have 3 swap devices and files.  At boot, it seems indeterminate
which ones get "mounted" (as swap areas).

Does anyone have an idea why they're not all mounted?

Here are the swap lines from my fstab:

#LABEL=swap        none        swap        sw        0 0

 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1    none swap   
sw,pri=10    0 0

/swap    none    swap    sw,pri=5    0 0

/lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swap    none swap
sw,pri=1    0 0



Re: [gentoo-user] swaps mounted randomly

2020-03-09 Thread Kai Peter

On 2020-03-05 21:01, n952162 wrote:

On 2020-03-05 18:26, Wols Lists wrote:

On 04/03/20 10:19, n952162 wrote:
Yes, everything mounts when I explicitly say swapon -a. No problems 
in

/var/log/messages.

I wonder. Is mount order deterministic at boot? Is it possible that
you're trying to activate the swap files before the underlying file
systems are mounted?

Cheers,
Wol



Yes, that's an issue ... there's two swap files.  One is on the root 
dir

and that one is the only one that came up active when I started the
system this morning.

The other one is on a mounted fs.  Earlier, I'd had it on the following
line to that fs, and as an admittedly feeble attempt, I moved that
swapon to the bottom of the file - who knows if those lines are
processed sequentially.  But it didn't help.

But, the thing is, the swap partition is also not mounted by its fstab
entry.  That wouldn't need an fs to be mounted.


As a workaround you can add swapon -a to local.start ...
--
Sent with eQmail-1.10.3 beta - a fork of djb's famous qmail



Re: [gentoo-user] swaps mounted randomly

2020-03-05 Thread n952162

On 2020-03-05 18:26, Wols Lists wrote:

On 04/03/20 10:19, n952162 wrote:

Yes, everything mounts when I explicitly say swapon -a. No problems in
/var/log/messages.

I wonder. Is mount order deterministic at boot? Is it possible that
you're trying to activate the swap files before the underlying file
systems are mounted?

Cheers,
Wol



Yes, that's an issue ... there's two swap files.  One is on the root dir
and that one is the only one that came up active when I started the
system this morning.

The other one is on a mounted fs.  Earlier, I'd had it on the following
line to that fs, and as an admittedly feeble attempt, I moved that
swapon to the bottom of the file - who knows if those lines are
processed sequentially.  But it didn't help.

But, the thing is, the swap partition is also not mounted by its fstab
entry.  That wouldn't need an fs to be mounted.





Re: [gentoo-user] swaps mounted randomly

2020-03-05 Thread Wols Lists
On 04/03/20 10:19, n952162 wrote:
> Yes, everything mounts when I explicitly say swapon -a.  No problems in
> /var/log/messages.

I wonder. Is mount order deterministic at boot? Is it possible that
you're trying to activate the swap files before the underlying file
systems are mounted?

Cheers,
Wol



Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread n952162
(I see I forgot the case-insensitive flag on the grep, but when I add 
that, the result is the same.)


On 2020-03-05 07:44, n952162 wrote:



On 2020-03-05 00:55, Adam Carter wrote:
On Wed, Mar 4, 2020 at 9:19 PM n952162 > wrote:


Yes, everything mounts when I explicitly say swapon -a.  No
problems in
/var/log/messages.


Anything from 'dmesg | grep -i swap'



This, from this morning:

$ swapon -sv
Filename    Type Size    Used    Priority
/swap   file 6291452 0   5

$ dmesg | grep swap
[    0.160418] Spectre V1 : Mitigation: usercopy/swapgs barriers and 
__user pointer sanitization
[    8.582654] Adding 6291452k swap on /swap. Priority:5 extents:23 
across:8347644k


$ sudo grep 'Mar  5.*swap' /var/log/messages
Mar  5 07:30:53 txm1 kernel: [    0.160418] Spectre V1 : Mitigation: 
usercopy/swapgs barriers and __user pointer sanitization
Mar  5 07:30:53 txm1 kernel: [    8.582654] Adding 6291452k swap on 
/swap.  Priority:5 extents:23 across:8347644k


$ sudo swapon -a

$ swapon -sv
Filename    Type Size    Used    Priority
/swap   file 6291452 0   5
/dev/sdb1   partition 1099772 0   10
/lcl//1/swap    file 3071996 0  1

$ dmesg | grep swap
[    0.160418] Spectre V1 : Mitigation: usercopy/swapgs barriers and 
__user pointer sanitization
[    8.582654] Adding 6291452k swap on /swap. Priority:5 extents:23 
across:8347644k
[  381.200513] Adding 1099772k swap on /dev/sdb1. Priority:10 
extents:1 across:1099772k
[  382.169534] Adding 3071996k swap on /lcl//1/swap.  
Priority:1 extents:129 across:92965568k




Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread n952162


On 2020-03-05 00:55, Adam Carter wrote:
On Wed, Mar 4, 2020 at 9:19 PM n952162 > wrote:


Yes, everything mounts when I explicitly say swapon -a.  No
problems in
/var/log/messages.


Anything from 'dmesg | grep -i swap'



This, from this morning:

$ swapon -sv
Filename    Type Size    Used    Priority
/swap   file 6291452 0   5

$ dmesg | grep swap
[    0.160418] Spectre V1 : Mitigation: usercopy/swapgs barriers and 
__user pointer sanitization
[    8.582654] Adding 6291452k swap on /swap.  Priority:5 extents:23 
across:8347644k


$ sudo grep 'Mar  5.*swap' /var/log/messages
Mar  5 07:30:53 txm1 kernel: [    0.160418] Spectre V1 : Mitigation: 
usercopy/swapgs barriers and __user pointer sanitization
Mar  5 07:30:53 txm1 kernel: [    8.582654] Adding 6291452k swap on 
/swap.  Priority:5 extents:23 across:8347644k


$ sudo swapon -a

$ swapon -sv
Filename    Type Size    Used    Priority
/swap   file 6291452 0   5
/dev/sdb1   partition 1099772 0   10
/lcl//1/swap    file 3071996 0  1

$ dmesg | grep swap
[    0.160418] Spectre V1 : Mitigation: usercopy/swapgs barriers and 
__user pointer sanitization
[    8.582654] Adding 6291452k swap on /swap.  Priority:5 extents:23 
across:8347644k
[  381.200513] Adding 1099772k swap on /dev/sdb1. Priority:10 extents:1 
across:1099772k
[  382.169534] Adding 3071996k swap on /lcl//1/swap.  
Priority:1 extents:129 across:92965568k




Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread Adam Carter
On Wed, Mar 4, 2020 at 9:19 PM n952162  wrote:

> Yes, everything mounts when I explicitly say swapon -a.  No problems in
> /var/log/messages.
>

Anything from 'dmesg | grep -i swap'


Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread n952162

Yes, everything mounts when I explicitly say swapon -a.  No problems in
/var/log/messages.

Here's the output of swapon -sv:

# swapon -sv
Filename    Type Size    Used    Priority
/swap   file 6291452 0   5
/dev/sdb1   partition 1099772 776 10
/lcl/WDC_WD20EFRX-68EUZN0_WD-/1/swap file    3071996
0   1

On 2020-03-04 10:43, Michael wrote:

On Wednesday, 4 March 2020 09:24:31 GMT n952162 wrote:

On 2020-03-04 10:10, Michael wrote:

On Wednesday, 4 March 2020 08:09:45 GMT n952162 wrote:

Hi,

I have 3 swap devices and files.  At boot, it seems indeterminate which
ones get "mounted" (as swap areas).

Does anyone have an idea why they're not all mounted?

Here are the swap lines from my fstab:

#LABEL=swapnoneswapsw0 0

/dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1none swap

sw,pri=100 0

/swapnoneswapsw,pri=50 0

/lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swapnone swap
sw,pri=10 0

The second entry is missing the device you intend to mount.

When you list the first and third devices do you see anything wrong with
them?

When you try to enable them manually with 'swapon -v' what do you get?

PS. If any of these swap block devices are actually files within a fs make
sure you first fill them up with dd, because files with holes in them
could
fail to be enabled.  Also some fs (btrfs?) are not good candidates for
having swap files on them, if they move data around with cow.

The second and third entries are files, created with dd(1), from
/dev/zeros, as shown on the mkswap(8) man page.  No word in
/var/log/messages for non-mounted swaps.

I assume you have run something like this:

dd if=/dev/zero of=/swap bs=4096 count=
mkswap -c -f -L moreswap /swap
swapon -v -o pri=5 /swap

When you run 'swapon -v /swap' does it enable it?  Is dmesg happy?





Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread Michael
On Wednesday, 4 March 2020 09:24:31 GMT n952162 wrote:
> On 2020-03-04 10:10, Michael wrote:
> > On Wednesday, 4 March 2020 08:09:45 GMT n952162 wrote:
> >> Hi,
> >> 
> >> I have 3 swap devices and files.  At boot, it seems indeterminate which
> >> ones get "mounted" (as swap areas).
> >> 
> >> Does anyone have an idea why they're not all mounted?
> >> 
> >> Here are the swap lines from my fstab:
> >> 
> >> #LABEL=swapnoneswapsw0 0
> >> 
> >>/dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1none swap
> >> 
> >> sw,pri=100 0
> >> 
> >> /swapnoneswapsw,pri=50 0
> >> 
> >> /lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swapnone swap
> >> sw,pri=10 0
> > 
> > The second entry is missing the device you intend to mount.
> > 
> > When you list the first and third devices do you see anything wrong with
> > them?
> > 
> > When you try to enable them manually with 'swapon -v' what do you get?
> > 
> > PS. If any of these swap block devices are actually files within a fs make
> > sure you first fill them up with dd, because files with holes in them
> > could
> > fail to be enabled.  Also some fs (btrfs?) are not good candidates for
> > having swap files on them, if they move data around with cow.
> 
> The second and third entries are files, created with dd(1), from
> /dev/zeros, as shown on the mkswap(8) man page.  No word in
> /var/log/messages for non-mounted swaps.

I assume you have run something like this:

dd if=/dev/zero of=/swap bs=4096 count=
mkswap -c -f -L moreswap /swap
swapon -v -o pri=5 /swap

When you run 'swapon -v /swap' does it enable it?  Is dmesg happy?



signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread n952162



On 2020-03-04 10:10, Michael wrote:

On Wednesday, 4 March 2020 08:09:45 GMT n952162 wrote:

Hi,

I have 3 swap devices and files.  At boot, it seems indeterminate which
ones get "mounted" (as swap areas).

Does anyone have an idea why they're not all mounted?

Here are the swap lines from my fstab:

#LABEL=swapnoneswapsw0 0

   /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1none swap
sw,pri=100 0

/swapnoneswapsw,pri=50 0

/lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swapnone swap
sw,pri=10 0


The second entry is missing the device you intend to mount.

When you list the first and third devices do you see anything wrong with them?

When you try to enable them manually with 'swapon -v' what do you get?

PS. If any of these swap block devices are actually files within a fs make
sure you first fill them up with dd, because files with holes in them could
fail to be enabled.  Also some fs (btrfs?) are not good candidates for having
swap files on them, if they move data around with cow.



The second and third entries are files, created with dd(1), from
/dev/zeros, as shown on the mkswap(8) man page.  No word in
/var/log/messages for non-mounted swaps.




Re: [gentoo-user] swaps mounted randomly

2020-03-04 Thread Michael
On Wednesday, 4 March 2020 08:09:45 GMT n952162 wrote:
> Hi,
> 
> I have 3 swap devices and files.  At boot, it seems indeterminate which 
> ones get "mounted" (as swap areas).
> 
> Does anyone have an idea why they're not all mounted?
> 
> Here are the swap lines from my fstab:
> 
> #LABEL=swapnoneswapsw0 0
> 
>   /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_-part1none swap
> sw,pri=100 0
> 
> /swapnoneswapsw,pri=50 0
> 
> /lcl/WDC_WD20EFRX-68EUZN0_WD-yy/1/swapnone swap
> sw,pri=10 0
> 

The second entry is missing the device you intend to mount.

When you list the first and third devices do you see anything wrong with them?

When you try to enable them manually with 'swapon -v' what do you get?

PS. If any of these swap block devices are actually files within a fs make 
sure you first fill them up with dd, because files with holes in them could 
fail to be enabled.  Also some fs (btrfs?) are not good candidates for having 
swap files on them, if they move data around with cow.


signature.asc
Description: This is a digitally signed message part.