Swap slice length probs on install

terrido terrido@stormy1.Eng.Sun.COM
Thu, 12 Mar 1998 09:28:31 -0800 (PST)


Richard,

(See below...)

> From: R.J.Yates@open.ac.uk (Richard Yates SPG)
> Subject: Swap slice length probs on install

> 
> We labelled up a / disk for later encapsulation. It was
> a 1.05GB drive, with s0 for root, and a two-cylinder s1
> for swap, as this gives the size needed for the private
> region for this disk (2.1GB and above only need one
> cylinder).
> 

This is not quite the correct layout for encapsulation.  The Manuals tell you 
what is required for the disk in order to facilitate encapsulation.

If you are not planning on using ANY real swap space on the root disk, then I 
would say that only a couple cylinders would be fine.

The issue you ran into seems to be a lack of "free" space to hold the private 
region.  If the swap is not large enough to hold both the private region and 
some amount of swap, then you will indeed get this kind of error.

There is one other thing to keep in mind when setting up this disk for 
encapsulation.  Even if you are going to use other disks as swap areas, the best 
way to accomplish a core dump space is to keep it on the boot device.  A 2gb 
disk is more than plenty to hold the OS and applications and enough room to hold 
a core file (if and when needed).  

Then there is the "room to house the private region" rule as well.  This takes 
up about 2k, but we are cylinder aligned, so it would be a minimum of 1 cylinder 
on a disk of this size required.

Here is what I normally recommend to people setting up in this manner:

Make the swap slice large enough to house a core of maybe 300 to 500 mb (this is 
system dependent).  All the 'rest' goes into "/"... so we end up with about 1g 
or so for the root area (which will also contain the other necessary filesystems 
of 'usr' and 'var').  When laying out the slicing, set the root to about 1g in 
size, then set up the balance MINUS one or two cylinders for swap.
Make certain the last used slice (in this case swap) ends one or two cylinders 
short of the full length of the disk (listed in slice 2); if the disk lists 
slice two ending at 2035, set the swap slice to end at cylinder number 2033.

This will leave enough room for the private region without it havingto use any 
swap space at all, plus if you enable savecore, it will have plenty of room for 
the core files when needed.

You can still use other swap areas as well.
Regards,
Terrie Douglas
SMCC/CTE Engineer
Mass Storage Specialist
terrie.douglas@Eng.Sun.COM

> This turned out to be a mistake, as on reboot after the
> encapsulation something complained about a zero length
> swap slice, and the #### thing came up 1gle-user. I was
> not there when this went on, so perhaps a quick hack in
> the vfstab and a format and label might've fixed it.
> 
> Any ideas what was happening?
> 
> The workaround was to allow 3 cylinders for swap, then
> things were OK, but this is messy - we were left with a
> disk label with a one-cylinder swap (later disposed of).
> Swap was always going to be on a different device.
> 
> Richard.
> --