Creating swapfile: swapon failure

Dear All
Its a pleasure to be back on Linux even though I am technically a Born Again Newbie. I started with Slackware 0.8 but changed to OS X when it was first released. Only now changing back, so please forgive my poor memory.

I have installed Parrot 4.4 on a 2015 Macbook Air. It was not without its teething problems, I could not set partitions as I wanted, nor get Grub to work very easily, and even stranger, I could not get Parrot 4.7 to boot at all, even from Live USB.

Now running and typing this on Parrot 4.4 on the Macbook Air. I was unable to set up a swap partition during install and so I have been trying to create a swapfile.

I have created /swapfile with root ownership with chmod 600 and can execute mkswap with expected outputs. The problem is swapon, which fails with invalid argument failure.

I initially created /swapfile using fallocate but after reading that this may be the cause, I deleted and created anew using dd.

In both cases, all runs as expected until reaching swapon - everytime fails with same error.

Any help most appreciated

Phil

Hi @PhilR,

Parrot uses the btrfs filesystem which does not need a swap partition, although I think you can create swap partition when using kernel 5.0 and higher with the btrfs filesystem.

If you’re content on using Parrot v4.4, you don’t need to set up a swap partition.

1 Like

Hi bigtasty. Thanks for the information, this can now be another problem solved. I had not realised this about the btrfs file system.
So far, I am very content with Parrot v4.4, which I downloaded some time ago but other commitments had not allowed me the time to indulge with the installation and learning processes.
But you bring up another question, pertaining to my total failure to install or even run Parrot v4.7, is there a significant difference between the two? I noticed that trying to run 4.7 from USB stick went through the loading splash screen, then dark screen with movable cursor only, then frozen cursor, then laptop fan came on and stayed on, screen still black with frozen cursor, then my Macbook Air shut itself down. Tried several times with different sticks burnt with fresh copies, always same outcome, hence I went back to 4.4.
I had wondered if I could upgrade from my 4.4 install, or if I may regret it should it freeze AND burst into flames !!

LOL :fire: step 1: take cover while upgrading.

no, really though you should be fine. Just made sure to run:

parrot-upgrade

it sounds like it may be a problem with your system but the upgrade should go just fine if you have a current, working install.

