[gull] hibernate: kernel vs userspace

Grossiord Yves yves.grossiord at wanadoo.fr
Thu Jul 19 20:47:11 CEST 2007


Bonjour,

On jeu, 2007-07-19 at 11:00 +0200, Yann Sagon wrote:
> Daniel Cordey wrote:
> >> (depuis, j'ai pris l'habitude 
> >> de partitionner mes disques de la manière suivante:
> >>    1: /boot   120Mo (selon l'application de la machine)
> >>    2: swap    2Go (en principe ~2x la mémoire réelle de la machine...)
> >>    3: LVM     Reste du disque.
> >
> > Alors, pourquoi pas swap en tout premier ? /boot est utilise une seule fois 
> > lors du boot et pour une faible quantite de donnees (j'exclu les 
> > rares 'vi /boot/grub/menu.lst' et les MAJ du kernel)... Non ?
>    
> En supposant un disque actuel, (au moins 200Go) tu ne crois pas que 
> placer le swap avant ou après 120Mo c'est idem?
> 
> Enfin ça serait intéressant de faire le test, effectivement. Encore 
> faut-il avoir le temps :)

Je crois que l'habitude de creer une partition /boot separee et
de la placer en premier vient du fait que pendant un certain
temps, il fallait qu'elle soit contenue dans les 1024 premiers
cylindres du disque (a cause d'une limitation du BIOS et/ou de
LILO). Ce n'est (en general) plus le cas aujourd'hui.

En ce qui concerne, la partition de swap, les recommandations
sont:
- (acheter plus de memoire ;^)
- (le placement n'a plus beaucoup d'importance ;^)
- mettre plusieurs partitions de swap sur plusieurs disques
- mettre la partition sur le disque le moins utilise
- mettre la partition sur les pistes exterieures du disque
- mettre la partition pres des donnees les plus utilisees
- ...

Cordialement, Yves.


http://tldp.org/HOWTO/Partition/requirements.html
http://lissot.net/partition/mapping.html
(desole, je n'ai pas trouve la version francaise)

4.2. Discussion:

Boot Partition

Your boot partition ought to be a primary partition, not a logical
partition. This will ease recovery in case of disaster, but it is not
technically necessary. It must be of type 0x83 "Linux native". If you
are using a version of lilo before 21-3 (ie, from the 1990s), your boot
partition must be contained within the first 1024 cylinders of the
drive. (Typically, the boot partition need only contain the kernel
image.)

If you have more than one boot partition (from other OSs, for example,)
keep them all in the first 1024 cylinders (All DOS partitions must be
within the first 1024). If you are using a modern version of lilo, or a
means other than lilo to load your kernel (for example, a boot disk or
the LOADLIN.EXE MS-DOS based Linux loader), the partition can be
anywhere.

...

4.4.3. Where should I put my swap space?

The short answer is anywhere is fine. However, if you are interested in
extracting as much speed as possible, there are two basic strategies
(other than buying more RAM).

* Split the swap space across multiple drives, or at least on the drive
you write to least. 
* Put each swap partition on the outer tracks. 
        
Here are the considerations:

* If you have a disk with many heads and one with less heads and both
are identical in other parameters, the disk with many heads will be
faster. Reading data from different heads is fast, since it is purely
electronic. Reading data from different tracks is slow, since it
involves physically moving the head. 

  It follows then that writing swap on a separate drive will be faster
than moving the head back and forth on a single drive. 
        
* Placement: Older disks have the same number of sectors on all tracks.
With these disks it will be fastest to put your swap in the middle of
the disks, assuming that your disk head will move from a random track
towards the swap area. 

* Newer disks use ZBR (zone bit recording). They have more sectors on
the outer tracks. With a constant number of rpms, this yields a far
greater performance on the outer tracks than on the inner ones. Put your
swap on the fast tracks. (In general, low-numbered cylinders are
associated low partition numbers. However, see Kristian's more recent
comments on this issue. -Tony) 

* Usage: Of course your disk head will not move randomly. If you have
swap space in the middle of a disk between a constantly busy home
partition and an almost unused archive partition, you would be better of
if your swap were near the home partition for even shorter head
movements. You would be even better off, if you had your swap on another
otherwise unused disk, though. 

* Striping: Speed can be increased by writing to multiple swap areas
simultaneously. Swap spaces with the same priority will be written to
like a RAID. See Section 9.3.

Summary: Put your swap on a fast disk with many heads that is not busy
doing other things. If you have multiple disks: Split swap and scatter
it over all your disks or even different controllers.






More information about the gull mailing list