2019-05-01_Linux_Format

(singke) #1

1114May 209024yGotb2Gturnig May 2019 LXF249 15


Answers


Sometimes – apparently at random


  • when quitting the system the shut-
    down process is literally eternal. I get the
    Mint logo with dots running and never
    stopping. None of these problems arise
    with Mint 19 Mate on the same machine.
    MáximoFraga


A


Do the boot messages show up
before the Mint boot screen
appears? Such messages are usually
harmless, as long as they don’t halt the
booting process, and are probably not
linked to your shutdown problem. These
are kernel messages, and the kernel is a
general-purpose program intended to run
on a wide variety of hardware. To do that it
needs to test for the existence of hardware
features. A failure in any one of those tests
is not necessarily an error – they are
usually just informational or, at most,
warning messages.
Systemd’s journal makes it easy to
find any real error message that occurred
during the boot process, with:
$ sudo journalctl -b -p err
We use sudo to make sure the full system
journal is read and not just your user’s.
The -b option limits entries to those since
the last boot, and -p err shows only
entries with a priority of ‘error’ or higher.
Even this may show ‘errors’ that actually
have no bearing on the smooth running of
your computer, but you can while away a
few hours by pasting them into a search
engine if you are curious.
The shutdown problem is clearly
more serious. The chances are that
the shutdown process has stalled at a
particular point, but you cannot see this
because the splash screen is hiding the
more informative, if less attractive, boot
messages. If you hit Esc as soon as the
shutdown splash screen appears, you
should see the messages from Systemd
(this also applies to other init systems) as it
shuts down your system.
Once you can see where it stops,
you will either be able to work out the
solution yourself or have some concrete
information to plug into your favourite
search engine. One of the most common
causes is when a mounted network
filesystem is no longer available and the
command to unmount it stalls.
Whatever you do, don’t hit the power
switch or reset button when the system
hangs like this – you can cause more
problems for yourself. Use the SysReq
keys, as described in the Quick Reference
box(page16),togetamorecleanreboot.


Q


Zlow filesystem
I thought I would try out ZFS,
having heard so many good things about


it. I have my OS (Ubuntu 18.10) on an
SSD with two 3TB drives (sdb and sdc)
for data, that I tried to set up as a RAID
array using ZFS.
I followed some instructions I found
online and installed the ZFS packages,
created a pool with zpool and then
created a couple of filesystems with
zfs. All appeared to be well, but the
filesystems seem to be very slow. I may
be spoiled by the speed of the SSD, but
I’m sure these drives were a lot faster
when using ext4. There are no errors in
the journal, so what do you think could
be wrong?
EricBartlett

A


This sounds like a problem with the
4K blocks used on larger drives.
Drives used to store data in blocks of 512
bytes, but as they got larger this wouldn’t
work – there were too many blocks to
manage. The manufacturers started using
4K per block once drives reached 2TB in
size, but this confused software, resulting
in dramatically reduced performance. This
used to happen with traditional partitioning
methods until tools like fdisk were updated
to deal with it.
The good news for you is that there is a
option to handle this. The bad news is that
it must be set when creating the data pool,
so you will have to backup all your data,
recreate the pool and filesystems and then
copy back the data. If you have suitable
storage for this, either an external drive or
a network filesystem, the task is easy, if
time-consuming. Back everything up and
create the new pool with:
$ zpool create -o ashift=12 poolname
pooltype devices
The ashift switch does the magic
required to restore performance with 4K
disks. Then re-copy all your data back to
the hard disk.

It’s not as pretty as a splash
screen, but the boot messages
from init tell you a lot more
about what is happening when
you boot or shutdown.

Otherwise, you could use a bit of
trickery to convert your RAID a drive at a
time, but be aware that you will have no
redundancy during this process, so backup
everything important. First you remove
one of the disks from the pool:
$ zpool detach poolname /dev/sdb
Then you create a new pool – but zpool
doesn’t allow you to create a degraded
pool, so we use a bit of trickery. Use fdisk
-l /dev/sdb (or whichever disk you just
removed) to get its size in bytes, then
create a sparse file of exactly this size and
mount it as a loop device with
$ truncate -s SIZE /tmp/dummy.img
$ losetup /dev/loop4 /tmp/dummy.img
Create a new pool using the disk you
removed and this file, then immediately
detach the loop file:
$ zpool create -o ashift=12 newpool mirror
/dev/sdb /dev/loop
$ zpool detach newpool /dev/loop
Now you can recreate your filesystems
on the new pool and copy the data, either
by creating each filesystem and then
rsync-ing the data or by using zfs send /
receive. Once the data is copied, you can
destroy the original pool, add the drive to
the new one and allow it to resilver. As this
is not used for system storage, you can
rename the pool to the old name with
$ zpool export newpool
$ zpoolimportnewpoololdname

Q


Morepepperthanmint
Ireadwithinterestyourreplyto
KenArntsen[lXF245] on upgrading his
Linux Mint to the latest version without
doing a fresh install, thus keeping his
configuration and programs. I’d like
to do the same with my Peppermint
installation. Is this possible, and if so, do
I just replace ‘mint’ with ‘peppermint’ in
the instructions you provided to him?
David Thompson
Free download pdf