[lug] Adding memory to a KRUD 7.x system

D. Stimits stimits at idcomm.com
Sat Nov 24 21:40:59 MST 2001


Elyse Grasso wrote:
> 
> On Wednesday 21 November 2001 12:23 pm, you wrote:
> > Elyse Grasso wrote:
> > >
> > > I just ordered some more memory for my Linux laptop (Dell is having a
> sale:
> > > 25% off plus free shipping), and it occurs to me that 2.4.x kernels are
> > > cranky about swap space vs physical ram size. When I upgraded from Redhat
> 7.0
> > > that came installed on the system to KRUD 7.1, the installer insisted on
> > > increasing my swap space.
> > >
> > > I currently have (with 128 megs of ram):
> > >
> > > [root at xerxes /root]# swapon -s
> > > Filename                        Type            Size    Used    Priority
> > > /dev/hda7                       partition       136512  26704   -1
> > > /SWAP                           file            125944  0       -2
> > >
> > > I will be upgrading my memory to 512Megs, maxing out the machine.
> > >
> > > Does anyone know what I will need to do to increase the swap space?
> > > Can I avoid repartitioning my 20 Gig hard drive as the installataion
> package
> > > seems to have done?
> > > Would I be better off repartitioning my hard drive? Is there a way to do
> that
> > > without dumping and reloading the all of the partitions? (I have Partition
> > > Magic on my other machine, so I have gotten spoiled.)
> > >
> > > Note: the Laptop came with Linux installed and is not dual boot. I should
> be
> > > receiving KRUD 7.2 any day now, and do plan to upgrade. (Should I wait
> 'til
> > > the new ram arrives and do both upgrades at once?)
> > >
> > > Elyse Grasso
> > >
> > > ps. I feel old. The very first hard drive I owned was 20 megs, and I
> think I
> > > still have an old hard drive mounted in one of my machines that is smaller
> > > than 512 megs.
> > > _______________________________________________
> > > Web Page:  http://lug.boulder.co.us
> > > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> >
> > The 2.4.x kernels have undergone a huge change with each kernel, in
> > relation to the virtual memory code. Twiddling galore. Earlier kernels
> > of 2.4.x ate a lot of swap, and it was suggested by some developers that
> > the "twice as much swap as ram" was actually a requirement now, and not
> > a rule of thumb (due not so much to swapping applications as attempts to
> > force more caching). It seems that the rule of thumb was then using 2.5x
> > as much swap as ram. But that highly depends on specific kernel. The
> > kernel I'm using is an XFS modified 2.4.6-pre1, and it rarely swaps at
> > all. I haven't tried the newer kernels, but supposedly those are also
> > much nicer on swap. But it's still likely you'll want to have 2x as much
> > swap as ram, just for odd cases (running out of virtual memory is a
> > guaranteed kill of all operating systems...though Out-Of-Memory killing
> > algorithms might kick in and hit some poor application). The nice thing
> > is that you do not have to do it all in one swap partition. You can add
> > them in pieces and leave your current swap in tact. And if you have swap
> > on two separate partitions, and then set them to equal priority, you
> > will get a raid0 striped swap without having to do anything else (just
> > don't do this if they are on the same hard drive...it only works if this
> > is split on two separate drives, else it is a problem, not help).
> >
> > D. Stimits, stimits at idcomm.com
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> >
> >
> Very interesting, but can you answer my question about the best methods and
> tools to use for increasing swap space on an existing system without
> destroying the data partitions?

If you want to increase a partition that is bound on the upper edge by
another partition, I don't know of any way. If you want to decrease
another partition to leave room for expanding another next to it, I
think it is a tough request. For various reasons, I'd say it is easy
with some filesystems to expand the upper edge to consume more, but it
is more problematic to change the lower cylinder edge (the partition or
boot sector info is in the lower edge). Now if you have a chunk of
unpartitioned space (or a partition that you don't need), then you can
just turn that into swap (change its type ID in fdisk, then mkswap on
it, update /etc/fstab, making it a copy of the existing swap, edited to
be a different priority if it is on the same drive, and of course
reflecting its actual partition name). In other words, it's easy to add
swap in multiple partitions, its difficult to shrink anything as a means
of opening up space. Someone here might know of some tools to help with
that, you'd have to specify filesystem type, it has a strong influence
on how possible it is to resize without destroying something in the
partition.

So, do you have an unused partition you can turn into swap? Or do you
have unpartitioned space you can partition and use as swap? Or must you
resize something? If your swap partition itself has empty space to one
side, it's easy, since you can comment out swap in /etc/fstab, then run
swapoff for the partition, and destructively resize it without losing
anything (this of course requires you to not be using so much memory
that swap has to be on). In other cases of resizing, you'd have to give
explicit information on exact geometry of the partitions, and their
filesystem types.

D. Stimits, stimits at idcomm.com

> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list