Tried to create a swap-file - but ended up in weird situation

good day

from time to time i install eos on a new notebook: or better said on another notebook - (all those notebooks i own - they are not new… ) today i have got a

want to create a swap-temp on my enedavour-os that is installed on a old thinkpad T520

well i guess it is clever to create a swap-file here:

i did this once before: how to proeceed

btw: i try to show hw info of the notebook - with the following

Displaying Detailed Hardware Information
Here we will describe the commands, other than uname, that are used to extract detailed hardware information of your system:

Get Hardware Information with lshw
The lshw utility lets you fetch important hardware information, such as memory, CPU, disks, etc., from your system. Please run the following command as a super user to view this information:

and the command

$ sudo lshw```

but this does not work on endeavour at all


anyway: i have tried to create a swap-file . but see how and where it ended up: 


dd if=/dev/zero of=/1G.swap bs=10M count=100 status=progress
mkswap /1G.swap
swapon /1G.swap
echo “/1G.swap none swap sw,auto 0 0” >> /etc/fstab


- see what i have got back: 

$ dd if=/dev/zero of=/1G.swap bs=10M count=100 status=progress
dd: konnte ‘/1G.swap’ nicht öffnen: Keine Berechtigung
[martin@martin-4243f53 ~]$ su
Passwort:
su: Fehler bei Authentifizierung
[martin@martin-4243f53 ~]$ su
Passwort:
[root@martin-4243f53 martin]# dd if=/dev/zero of=/1G.swap bs=10M count=100 status=progress
1017118720 Bytes (1,0 GB, 970 MiB) kopiert, 13 s, 78,1 MB/s
100+0 Datensätze ein
100+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 13,8079 s, 75,9 MB/s
[root@martin-4243f53 martin]# mkswap /1G.swap
mkswap: /1G.swap: unsichere Zugriffsrechte 0644, korrigieren mit: 0600 /1G.swap
Auslagerungsbereich Version 1 wird angelegt, Größe = 1000 MiB (1048571904 Bytes)
keine Bezeichnung, UUID=150b0270-9ac9-4c4a-9478-c0a81cdc8b22
[root@martin-4243f53 martin]# swapon /1G.swap
swapon: /1G.swap: unsichere Zugriffsrechte 0644, 0600 wird empfohlen
[root@martin-4243f53 martin]#

any ideas what is going wrong here - guess that the Lenovo ´T520 is quite tooo old - and does not contain too much hw - and especially memorey

what  do you day!?

https://discovery.endeavouros.com/storage-and-partitions/adding-swap-after-installation/2021/03/

2 Likes

Looking at that line you need to change the permissions of your swap file from 0644 to 0600 by running: chmod 0600 1G.swap and maybe the link @Stagger_Lee shared may have some other tips about swap files as well.

1 Like

hi there Stagger_lee - hi Cphusion
many many thanks for the hints - and all your advices.

i will have a closer look at all your hints .

many thanks!!

2 Likes