lkml.org 
[lkml]   [2009]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Maximum size of a swap partition
On Fri, 29 May 2009 08:30:54 +0200
Christoph Pleger <Christoph.Pleger@cs.tu-dortmund.de> wrote:

> Hello,
>
> > what is the maximum size of a swap partition with Kernel 2.6.26 on an
> > x86 and on an x86_64 machine? Some people say that it is 2GB on x86,
> > but that seems not to be true any more.
>
> Is here, in the mailing list where the power of kernel knowledge
> resides, really no one able to answer that question within one day?
>
Mailing list is not a place where a kind man reads all e-mails every day.

At first, start from man. man mkswap says.
==
The maximum useful size of a swap area depends on the architecture and
the kernel version. It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB
on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on sparc64. For ker-
nels after 2.3.3 there is no such limitation.
==
For kernels after 2.3.3 there is no such limitation.

From code,
==
union swap_header {
struct {
char reserved[PAGE_SIZE - 10];
char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
} magic;
struct {
char bootbits[1024]; /* Space for disklabel etc. */
__u32 version;
__u32 last_page;
__u32 nr_badpages;
unsigned char sws_uuid[16];
unsigned char sws_volume[16];
__u32 padding[117];
__u32 badpages[1];
} info;
};
==

last_page represents the size of a swap partition.

Then,
UINT_MAX * PAZE_SIZE = 16Tbytes ? is a limitation for a swap device.
you can use 30 swap devices now.

I'm not sure whether there are other limitations. But maybe enough big.

Bye,
-Kame




\
 
 \ /
  Last update: 2009-05-29 08:51    [W:0.043 / U:28.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site