On 9/29/23 17:32, Andy Smith wrote:
Hello,
On Fri, Sep 29, 2023 at 04:36:04PM -0400, gene heskett wrote:
On 9/29/23 15:21, Andy Smith wrote:
On Fri, Sep 29, 2023 at 03:15:54PM -0400, gene heskett wrote:
I have SSD's for swap on an rpi4b, so to lessen the abuse of the u-sd card I
need to turn off the swap file, and swapon -a the SSD stuff.
Have you looked in /etc/fstab where as you know filesystem mounts
are described? If the swap file is listed in there, remove it and
add one that's on your SSD.
[…]
Swap file is the last thing I want, much slower than a swap partition.
There has been no performance difference between swap files and
swap partitions for more than a decade.
Maybe on wintel stuff, but the u-sd card the pi runs on has a write
speed below 10 megs/second, an extremely obvious performance hit, and
wearing out the u-sd card rapidly.
But is swap on an rpi4b not on the sd card? as an invisible swap file?
If so there is an obvious speed hit and that sort of use would be hell
on the u-sd card. I long ago converted the buster install so such swap
was all on an SSD.
Here is that fstab from the buster install:
cnc@rpi4:~$ cat /sdb2/etc/fstab
proc /proc proc defaults 0 0
PARTUUID=5e3da3da-01 /boot vfat defaults 0 2
PARTUUID=5e3da3da-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
UUID=746054d4-9a33-4c79-b028-ff0000c3e40a none swap 0 0
PARTUUID=c61252a1-01 /media/pi/workspace ext4 defaults 0 1
the swap is 10Gigs worth of a 120G SSD on a startech usb/sata thing
and workspace is most of a 240G SSD on a startech usb/sata adapter with
r/w speeds of 4 or 5 hundred megs and write speeds in the 300 range. I
could build lcnc in 30 minutes on that pi. Or a new copy of that kernel
in 23 minutes. And never touch the u-sd card until I installed the debs
for a new lcnc 2 or 3 times a week.
Here is the current fstab:
cnc@rpi4:~$ cat /etc/fstab
UUID=8E25-4B18 /boot/broadcom vfat
defaults,flush 0 2
UUID=47946eb6-d88c-4331-bba9-cbe269a35925 / ext4
defaults,noatime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs
defaults,nosuid 0 0
# to which I've added but commented ATM
#LABEL=TEMP1 /tmp ext4
defaults,noatime,errors=remount-ro 0 1
The label is good, but is the ext4? Thats the format of /dev/sda4
/dev/sda2 is currently mounted as swap, hows below but was not mounted
when I built linuxcnc yesterday. runtests ran normally, so I did a make
clean and built debs, but haven't installed them.
cnc@rpi4:/etc$ sudo swapon -s
Filename Type Size Used
Priority
/dev/zram0 partition 1048572 98304
100
/dev/sda2 partition 9859068 0
-3
I need it to forget zram0 and use the swap on sda2
You didn't respond to the part about /etc/fstab so we have no idea
if you found the information you needed.
I didn't find the swap listed in the fstab, its apparently setup
someplace else in debian 12 for arm64's, so I've not finalized that yet.
Awaiting guidance.
Assuming you did find the errant entry in /etc/fstab, a sequence of:
1. swapoff -a
2. edit /etc/fstab to be correct
3. swapon -a
I'd also point out that despite the presence of the above listed swap,
swapon -a and swapoff -a, does not enable it, I have to mount it by hand.
should change things to how you want them.
Thanks,
Andy
Take care & stay well, Andy.
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>