I took thebull by the horns (or is it the parrot by the beak?) and did a parrot-upgrade.
After some time downloading, unpacking the many packages, it has come up with a number of errors starting with
“Get:1 http://deb.parrotsec.org/parrot stable InRelease [14.4 kB]
Fetched 14.4 kB in 1s (10.1 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
1603 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: Conflicting distribution: http://deb.parrotsec.org/parrot stable
InRelease (expected stable but got rolling)
Setting up python2.7-dev (2.7.17-1) …”

and ending up with

"xtracting templates from packages: 100%
Preconfiguring packages …
(Reading database … 412134 files and directories currently installed.)
Removing mariadb-server-10.1 (1:10.1.37-1) …
Failed to stop mariadb.service: Access denied
See system logs and ‘systemctl status mariadb.service’ for details.
dpkg: error processing package mariadb-server-10.1 (–remove):

  • installed mariadb-server-10.1 package pre-removal script subprocess*
    returned error exit status 4
    dpkg: too many errors, stopping
    insserv: warning: current start runlevel(s) (empty) of script mysql'* *overrides LSB defaults (2 3 4 5).* *insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script* *mysql’ overrides LSB defaults (0 1 6).
    insserv: Script ntp has overlapping Default-Start and Default-Stop
    runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
    insserv: Script ssh has overlapping Default-Start and Default-Stop
    runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
    Failed to reload daemon: Access denied
    Failed to reload daemon: Access denied
    Failed to get unit file state for mariadb.service: Access denied
    Failed to retrieve unit state: Access denied
    mariadb.service is a disabled or a static unit, not starting it.
    Errors were encountered while processing:
  • mariadb-server-10.1*
    Processing was halted because there were too many errors.
    Configuring sandbox profiles…
    Sandbox profiles updated!
    E: Sub-process /usr/bin/dpkg returned an error code (1)"

With a whole bunch of errors in between.
This is second run of parrot-install

Should I do something ?
I am reluctant to turn off the machine and restart in case these errors will cause it not to reboot?

Seems to me that something is set to search for updates from the wrong server location?

Any help now greatly appreciated

Phil

Welcome to the Parrot forums Phil :slightly_smiling_face:

I know the devs have made some big changes since 4.4 and some of those errors are familiar on my working system.

ALSO: Don’t reboot just yet. Can you check /var/log/dpkg.log and /var/log/apt/term.log for me to make sure there aren’t any more serious errors (& successes/failures in setting up packages)? if you can put it on pastebin that would be ideal. If not paste what looks like serious stuff here so we can take a look (pls highlight the pasted text then use the </> format button to clean it up)

PS: mariadb-server is dead on my machine as well & not essential database server related so don’t worry about errors related to that atm.

We can go from there & I will make it my personal mission to get you sorted if there is even an issue.

Reboot is far far from my mind at the moment: I fear to even type it here :slightly_smiling_face:

DPKG.LOG
Those are hefty log files - dpkg is over 80 Mb, but fortunately much content oft repeated - (ah, so is this why the parrot name?) But it took longer to open them than it did to make the upgrade !
I am still working my way through this log file to select just the errors.
The most oft repeated lines are:

[—] EE Modeset(0): Failed to get GBM bo for flip to new front.
[—] EE Modeset(0): present flip failed

I will sort these out and make available - forgive my ignorance, but what is pastebin and how do I use it?

TERM.LOG was quicker to process, and I have extracted the error lines below:

Preparing to unpack …/util-linux_2.34-0.1_amd64.deb …
Unpacking util-linux (2.34-0.1) over (2.32.1-0.1) …
Setting up util-linux (2.34-0.1) …
insserv: FATAL: service mountdevsubfs has to be enabled to use service hwclock
insserv: Script ntp has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script ssh has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

Setting up systemd (243-8) …
Installing new version of config file /etc/systemd/journald.conf …
Installing new version of config file /etc/systemd/resolved.conf …
Installing new version of config file /etc/systemd/system.conf …
Installing new version of config file /etc/systemd/user.conf …
Failed to reload daemon: Access denied
Failed to try-restart systemd-networkd.service: Access denied
See system logs and ‘systemctl status systemd-networkd.service’ for details.
Failed to try-restart systemd-resolved.service: Access denied
See system logs and ‘systemctl status systemd-resolved.service’ for details.
Failed to try-restart systemd-timesyncd.service: Access denied
See system logs and ‘systemctl status systemd-timesyncd.service’ for details.
Failed to try-restart systemd-journald.service: Access denied
See system logs and ‘systemctl status systemd-journald.service’ for details.

Unpacking procps (2:3.3.15-2+b1) over (2:3.3.15-2) …
Failed to reload daemon: Access denied
Preparing to unpack …/13-bc_1.07.1-2+b2_amd64.deb …
Unpacking bc (1.07.1-2+b2) over (1.07.1-2+b1) …
Preparing to unpack …/14-cups-daemon_2.3.0-6_amd64.deb …
Unpacking cups-daemon (2.3.0-6) over (2.2.8-5) …
Failed to reload daemon: Access denied

Unpacking cups-server-common (2.3.0-6) over (2.2.8-5) …
^[[1mdpkg:^[[0m libcupsmime1:amd64: dependency problems, but removing anyway as you requested:
cups depends on libcupsmime1 (>= 1.4.0).

Preparing to unpack …/libcupsimage2_2.3.0-6_amd64.deb …
Unpacking libcupsimage2:amd64 (2.3.0-6) over (2.2.8-5) …
^[[1mdpkg:^[[0m libcupscgi1:amd64: dependency problems, but removing anyway as you requested:

Preparing to unpack …/cups-ppdc_2.3.0-6_amd64.deb …
Unpacking cups-ppdc (2.3.0-6) over (2.2.8-5) …
^[[1mdpkg:^[[0m libcupsppdc1:amd64: dependency problems, but removing anyway as you requested:
cups depends on libcupsppdc1 (>= 1.4.0); however:
Package libcupsppdc1:amd64 is to be removed.

Preparing to unpack …/apt_1.8.4+parrot1_amd64.deb …
Unpacking apt (1.8.4+parrot1) over (1.8.0~alpha2) …
Failed to reload daemon: Access denied
Setting up apt (1.8.4+parrot1) …
Installing new version of config file /etc/apt/apt.conf.d/01autoremove …
Failed to reload daemon: Access denied
Failed to get unit file state for apt-daily-upgrade.timer: Access denied
Failed to retrievLog started: 2019-11-28 02:59:12
(Reading database … ^M(Reading database … 5%^M(Reading database … 10%^M(Reading database … 15%^M(Reading database … 20%^M(Read$
Removing mariadb-server-10.1 (1:10.1.37-1) …
Failed to stop mariadb.service: Access denied
See system logs and ‘systemctl status mariadb.service’ for details.
dpkg: error processing package mariadb-server-10.1 (–remove):
installed mariadb-server-10.1 package pre-removal script subprocess returned error exit status 4
dpkg: too many errors, stopping
insserv: warning: current start runlevel(s) (empty) of script mysql' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mysql’ overrides LSB defaults (0 1 6).
insserv: Script ntp has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script ssh has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to get unit file state for mariadb.service: Access denied
Failed to retrieve unit state: Access denied
mariadb.service is a disabled or a static unit, not starting it.
Errors were encountered while processing:
mariadb-server-10.1
Processing was halted because there were too many errors.
Log ended: 2019-11-28 02:59:13e unit state: Access denied
apt-daily-upgrade.timer is a disabled or a static unit not running, not starting it.
Failed to get unit file state for apt-daily.timer: Access denied
Failed to retrieve unit state: Access denied
apt-daily.timer is a disabled or a static unit not running, not starting it.
(Reading database … ^M(Reading database … 5%^M(Reading database … 10%^M(Reading database … 15%^M(Reading database … 20%^M(Readi$
Preparing to unpack …/apt-utils_1.8.4+parrot1_amd64.deb …

Removing mariadb-server-10.1 (1:10.1.37-1) …
Failed to stop mariadb.service: Access denied
See system logs and ‘systemctl status mariadb.service’ for details.
^[[1mdpkg:^[[0m error processing package mariadb-server-10.1 (–remove):
installed mariadb-server-10.1 package pre-removal script subprocess returned error exit status 4
insserv: warning: current start runlevel(s) (empty) of script mysql' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mysql’ overrides LSB defaults (0 1 6).
insserv: Script ntp has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script ssh has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to get unit file state for mariadb.service: Access denied
Failed to retrieve unit state: Access denied
mariadb.service is a disabled or a static unit, not starting it.
^[[1mdpkg:^[[0m mariadb-client-10.1: dependency problems, but removing anyway as you requested:
mariadb-server-10.1 depends on mariadb-client-10.1 (>= 1:10.1.37-1); however:

Package mariadb-client-10.1 is to be removed.
Removing mariadb-client-10.1 (1:10.1.37-1) …
Removing mariadb-client-core-10.1 (1:10.1.37-1) …
Errors were encountered while processing:
mariadb-server-10.1
Log ended: 2019-11-28 02:13:58

Just discovered that the log viewer was not doing what I thought it should be doing, viewing logs. I have been waiting hours for it to finish opening dpkg.log and finally my lack of patience got the better of me and I opened it in Midnight Commander.

It is full of half-configured and half-installed libraries, etc. Many many many of these type of entries, sample below.

I have not shut down as I suspect it will not start again once it tries to boot on so many errors. A shut down will put me back at square 1, and a hassle with installing and then what - never upgrade ?

So any help is greatly appreciated :slight_smile:

SAMPLE from dpkg.log of the many lines of entry like these

Edit: condensed by RTP (non essential)
2018-11-23 15:58:44 remove python-pyproj:amd64 1.9.5.1-4
2018-11-23 15:58:44 status half-configured python-pyproj:amd64 1.9.5.1-4
2018-11-23 15:58:44 status half-installed python-pyproj:amd64 1.9.5.1-4
2018-11-23 15:58:44 status config-files python-pyproj:amd64 1.9.5.1-4
2018-11-23 15:58:45 status not-installed python-pyproj:amd64
2018-11-23 15:58:45 status installed python-pyspatialite:amd64 3.0.1-13
2018-11-23 15:58:45 remove python-pyspatialite:amd64 3.0.1-13

yea that was why I mentioned pastebin :laughing:

please add these mirrors and remove any others. There was likely a mirror conflict.

deb https://deb.parrotlinux.org/parrot/ rolling main contrib non-free
#deb-src https://deb.parrotlinux.org/parrot/ rolling main contrib non-free
deb https://deb.parrotlinux.org/parrot/ rolling-security main contrib non-free
#deb-src https://deb.parrotlinux.org/parrot/ rolling-security main contrib non-free

then run:
parrot-upgrade

(never update with another command this is just a reminder so we can hopefully get this install running. parrot-upgrade command contains commands that hopefully (in most cases) can help prevent some breaks)

Any kernel errors?

Again, forgive my Born Again Newbie-ism, but add the mirrors - Where?

Any guidance on how to use Pastebin most gratefully received, for I suspect I may have issues in the future so it woul dbe good to know.

Will check Kernal errors now

sudo nano /etc/apt/sources.list.d/parrot.list

I have eyeballed my way through kern.log and found many errors that fall into these types

A lot of these types

Nov 27 00:21:44 parrot kernel: [ 0.346612] system 00:00: Plug and Play ACPI device, IDs PNP0103 PNP0c01 (active)
Nov 27 00:21:44 parrot kernel: [ 0.346688] system 00:01: [io 0xffff] has been reserve
Nov 27 00:21:44 parrot kernel: [ 0.347787] system 00:03: [mem 0xe0000000-0xefffffff] could not be reserved

And loads of these
Nov 27 00:21:44 parrot kernel: [ 0.354420] pci 0000:00:1c.2: PCI bridge to [bus 03]
Nov 27 00:21:44 parrot kernel: [ 0.354426] pci 0000:00:1c.2: bridge window [mem 0xc1000000-0xc12fffff]
Nov 27 00:21:44 parrot kernel: [ 0.354443] pci 0000:06:00.0: BAR 15: no space for [mem size 0x00200000 64bit pref]
Nov 27 00:21:44 parrot kernel: [ 0.354445] pci 0000:06:00.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref]
Nov 27 00:21:44 parrot kernel: [ 0.354448] pci 0000:06:05.0: BAR 14: no space for [mem size 0x00200000]
Nov 27 00:21:44 parrot kernel: [ 0.354450] pci 0000:06:05.0: BAR 14: failed to assign [mem size 0x00200000]

Quite a collection of these as well
Nov 27 01:31:04 parrot kernel: [ 909.564320] ERROR @wl_cfg80211_get_station :
Nov 27 01:31:04 parrot kernel: [ 909.564323] Wrong Mac address, mac = 50:0f:f5:e3:9e:c8 profile =50:0f:f5:e3:97:21
Nov 27 01:31:04 parrot kernel: [ 909.564477] ERROR @wl_cfg80211_get_station

I should have been more specific. I meant kernel upgrade errors. please report any of those after upgrading using the new sources file.

Also run
uname -a

so we can see if kernel upgraded.

┌─[phil@parrot]─[~]
└──╼ $uname -a
Linux parrot 4.18.0-parrot10-amd64 #1 SMP Debian 4.18.10-2parrot10 (2018-11-17) x86_64 GNU/Linux

Re kernal upgrade - OK, now I understand
Thanks so much for all this help, I am learning and enjoying

All your suggestions now implimented, in particular parrot.list
I will try to upgrade

Well the attempt to upgrade was rather brief!

Opening lines were:
┌─[root@parrot]─[/home/phil]
└──╼ #parrot-upgrade
Get:1 https://deb.parrotlinux.org/parrot rolling InRelease [14.4 kB]
Get:2 https://deb.parrotlinux.org/parrot rolling-security InRelease [8,749 B]
Get:3 (new user restriction) rolling/main amd64 Packages [16.9 MB]
Get:4 (new user restriction) rolling/contrib amd64 Packages [129 kB]
Get:5 (new user restriction) rolling/non-free amd64 Packages [207 kB]
Get:6 (new user restriction) rolling-security/main amd64 Packages [260 kB]
Get:7 (new user restriction) rolling-security/non-free amd64 Packages [618 B]
Fetched 17.5 MB in 1min 29s (196 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
1603 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
Setting up x11-common (1:7.7+20) …
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: Script ntp has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script ssh has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to restart x11-common.service: Access denied
See system logs and ‘systemctl status x11-common.service’ for details.
invoke-rc.d: initscript x11-common, action “restart” failed.
Failed to get properties: Access denied
dpkg: error processing package x11-common (–configure):
installed x11-common package post-installation script subprocess returned error exit status 1
Setting up pcscd (1.8.25-2) …
insserv: Script ntp has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script ssh has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to restart pcscd.service: Access denied
See system logs and ‘systemctl status pcscd.service’ for details.
invoke-rc.d: initscript pcscd, action “restart” failed.
Failed to get properties: Access denied
dpkg: error processing package pcscd (–configure):
installed pcscd package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of default-mysql-server:
default-mysql-server depends on mariadb-server-10.3; however:
Package mariadb-server-10.3 is not installed.

dpkg: error processing package default-mysql-server (–configure):
dependency problems - leaving unconfigured
Setting up dbus (1.12.16-2) …
A reboot is required to replace the running dbus-daemon.
Please reboot the system when convenient.

Note the request for the dreaded reboot !

Loads more errors, many dpkg errors, then finishing up with …

See system logs and ‘systemctl status mariadb.service’ for details.
dpkg: error processing package mariadb-server-10.1 (–remove):
installed mariadb-server-10.1 package pre-removal script subprocess returned error exit status 4
dpkg: too many errors, stopping
insserv: warning: current start runlevel(s) (empty) of script mysql' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mysql’ overrides LSB defaults (0 1 6).
insserv: Script ntp has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script ssh has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to get unit file state for mariadb.service: Access denied
Failed to retrieve unit state: Access denied
mariadb.service is a disabled or a static unit, not starting it.
Errors were encountered while processing:
mariadb-server-10.1
Processing was halted because there were too many errors.
Configuring sandbox profiles…
Sandbox profiles updated!
E: Sub-process /usr/bin/dpkg returned an error code (1)

Suggestions most welcome please
Is this time to re-install 4.4 from USB, then make changes to parrot.list and then try upgrade?

Before jumping to reinstall from scratch, you can at least try booting regularly to see how it goes.

If it doesn’t boot/function on regular boot, you can attempt to boot into rescue mode. To get into Rescue mode on boot, on Grub screen, go down to
Advanced Boot Options.

Then select

Kernel-version-here (rescue mode).

Then look through the logs in /var/log to see what parts of Parrot failed to start.

Then you can try to repair/install these packages to repair system.

Or, if it is a crazy list of failed & broken essential apps, it might be worth the reinstall. But try the regular boot, then rescue mode first. You never know til you try. It may boot. Either way, an opportunity to experiment/learn something :grin:

Very sensible, I will give it a try.
Hopefull will be back to report on my adventures soon

1 Like

I’m up and running again after a forced hard shutdown (it just would not shutdown, even with forced shutdown command in a root window) then reboot which went straight to normal mode no problem, the followed by another parrot-install.
So far, so good, at least it boots with the updated kernel. I have taken a look at the logs nothing now stands out as being particularly nasty. Maybe all is now well.
Thanks for everything - I look forward to being able to help on this forum as well as be helped - just needs patience and effort

1 Like