[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is there a way to make the pi use swap?



Make sure you have rootwait in your cmdline.txt.  Just that word.  It tells the kernel to wait for a drive to spin up if needed.  I had several nasty hard crashes requiring repowering the Pi without it.  It would swap something out and expect to read it back instantly.  Meanwhile the drive had gone to sleep. Happened .most with memory hogs like Firefox and Gimp running when I'd walk away for >10 minutes.  With an SD card in a USB reader too, not just the hard drive. Maybe it's the Pi USB.  I was in chat with Startech tech support a bunch until I tried the drive on an i386 machine and it didn't happen. I try to not leave it mounted though.


Sent from my Motorola XT1527

On Sat, Sep 15, 2018, 9:20 AM Gene Heskett <gheskett@shentel.net> wrote:
On Friday 14 September 2018 23:36:27 Gene Heskett wrote:

> On Friday 14 September 2018 23:12:35 Alan Corey wrote:
> > Yeah, vmstat shows me
> >
> > procs -----------memory---------- ---swap-- -----io---- -system--
> > ------cpu----- r  b   swpd   free   buff  cache   si   so    bi   
> > bo in   cs us sy id wa st 0  1 423424  43348  16380 212828    0    0
> > 6     6    3    2  8  1 92  0  0
> >
> > Do you have the sw field in your fstab?
>
> Do now, its down below but TLDR, so copied it again.
>
> > /var/swap2 none swap sw 0 0
>
> That's a swap"file". Using it is hard on the u-sd card. This swap is
> on a 300 meg/sec 120GB SSD. Ought to be 50x faster, making it
> semi-usable.
>
> > By the fsstab man page it's the type of the file system.  Or maybe
> > not.    The last 2 numbers have to do with dump/restore and fsck.
>
> Which don't apply to swap, so they could be removed.
>
> New line in etc/fstab that works for swapon -a now is:
>
> UUID=7b06d9bc-18f2-4c25-957d-f426141664b3 none swap defaults,nofail 0
> 0
>
> I nuked the /var/swap file, so we'll see how amanda works in 4 or 5
> hours.
>
> Thanks Alan.

Worked fine, shows amanda used a meg of that swap, with nothing left in
the si/so columns. Tonight I'll leave LCNC running for S&G.


--
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)
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: