The officially official Devuan Forum!

You are not logged in.

#1 2020-05-04 13:25:23

Altoid
Member
Registered: 2017-05-07
Posts: 388  

[Solved] Swap partition: swapon error and priority

Hello:

I finally managed to install the Devuan ascii image on my RPi3B+ and boot it from an 40Gb HDD.

dd'd the image to a 2.0Gb SD card and a 40Gb USB2.0 HDD thus generating twin images. 
It boots from the bootfs on the 2.0Gb SD card with the rest of the system on the HDD.

I think I understand how it works, not too clear though.

As the images are identical, the second partition on the SD card has the same UUID as the second partiton on the HDD.
Editing the /etc/fstab file does the rest.

Once I checked it was working properly, I used gparted from my workstation to resize the root partition on the HDD to 2.0Gb and set up /home, /var/log and swap.

This is what fdisk -l and blkid show:

root@rpidevuan:/home/groucho# fdisk -l
--- snip ---
Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1        2048  264191  262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      264192 3872767 3608576  1.7G 83 Linux

Disk /dev/sda: 37.3 GiB, 40060403712 bytes, 78242976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xac806f8a

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/sda2         264192  4458495  4194304    2G 83 Linux
/dev/sda3        4458496 78241791 73783296 35.2G  5 Extended
/dev/sda5        4460544 65658879 61198336 29.2G 83 Linux
/dev/sda6       65660928 67758079  2097152    1G 83 Linux
/dev/sda7       67760128 78241791 10481664    5G 82 Linux swap / Solaris
root@rpidevuan:/home/groucho# blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="EEA4-304A" TYPE="vfat" PARTUUID="d34db33f-01"
/dev/mmcblk0p2: UUID="589c7999-62be-47ac-8847-32b62fd9fdc9" TYPE="ext4" PARTUUID="d34db33f-02"
/dev/sda1: SEC_TYPE="msdos" UUID="EEA4-304A" TYPE="vfat" PARTUUID="ac806f8a-01"
/dev/sda2: LABEL="root" UUID="589c7999-62be-47ac-8847-32b62fd9fdc9" TYPE="ext4" PARTUUID="ac806f8a-02"
/dev/sda5: LABEL="home" UUID="d25be223-0f7a-4394-a555-636340a965b5" TYPE="ext4" PARTUUID="ac806f8a-05"
/dev/sda6: LABEL="log" UUID="2a7f1d75-8347-465b-8452-4f1ca299405b" TYPE="ext4" PARTUUID="ac806f8a-06"
/dev/sda7: LABEL="swap" UUID="1d1727d2-e296-48fb-a6cc-1207cfd6b7be" TYPE="swap" PARTUUID="ac806f8a-07"
/dev/mmcblk0: PTUUID="d34db33f" PTTYPE="dos"

... and /etc/fstab:

groucho@rpidevuan:~$ cat /etc/fstab
## <file system>  <mount point> <type> <options>              <dump><pass>
##
## bootfs on SD Card
# was /dev/mmcblk0p1  /boot  vfat  defaults  0  1
UUID=EEA4-304A /boot vfat  defaults  0  1

## root on HDD /dev/sda2
UUID=589c7999-62be-47ac-8847-32b62fd9fdc9  /  ext4  defaults, noatime  0  1

## /home on HDD /dev/sda5
UUID=d25be223-0f7a-4394-a555-636340a965b5  /home  ext4  defaults,noatime  0  2

## /var/log on HDD /dev/sda6
UUID=2a7f1d75-8347-465b-8452-4f1ca299405b  /var/log  ext4  defaults,noatime  0  2

## /swap on HDD dev/sda7
UUID=1d1727d2-e296-48fb-a6cc-1207cfd6b7be  none  swap  defaults  0  0

When setting the swap partition, I got this:

root@rpidevuan:/home/groucho# swapon -a
swapon: /etc/fstab: parse error at line 9 -- ignored
root@rpidevuan:/home/groucho#

But when I check it I get this:

root@rpidevuan:/home/groucho# free
              total        used        free      shared  buff/cache   available
Mem:         887604       33616      795512        1276       58476      838168
Swap:       5240828           0     5240828
root@rpidevuan:/home/groucho# swapon -s
Filename				Type		Size	Used	Priority
/dev/sda7                              	partition	5240828	0	-2
root@rpidevuan:/home/groucho# 

I used cat -v to parse the /etc/fstab file but I get no errors.

Line 9 is this one:

UUID=1d1727d2-e296-48fb-a6cc-1207cfd6b7be  none  swap  defaults  0  0

Q1:
Any idea as to what is wrong with line 9?

Q2:
Why does the swap file partition have priority -2?

root@rpidevuan:/home/groucho# cat /proc/swaps
Filename				Type		Size	Used	Priority
/dev/sda7                               partition	5240828	0	-2
root@rpidevuan:/home/groucho#

I only have one swap file partition and I don't see the system mounting anything on the SD card:

root@rpidevuan:/home/groucho# mount
/dev/sda2 on / type ext4 (rw,relatime,block_validity,delalloc,nojournal_checksum,norecovery,barrier,user_xattr,acl)
devtmpfs on /dev type devtmpfs (rw,relatime,size=438328k,nr_inodes=109582,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=88764k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1225680k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sda5 on /home type ext4 (rw,noatime,data=ordered)
/dev/sda6 on /var/log type ext4 (rw,noatime,data=ordered)
root@rpidevuan:/home/groucho# 

I have the feeling that I am missing something.
Is this set somewhere else?

Thanks in advance.

Cheers,

A.

Last edited by Altoid (2020-05-05 11:26:36)

Offline

#2 2020-05-04 14:52:23

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 654  
Website

Re: [Solved] Swap partition: swapon error and priority

Altoid wrote:

Any idea as to what is wrong with line 9?

No, looks fine to me. What does this say:

findmnt --verify --verbose
Altoid wrote:

Why does the swap file have priority -2?

I think that's the default value, swapon(8) claims the default is -1 but it's always -2 when I try to create a fresh swap partition.

And btw you appear to have a swap partition rather than a swap file.


"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher." — Antoine de Saint-Exupéry

Offline

#3 2020-05-04 17:49:28

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

Head_on_a_Stick wrote:

... looks fine to me.

Looks fine to me also.
Compared it to my other /etc/fstab files and found no issue.

Head_on_a_Stick wrote:

findmnt --verify --verbose

Here it is:

groucho@rpidevuan:~$ findmnt --verify --verbose
findmnt: /etc/fstab: parse error at line 9 -- ignored
/boot
   [ ] target exists
   [ ] UUID=EEA4-304A translated to /dev/sda1
   [ ] source /dev/sda1 exists
   [W] cannot detect on-disk filesystem type
/home
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=d25be223-0f7a-4394-a555-636340a965b5 translated to /dev/sda5
   [ ] source /dev/sda5 exists
   [W] cannot detect on-disk filesystem type
/var/log
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=2a7f1d75-8347-465b-8452-4f1ca299405b translated to /dev/sda6
   [ ] source /dev/sda6 exists
   [W] cannot detect on-disk filesystem type
none
   [ ] UUID=1d1727d2-e296-48fb-a6cc-1207cfd6b7be translated to /dev/sda7
   [ ] source /dev/sda7 exists
   [W] cannot detect on-disk filesystem type

1 parse error, 0 errors, 4 warnings
groucho@rpidevuan:~$ 

Nice.  =-)
I'll write to my cheat-sheet.

1 parse error, 0 errors, 4 warnings --> all in /dev/sda.

I just now remembered something I had not done: update-initramfs -u.
Done.

Ran findmnt --verify --verbose again:

