Hi Tim,

> Yesterday I reformatted the swap file just encase there had been an
> issue (as mentioned above) and then re-mounted it with out issue.

Swap partitions don't get mounted, so I assume you mean swapon(8).
(Or perhaps some GUI misleadingly describes it as `mounting'.)
Did you swapoff(8) it before re-laying out its data with mkswap(8)?

> This morning I come to my PC to find that one browser had closed and
> the swap was off. Tries to manually start swap and it complained that
> it could not find the UUID. This turned out to be true as the UUID for
> sdb1 had changed, but the question is when did it change?

If it's the UUID from the swap-parition's internal data you're using,
then when you did mkswap(8).  By default, it generates one;
`-U' overrides that.

> Yes I can see that formatting the drive could force the drive to have
> a new UUID but if that was the case how was I able to turn swap on
> yesterday after the formatting it again, I did not change the UUID in
> fstab yesterday afternoon?

Because there's multiple versions of the `truth' varying over time and
you, or the GUI, aren't keeping them in sync.  /etc/fstab is used when
on booting, or `swapon -a'.  The kernel has the UUIDs it's noticed in
the past in RAM.  The partition's data -- filesystem, or description of
swap space -- might have a UUID that's been written since the kernel
last read it.

Try these two commands, see if their output differs because the first
uses what's been cached before whereas the second reads the devices.

    blkid
    sudo -i blkid

If they're the same now then it might be something, e.g. gparted(1), has
already triggered an update for the cache, but they weren't earlier when
you were getting inconsistent results.

You could create your own log file so you see when the swap disappears,
and that would give a time that can be used for examining other logs.
Just leave it running in a terminal.

    while sleep 50; do date -Is; swapon -s; done >swap.log

Cheers, Ralph.

--
  Next meeting at *new* venue:  Bournemouth, Tuesday, 2018-12-04 20:00
  Check if you're replying to the list or the author
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to