root@rpidevuan:/home/groucho# findmnt --verify --verbose
findmnt: /etc/fstab: parse error at line 9 -- ignored
/boot
   [ ] target exists
   [ ] UUID=EEA4-304A translated to /dev/sda1
   [ ] source /dev/sda1 exists
   [ ] FS type is vfat
/home
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=d25be223-0f7a-4394-a555-636340a965b5 translated to /dev/sda5
   [ ] source /dev/sda5 exists
   [ ] FS type is ext4
/var/log
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=2a7f1d75-8347-465b-8452-4f1ca299405b translated to /dev/sda6
   [ ] source /dev/sda6 exists
   [ ] FS type is ext4
none
   [ ] UUID=1d1727d2-e296-48fb-a6cc-1207cfd6b7be translated to /dev/sda7
   [ ] source /dev/sda7 exists
   [ ] FS type is swap

1 parse error, 0 errors, 0 warnings

The warnings are gone (must always remember update-initramfs -u)
But the parse error subsists.

Could this be related to the start of /dev/sda?
ie:

root@rpidevuan:/home/groucho# fdisk -l
--- snip ---
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           2048   264191   262144  128M  c W95 FAT32 (LBA)               <------------ this 
/dev/sda2         264192  4458495  4194304    2G 83 Linux
/dev/sda3        4458496 78241791 73783296 35.2G  5 Extended
/dev/sda5        4460544 65658879 61198336 29.2G 83 Linux
/dev/sda6       65660928 67758079  2097152    1G 83 Linux
/dev/sda7       67760128 78241791 10481664    5G 82 Linux swap / Solaris
root@rpidevuan:/home/groucho# 
Head_on_a_Stick wrote:

... default value, swapon(8) claims the default is -1 but it's always -2 when I try to create a fresh swap partition.

Head_on_a_Stick wrote:

... appear to have a swap partition ...

Yes I have.
For some reason I confused them, fixed.
But this will have to wait for a while.

My old HDD just gave up the ghost, shutting down/spinning up so often was probably too much for it's weary heads (ca. 2004).
It's chirping and won't spin up.  =^°

But I have another one in the drawer.
Will come back to the thread once I've set the RPi up again.

Thanks for your input.

Cheers,

A.

Offline

#4 2020-05-04 18:28:16

xinomilo
Member
Registered: 2017-07-02
Posts: 116  

Re: [Solved] Swap partition: swapon error and priority

Altoid wrote:

... and /etc/fstab:

## root on HDD /dev/sda2
UUID=589c7999-62be-47ac-8847-32b62fd9fdc9  /  ext4  defaults, noatime  0  1

this is line 9, you have a space after 'defaults', should be "defaults,noatime"

Offline

#5 2020-05-04 18:43:50

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

xinomilo wrote:

this is line 9, you have a space after 'defaults', should be "defaults,noatime"

Quite so ...

Very sharp!  8^D

Can't look at it now as the drive is toast.
But I'll check that the next install is properly written (maybe tonight) and report back.

Thanks a lot for your input.

Cheers,

A.

Offline

#6 2020-05-04 20:53:45

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 654  
Website

Re: [Solved] Swap partition: swapon error and priority

Altoid wrote:

Could this be related to the start of /dev/sda?

Sector 2048 is the optimal start point for a correctly-aligned drive.


"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher." — Antoine de Saint-Exupéry

Offline

#7 2020-05-04 21:31:28

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

Head_on_a_Stick wrote:

Sector 2048 is the optimal start point for a correctly-aligned drive.

Right ...

Then I'll only have to doble check (I had checked) the etc/fstab file for extra spaces.
I may finish setting up Devuan ascii on the other 40Gb HDD drive in a while, if not tomorrow.

Thanks for your input,

A.

Offline

#8 2020-05-05 12:23:34

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

Altoid wrote:

... the etc/fstab file for extra spaces.

Wrote the Devuan ascii *.img files to the SD card and another 40Gb HDD, then made the modifications mentioned in my OP.
You can see the instructions in a video here.

Changed the size of the swap partition, was a bit overboard.
Will try with 3.0Gb and see how it goes when I run the coffee roasting software as 1Gb RAM is rather tight.

groucho@devuan:~$ cat /etc/fstab
# <file system>  <mount point> <type> <options>              <dump><pass>

# bootfs
# was /dev/mmcblk0p1
UUID=EEA4-304A                             /boot    vfat  defaults          0  1

# root on HDD - was /dev/sda2
UUID=589c7999-62be-47ac-8847-32b62fd9fdc9  /        ext4  defaults,noatime  0  1

# /var/log on HDD - was /dev/sda5
UUID=80f008d9-7f6e-49d2-8df7-d370a02be5df  /var/log ext4  defaults,noatime  0  1

# /home on HDD - was /dev/sda6
UUID=58b362ef-c02d-45c0-8085-dc3996a7d947  /home    ext4  defaults,noatime  0  2

# /swap - was /dev/sda7
UUID=5535c86a-ff6f-46d2-a53b-bad0f38d23fc  none     swap  defaults          0  0

## blkid as of 20200505
# 2.0Gb SD card
# /dev/mmcblk0: PTUUID="ac806f8a" PTTYPE="dos"
# /dev/mmcblk0p1: SEC_TYPE="msdos" UUID="EEA4-304A" TYPE="vfat" PARTUUID="ac806f8a-01"
# /dev/mmcblk0p2: UUID="589c7999-62be-47ac-8847-32b62fd9fdc9" TYPE="ext4" PARTUUID="ac806f8a-02"
#
# 40Gb HDD 
# /dev/sda1: SEC_TYPE="msdos" UUID="EEA4-304A" TYPE="vfat" PARTUUID="d34db33f-01"
# /dev/sda2: UUID="589c7999-62be-47ac-8847-32b62fd9fdc9" TYPE="ext4" PARTUUID="d34db33f-02"
# /dev/sda5: LABEL="log" UUID="80f008d9-7f6e-49d2-8df7-d370a02be5df" TYPE="ext4" PARTUUID="d34db33f-05"
# /dev/sda6: LABEL="home" UUID="58b362ef-c02d-45c0-8085-dc3996a7d947" TYPE="ext4" PARTUUID="d34db33f-06"
# /dev/sda7: LABEL="swap" UUID="5535c86a-ff6f-46d2-a53b-bad0f38d23fc" TYPE="swap" PARTUUID="d34db33f-07"
groucho@devuan:~$ 

I have found it to be a good idea to keep a (dated and commented) output of blkid in the /etc/fstab file.
Keeps everything on the same page when needing to edit or check it.

root@devuan:/home/groucho# findmnt --verify --verbose
/boot
   [ ] target exists
   [ ] UUID=EEA4-304A translated to /dev/sda1
   [ ] source /dev/sda1 exists
   [ ] FS type is vfat
/
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=589c7999-62be-47ac-8847-32b62fd9fdc9 translated to /dev/sda2
   [ ] source /dev/sda2 exists
   [ ] FS type is ext4
/var/log
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=80f008d9-7f6e-49d2-8df7-d370a02be5df translated to /dev/sda5
   [ ] source /dev/sda5 exists
   [ ] FS type is ext4
/home
   [ ] target exists
   [ ] VFS options: noatime
   [ ] UUID=58b362ef-c02d-45c0-8085-dc3996a7d947 translated to /dev/sda6
   [ ] source /dev/sda6 exists
   [ ] FS type is ext4
none
   [ ] UUID=5535c86a-ff6f-46d2-a53b-bad0f38d23fc translated to /dev/sda7
   [ ] source /dev/sda7 exists
   [ ] FS type is swap
Success, no errors or warnings detected
root@devuan:/home/groucho# 

The warnings issued by findmnt --verify --verbose were permission related.
Must be run as root or without  the --verbose modifier.

Had nothing to do with update-initramfs -u.  8^7

root@devuan:/home/groucho# fdisk -l
--- snip ---
Disk /dev/mmcblk0: 1.9 GiB, 1990197248 bytes, 3887104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xac806f8a

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1        2048  264191  262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      264192 3872767 3608576  1.7G 83 Linux

Disk /dev/sda: 37.3 GiB, 40060403712 bytes, 78242976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd34db33f

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/sda2         264192 14942207 14678016    7G 83 Linux
/dev/sda3       14942208 78241791 63299584 30.2G  5 Extended
/dev/sda5       14944256 17041407  2097152    1G 83 Linux
/dev/sda6       17043456 71948287 54904832 26.2G 83 Linux
/dev/sda7       71950336 78241791  6291456    3G 82 Linux swap / Solaris
root@devuan:/home/groucho# 
root@devuan:/home/groucho# swapon -s
Filename				Type		Size	Used	Priority
/dev/sda7                              	partition	3145724	0	-2
root@devuan:/home/groucho# 
root@devuan:/home/groucho# swapon -a
root@devuan:/home/groucho# 

As for the swapon -a parse error, it remains a mystery.
When confronted by something like that again, maybe the MS way is better.
ie: delete and rewrite the line.   8^°

Now to finish the install and do some housekeeping (host name, user, sudoers.d, etc.)
I have another doubt I must address but will do so in a different thread.

Thanks a lot to everyone who helped out with this.

Cheers,

A.

Last edited by Altoid (2020-05-05 12:27:58)

Offline

#9 2020-05-10 09:49:08

larsH
Member
Registered: 2020-05-05
Posts: 21  

Re: [Solved] Swap partition: swapon error and priority

Hi

Try with

UUID=1d1727d2-e296-48fb-a6cc-1207cfd6b7be  none  swap  sw  0  0

instead of

UUID=1d1727d2-e296-48fb-a6cc-1207cfd6b7be  none  swap  defaults  0  0

Have a nice day

Offline

#10 2020-05-10 13:31:26

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 417  

Re: [Solved] Swap partition: swapon error and priority

You might need to recreate the "swap signature" within the changed partition, with

mkswap /dev/sda7

Offline

#11 2020-05-12 13:16:57

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

ralph.ronnquist wrote:

... recreate the "swap signature" ...

Unfortunately that didn't work and somewhere along the line the partition's UUID got changed.

The RPi is originally intended to be used with an SD Card, but I share the opinion that SD Cards were not really intended for the type of use an RPi gives it but for use in cameras and such devices large ie: files written once, read many times over and once moved, eventually deleted.

Hence a swap file/partition being set with a priority of -2.

But I have not seen this swap priority setting in any other Linux installs/images.
So I have to conclude that it is being set as the default value somewhere.

Which begs the question: where is it set?
Any ideas?

My guess is that it is in one of the init files (?), I'll have to look around.

In any case, I found a way to permanently set the swap priority here.

This is how:

1. check the swap partition/file exists:

root@rpidevuan:/home/groucho# free
              total        used        free      shared  buff/cache   available
Mem:         887604       36952      794780        1292       55872      835068
Swap:       3145724           0     3145724
root@rpidevuan:/home/groucho# 

2. check to see where it is mounted

root@rpidevuan:/home/groucho# blkid
--- snip ---
/dev/sda7: UUID="fd8f0765-c88e-43d1-8b8d-9b734fb6322a" TYPE="swap" PARTUUID="d34db33f-07"
root@rpidevuan:/home/groucho# 

3. turn it off

root@rpidevuan:/home/groucho# swapoff /dev/sda7

4. check that it is off

root@rpidevuan:/home/groucho# swapon -s
root@rpidevuan:/home/groucho# 

5. make a backup copy of your /etc/fstab

root@rpidevuan:/home/groucho# cp -p /etc/fstab /etc/fstab.bak
root@rpidevuan:/home/groucho#

6. edit /etc/fstab and add pri=X in place of defaults, with X being the desired value and reboot.

7. check the result

root@rpidevuan:/home/groucho# swapon -s
Filename				Type		Size	Used	Priority
/dev/sda7                              	partition	3145724	0	1
root@rpidevuan:/home/groucho#
root@rpidevuan:/home/groucho# free
              total        used        free      shared  buff/cache   available
Mem:         887604       37884      793036        1292       56684      834100
Swap:       3145724           0     3145724
root@rpidevuan:/home/groucho# 

I opted for a value of 1 but I'll have to check and see how it behaves once I finish my installation and get the coffee roasting software working.

Cheers,

A.

Last edited by Altoid (2020-05-12 13:21:14)

Offline

#12 2020-05-12 14:14:07

larsH
Member
Registered: 2020-05-05
Posts: 21  

Re: [Solved] Swap partition: swapon error and priority

Hi

If you have only one swap partition (or swapfile) the priority has no importance. The priority is only used to choose the priority if you have more swap partitions (or swapfiles).

Make sure the UUID is right or use "/dev/sda7 none swap sw 0 0" in your fstab. If you want to change the priority of swap it is the swappiness of the system you should mess with (in /etc/sysctl.conf). But wait until the system is otherwise behaving well.

Have a nice day
Lars H

Offline

#13 2020-05-12 14:36:02

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

larsH wrote:

... only one swap partition (or swapfile) the priority has no importance.

Yes, I had read about that.

But then I asked myself about the swap priority beng -2 in particular this image (Devuan ascii ARM64) and thought that is was because there was another one somewhere.
ie: a swapfile somewhere in the SD Card, which I do not use save for reading the rootfs.

Then I concluded (as I mention above) that is was due to the use of an SD Card.

larsH wrote:

... choose the priority if you have more swap partitions (or swapfiles).

I have only one.

larsH wrote:

... the UUID is right ...

Yes, that's checked.

larsH wrote:

... change the priority of swap it is the swappiness of the system you should mess with (in /etc/sysctl.conf).

I recall having used that at some time with my workstation which has 8Gb RAM.

larsH wrote:

... wait until the system is otherwise behaving well.

Quite so ...
I need to get my VGA/HDMI adaptor (stuck somewhere in the mail delivery pipe) and set up the desktop/coffee roasting software.
That will be the test and then I'll be able to adjust swap accordingly.

larsH wrote:

Have a nice day

You too ...  =-)

Thanks for your input.

Cheers,

A.

Last edited by Altoid (2020-05-12 14:36:46)

Offline

#14 2020-05-22 21:24:45

Altoid
Member
Registered: 2017-05-07
Posts: 388  

Re: [Solved] Swap partition: swapon error and priority

Hello:

larsH wrote:

... only one swap partition (or swapfile) the priority has no importance.

An update to confirm this.

Long story short ...
Had to install Raspbian in my RPi3b+ and then do all I did before once again.  8^º
No matter, practise = knowledge.

In any case ...
I set up a new /etc/fstab with a /swap partition on the HDD, without turning off the existing swapfile.

When I did swapon -s, I get this:

pi@grouchopi:/$ swapon -s
Filename				Type		Size	Used	Priority
/dev/sda7                              	partition	2675708	0	-2
/var/swap                              	file    	102396	0	-3
pi@grouchopi:/$ free
              total        used        free      shared  buff/cache   available
Mem:         948296       66928      753336       12356      128032      817596
Swap:       2778104           0     2778104
pi@grouchopi:/$ 

I think that the swapfile in the SDCard has it's priority set somewhere at 2 and as a consequence, the /swap parition gets set at 3.

Now I will turn off the swapfile so there's no swapping on the SDCard and change the priority of the /swap partiton to 1 and see how it goes.
The RPi has just 1Gb. RAM.

Cheers,

A.

Offline

Board footer